├── .envrc ├── .gitignore ├── LICENSE ├── README.md ├── desktop ├── dwm │ ├── autostart.sh │ └── default.nix ├── hyprland │ └── default.nix ├── i3 │ ├── default.nix │ ├── i3blocks.toml │ └── i3config ├── kde │ └── default.nix ├── sway │ └── default.nix └── xmonad │ ├── config.hs │ ├── default.nix │ └── xmobar.hs ├── flake.lock ├── flake.nix ├── home-configurations ├── arch │ └── default.nix ├── box │ └── default.nix ├── debian │ └── default.nix └── wsl │ └── default.nix ├── hosts ├── chad │ ├── default.nix │ ├── hardware-configuration.nix │ └── home.nix └── nixos │ ├── default.nix │ ├── gamer.nix │ ├── gpu-passthrough.nix │ ├── hardware-configuration.nix │ ├── home.nix │ ├── prime.nix │ └── qmk-support.nix ├── lib ├── default.nix ├── overlays.nix └── prelude.nix ├── nixos-pkgs ├── display-managers │ ├── lightdm.nix │ └── sddm │ │ └── default.nix ├── docker.nix ├── grub │ ├── os-prober.nix │ └── themes │ │ └── fallout.nix ├── kmonad │ ├── default.nix │ └── kmonad.nix ├── lutris.nix ├── manpages.nix ├── slock.nix ├── steam.nix ├── virt-manager.nix ├── virtualbox.nix ├── wine.nix └── zsh.nix ├── nixos-services ├── ckb-next.nix └── noisetorch.nix ├── overlay └── default.nix ├── pkgs ├── alacritty.nix ├── base16-shell.nix ├── bash.nix ├── bat.nix ├── beekeeper-studio.nix ├── betterlockscreen.nix ├── bitwarden.nix ├── blugon │ ├── config │ ├── default.nix │ └── gamma ├── chromium.nix ├── conserve.nix ├── direnv.nix ├── editors │ ├── doom │ │ ├── config │ │ │ ├── config.el │ │ │ ├── init.el │ │ │ └── packages.el │ │ └── default.nix │ ├── emacs │ │ ├── default.el │ │ ├── default.nix │ │ └── theme.el │ ├── nvim │ │ ├── README.md │ │ ├── colorschemes │ │ │ ├── dracula.nix │ │ │ ├── github-dark.nix │ │ │ ├── gruvbox-material.nix │ │ │ ├── gruvbox.nix │ │ │ ├── improved-darkblue.nix │ │ │ ├── nix-colors.nix │ │ │ ├── nord.nix │ │ │ ├── onedark.nix │ │ │ ├── tokyonight.nix │ │ │ └── vscode.nix │ │ ├── default.nix │ │ ├── init.vim │ │ ├── languages │ │ │ ├── rust-vim.nix │ │ │ └── vim-go.nix │ │ ├── lsp │ │ │ ├── ccls.nix │ │ │ ├── clangd.nix │ │ │ ├── clojure.nix │ │ │ ├── elixir-ls.nix │ │ │ ├── erlang.nix │ │ │ ├── fsharp.nix │ │ │ ├── go.nix │ │ │ ├── godot.nix │ │ │ ├── haskell.nix │ │ │ ├── latex.nix │ │ │ ├── lexical.nix │ │ │ ├── lua.nix │ │ │ ├── nil.nix │ │ │ ├── node.nix │ │ │ ├── omnisharp.nix │ │ │ ├── python.nix │ │ │ ├── rnix.nix │ │ │ ├── rust.nix │ │ │ ├── test-ls.nix │ │ │ └── zig.nix │ │ ├── map-leader.nix │ │ ├── plugins │ │ │ ├── alpha.nix │ │ │ ├── autopairs.nix │ │ │ ├── base16.nix │ │ │ ├── bufferline.nix │ │ │ ├── chadtree.nix │ │ │ ├── closetag.nix │ │ │ ├── cmp.nix │ │ │ ├── colorizer.nix │ │ │ ├── compe.nix │ │ │ ├── conjure.nix │ │ │ ├── coq.nix │ │ │ ├── dap-ui.nix │ │ │ ├── dap.nix │ │ │ ├── fidget-nvim.nix │ │ │ ├── fugitive.nix │ │ │ ├── fzf-checkout.nix │ │ │ ├── fzf-session.nix │ │ │ ├── fzf.nix │ │ │ ├── git-blame.nix │ │ │ ├── gitsigns.nix │ │ │ ├── indentline.nix │ │ │ ├── lfe.nix │ │ │ ├── lsp-extensions.nix │ │ │ ├── lsp-signature.nix │ │ │ ├── lsp_lines.nix │ │ │ ├── lspconfig.nix │ │ │ ├── lualine.nix │ │ │ ├── luasnip.nix │ │ │ ├── neomake.nix │ │ │ ├── neorg.nix │ │ │ ├── neovim-session-manager.nix │ │ │ ├── nvim-lint.nix │ │ │ ├── nvim-tree.nix │ │ │ ├── orgmode-nvim.nix │ │ │ ├── pears.nix │ │ │ ├── presence.nix │ │ │ ├── projectionist.nix │ │ │ ├── rainbow.nix │ │ │ ├── slash.nix │ │ │ ├── splitjoin.nix │ │ │ ├── startscreen.nix │ │ │ ├── telescope.nix │ │ │ ├── todo-comments.nix │ │ │ ├── togglelist.nix │ │ │ ├── tree-sitter.nix │ │ │ ├── trouble.nix │ │ │ ├── ultisnips.nix │ │ │ ├── vim-journal.nix │ │ │ ├── vim-quickrun.nix │ │ │ ├── vim-slime.nix │ │ │ ├── vim-test.nix │ │ │ ├── visual-multi.nix │ │ │ ├── which-key.nix │ │ │ └── wilder.nix │ │ └── profiles │ │ │ └── web.nix │ ├── vim │ │ └── default.nix │ └── vscodium │ │ ├── default.nix │ │ ├── extensions │ │ ├── bash.nix │ │ ├── cpp.nix │ │ ├── elixir.nix │ │ ├── fsharp.nix │ │ ├── go.nix │ │ ├── haskell.nix │ │ ├── latex.nix │ │ ├── liveshare.nix │ │ ├── markdown.nix │ │ ├── nix.nix │ │ ├── rust.nix │ │ ├── toml.nix │ │ ├── unity.nix │ │ └── vspacecode │ │ │ ├── default.nix │ │ │ ├── vspacecode-keybindings.json │ │ │ └── vspacecode-settings.json │ │ ├── keybindings.nix │ │ └── settings.nix ├── exa.nix ├── fcp.nix ├── firefox.nix ├── fish.nix ├── fzf.nix ├── games │ └── dwarf-fortress │ │ ├── colors.txt │ │ ├── d_init.txt │ │ ├── default.nix │ │ ├── dfhack.init │ │ └── init.txt ├── gdb-dashboard.nix ├── git.nix ├── gpg.nix ├── gtk.nix ├── hexchat.nix ├── htop.nix ├── irssi.nix ├── jq.nix ├── keychain.nix ├── kitty.nix ├── kmonad.nix ├── kmonad │ ├── configs │ │ └── ck61.kbd │ └── derivation.nix ├── lazydocker.nix ├── lazygit.nix ├── lutris.nix ├── mako.nix ├── mangohud.nix ├── manpages.nix ├── mpv.nix ├── newsboat.nix ├── nix-index.nix ├── nnn.nix ├── obs-studio.nix ├── pomatez.nix ├── psst.nix ├── qt.nix ├── readline │ ├── .inputrc │ └── default.nix ├── remnote.nix ├── rofi │ └── default.nix ├── starship.nix ├── tiny.nix ├── tmux │ ├── default.nix │ └── tmux.conf ├── trash-cli.nix ├── waybar.nix ├── wayst.nix ├── zoxide.nix └── zsh.nix ├── profiles ├── haskell │ ├── .ghci │ ├── .haskeline │ └── default.nix └── ricing.nix ├── services ├── dunst.nix ├── flameshot.nix ├── gammastep.nix ├── gpg-agent.nix ├── picom.nix └── polybar.nix ├── templates ├── basic │ └── flake.nix ├── default.nix ├── elixir │ └── flake.nix ├── fsharp │ └── flake.nix ├── go │ ├── .editorconfig │ ├── flake.nix │ ├── go.mod │ └── main.go └── rust │ ├── .editorconfig │ ├── .gitignore │ ├── Cargo.toml │ ├── flake.nix │ └── src │ └── main.rs └── utils ├── scripts ├── backup_home.nix ├── default.nix ├── loadgpg.nix ├── loadssh.nix ├── sprunge.nix ├── termbin.nix └── toggle_layout.nix └── windows ├── init.lua └── keyboard.ahk /.envrc: -------------------------------------------------------------------------------- 1 | use flake 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .direnv/ 2 | result 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Vinícius Müller 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

❄️ My Nix/NixOS Dotfiles

2 | 3 | # Installation 4 | 5 | ## NixOS 6 | ```bash 7 | git clone https://github.com/arcticlimer/dotfiles 8 | sudo nixos-rebuild switch --flake ./dotfiles# 9 | ``` 10 | ## Non-NixOS using home-manager 11 | ```bash 12 | # Note: It requires nixUnstable and `experimental-features = nix-command flakes` 13 | git clone https://github.com/arcticlimer/dotfiles 14 | nix build ".#homeConfigurations..activationPackage" && ./result/activate 15 | ``` 16 | 17 | # Structure 18 | - `pkgs` -> Packages for home-manager. 19 | - `nixos-pkgs` -> Packages from the `pkgs` directory wrapped to work with NixOS (E.g: Adds the "docker" group to an user). 20 | - `nixos-services` -> Services wrapped to work with NixOS. 21 | - `desktop` -> Wrappers around `pkgs` to build different desktop environments. 22 | - `services` -> Home-manager services. 23 | - `profiles` -> Things such as different development environments. 24 | - `hosts` -> My configurations for different machines 25 | - `home-configurations` -> Home-manager configurations. 26 | - `utils` -> Useful scripts. 27 | - `templates` -> Template flakes for different kinds of projects. 28 | -------------------------------------------------------------------------------- /desktop/dwm/autostart.sh: -------------------------------------------------------------------------------- 1 | # Dwm runs this script in a non-blocking way when it starts 2 | slstatus 3 | xbanish & 4 | -------------------------------------------------------------------------------- /desktop/dwm/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, username, ... }: 2 | 3 | # Config for the dynamic window manager 4 | let 5 | switch = pkgs.writeShellScriptBin "switch" '' 6 | windows=$(${pkgs.wmctrl}/bin/wmctrl -xl | tr -s '[:blank:]' | cut -d ' ' -f 3-3,5- | sed 's/^[a-zA-Z0-9-]*\.//' | sort | uniq) 7 | 8 | # Add spaces to align the WM_NAMEs of the windows 9 | max=$(echo "$windows" | awk '{cur=length($1); max=(cur>max?cur:max)} END{print max}') 10 | 11 | windows=$(echo "$windows" | \ 12 | awk -v max="$max" \ 13 | '{cur=length($1); printf $1; \ 14 | for(i=0; i < max - cur + 1; i++) printf " "; \ 15 | $1 = ""; printf "%s\n", $0}') 16 | 17 | 18 | target=$(echo "$windows" | ${pkgs.dmenu}/bin/dmenu $@ -l 10 -i | tr -s '[:blank:]' | cut -d ' ' -f 2-) 19 | 20 | if [[ -n $target ]]; then 21 | ${pkgs.wmctrl}/bin/wmctrl -a "$target" 22 | fi 23 | ''; 24 | in 25 | { 26 | # Enable the X11 windowing system. 27 | services.xserver = { 28 | enable = true; 29 | windowManager.dwm.enable = true; 30 | }; 31 | 32 | programs.slock.enable = true; 33 | 34 | home-manager.users.${username} = { 35 | imports = [ 36 | ../../services/dunst.nix # Notification daemon 37 | # ../../services/picom.nix # Compositor 38 | ../../pkgs/kitty.nix # Terminal 39 | ../../services/flameshot.nix 40 | ]; 41 | 42 | home.packages = with pkgs; [ 43 | wmctrl # Helper for window managers 44 | xbanish # Hides the mouse when using the keyboard 45 | switch 46 | alsa-utils 47 | 48 | # Overlays from https://github.com/arcticlimer/suckless 49 | slock 50 | dmenu 51 | slstatus 52 | st 53 | ]; 54 | 55 | home.file.".config/dwm/autostart.sh".source = ./autostart.sh; 56 | }; 57 | } 58 | -------------------------------------------------------------------------------- /desktop/i3/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, username, ... }: 2 | 3 | let 4 | i3blocks-contrib = pkgs.fetchFromGitHub { 5 | owner = "vivien"; 6 | repo = "i3blocks-contrib"; 7 | rev = "07dbf036882c513b58e7d18d48eb6f08493f5717"; 8 | sha256 = "sha256-i9xSYo7BkYfzDqgwOEOtYtCYblJI5ldc1oBgX9EVQqA="; 9 | }; 10 | in 11 | { 12 | # Make i3-sensible-terminal respect kitty 13 | environment.sessionVariables.TERMINAL = [ "kitty" ]; 14 | 15 | services.xserver = { 16 | enable = true; 17 | 18 | windowManager.i3 = { 19 | enable = true; 20 | extraPackages = with pkgs; [ 21 | dmenu #application launcher most people use 22 | i3lock #default i3 screen locker 23 | i3blocks #if you are planning on using i3blocks over i3status 24 | ]; 25 | configFile = ./i3config; 26 | }; 27 | }; 28 | 29 | home-manager.users.${username} = { 30 | home.file.".i3blocks.conf".source = ./i3blocks.toml; 31 | # home.file.".config/i3blocks".source = i3blocks-contrib; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /desktop/i3/i3blocks.toml: -------------------------------------------------------------------------------- 1 | # Guess the weather 2 | [weather] 3 | command=curl -Ss 'https://wttr.in?0&T&Q' | cut -c 16- | head -2 | xargs echo 4 | interval=600 5 | color=#A4C2F4 6 | 7 | [disk] 8 | # TODO: Improve this 9 | command=df -h / | awk '/\//{ printf(" 💾 %4s/%s \n", $4, $2) }' 10 | interval=2 11 | color=#C9E3DB 12 | 13 | [MEM] 14 | command=free -h | awk '/Mem:/ { printf(" 🐏 %5s/%s \n", $3, $2) }' 15 | interval=1 16 | color=#FEC925 17 | 18 | [time_date] 19 | command=date +" %a, %d %b - %H:%M:%S" 20 | interval=1 21 | -------------------------------------------------------------------------------- /desktop/kde/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | services.xserver.desktopManager.plasma5.enable = true; 5 | 6 | # environment.systemPackages = with pkgs; [ 7 | # kde-gtk-config 8 | # ]; 9 | } 10 | -------------------------------------------------------------------------------- /desktop/xmonad/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, username, ... }: 2 | 3 | { 4 | services.xserver = { 5 | enable = true; 6 | windowManager.xmonad = { 7 | enable = true; 8 | config = ./config.hs; 9 | extraPackages = hp: [ 10 | hp.xmonad-contrib 11 | ]; 12 | }; 13 | }; 14 | 15 | home-manager.users.${username} = { 16 | imports = [ 17 | ../../pkgs/rofi # Application launcher and window switcher 18 | ../../services/dunst.nix # Notification daemon 19 | # ../../services/picom.nix # Compositor 20 | ../../services/flameshot.nix # Screenshots 21 | # ../../services/polybar.nix 22 | ../../pkgs/betterlockscreen.nix # Screen locker 23 | ]; 24 | 25 | home.packages = with pkgs; [ 26 | xorg.xmessage # Xmonad uses this to show help 27 | xmobar # Status bar for xmonad 28 | xbanish # Hides the mouse when using the keyboard 29 | ]; 30 | 31 | home.file = { 32 | ".xmobarrc".source = ./xmobar.hs; 33 | }; 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /desktop/xmonad/xmobar.hs: -------------------------------------------------------------------------------- 1 | Config { font = "xft:JetBrains Mono:pixelsize=11:antialias=true:hinting=true" 2 | , borderColor = "black" 3 | , border = TopB 4 | , bgColor = "black" 5 | , fgColor = "grey" 6 | , position = TopW L 100 7 | , commands = [ Run Weather "SBPA" ["-t","°C","-L","18","-H","25","--normal","green","--high","red","--low","lightblue"] 18000 8 | , Run Cpu ["-L","3","-H","50","--normal","lightgreen","--high","red"] 10 9 | , Run Memory ["-t","Mem: MB"] 10 10 | , Run Date "%a %b %_d %Y %H:%M:%S" "date" 10 11 | , Run StdinReader 12 | , Run DiskU [("/", "/")] 13 | ["-L", "20", "-H", "50", "-m", "1", "-p", "3", 14 | "--normal", "lightgreen", "--high", "red" ] 20 15 | , Run Kbd [ ("us(intl)", "INTL") 16 | , ("us" , "US") 17 | ] 18 | ] 19 | , sepChar = "%" 20 | , alignSep = "}{" 21 | , template = "%StdinReader% } %date% { %kbd% | %cpu% | %memory% | Disk: %disku% | SBPA: %SBPA% " 22 | } 23 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Personal flake config"; 3 | 4 | inputs = { 5 | # Core 6 | nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; 7 | nixpkgs-master.url = "github:nixos/nixpkgs/master"; 8 | home-manager = { 9 | url = "github:nix-community/home-manager/master"; 10 | inputs.nixpkgs.follows = "nixpkgs"; 11 | }; 12 | 13 | nixgl.url = "github:guibou/nixGL"; 14 | 15 | # Misc 16 | suckless.url = "github:arcticlimer/suckless"; 17 | nix-colors.url = "github:misterio77/nix-colors"; 18 | flake-utils.url = "github:numtide/flake-utils"; 19 | 20 | hyprland = { 21 | url = "github:hyprwm/Hyprland"; 22 | inputs.nixpkgs.follows = "nixpkgs"; 23 | }; 24 | }; 25 | 26 | outputs = { self, flake-utils, nixpkgs, nix-colors, nixpkgs-master, nixgl, hyprland, ... } @inputs: 27 | let 28 | lib = import ./lib inputs; 29 | devShells = flake-utils.lib.eachDefaultSystem ( 30 | system: { 31 | devShell = 32 | let 33 | pkgs = nixpkgs.legacyPackages.${system}; 34 | in 35 | pkgs.mkShell { 36 | buildInputs = with pkgs; [ 37 | # Nix development dependencies 38 | nil 39 | nixpkgs-fmt 40 | ]; 41 | }; 42 | } 43 | ); 44 | in 45 | { 46 | nixosConfigurations = { 47 | nixos = let 48 | system = "x86_64-linux"; 49 | pkgs-master = lib.mkNixpkgs { 50 | inherit system; 51 | nixpkgs = nixpkgs-master; 52 | }; 53 | discord-overlay = final: prev: { 54 | discord = pkgs-master.discord; 55 | }; 56 | in lib.mkHost { 57 | inherit system; 58 | host = "nixos"; 59 | username = "vini"; 60 | extraUsers = ["gamer"]; 61 | overlays = [ 62 | inputs.suckless.overlays 63 | discord-overlay 64 | ]; 65 | homeModules = [ 66 | nix-colors.homeManagerModule 67 | hyprland.homeManagerModules.default 68 | ]; 69 | nixosModules = [ 70 | hyprland.nixosModules.default 71 | ]; 72 | colorscheme = inputs.nix-colors.colorSchemes.nord; 73 | }; 74 | chad = lib.mkHost { 75 | host = "chad"; 76 | system = "x86_64-linux"; 77 | username = "vini"; 78 | homeModules = [ 79 | inputs.nix-colors.homeManagerModule 80 | ]; 81 | }; 82 | }; 83 | 84 | homeConfigurations = 85 | let 86 | system = "x86_64-linux"; 87 | username = "vini"; 88 | in 89 | { 90 | debian = lib.mkHome { 91 | inherit system username; 92 | name = "debian"; 93 | overlays = [ 94 | nixgl.overlay 95 | inputs.suckless.overlays 96 | ]; 97 | colorscheme = inputs.nix-colors.colorSchemes.nord; 98 | }; 99 | arch = lib.mkHome { 100 | inherit system username; 101 | name = "arch"; 102 | }; 103 | wsl = lib.mkHome { 104 | inherit system username; 105 | name = "wsl"; 106 | }; 107 | box = lib.mkHome { 108 | inherit username; 109 | system = "aarch64-linux"; 110 | name = "box"; 111 | }; 112 | }; 113 | templates = import ./templates; 114 | } // devShells; 115 | } 116 | -------------------------------------------------------------------------------- /home-configurations/arch/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | imports = [ 5 | ../../utils/scripts 6 | 7 | # CLI 8 | ../../pkgs/base16-shell.nix # Different shell themes 9 | ../../pkgs/zoxide.nix # Jump directories 10 | ../../pkgs/bash.nix 11 | ../../pkgs/editors/nvim 12 | ../../pkgs/readline # GNU readline input 13 | ../../pkgs/git.nix 14 | ../../pkgs/tmux # Terminal multiplexer 15 | ../../pkgs/fzf.nix # Fuzzy finder 16 | ../../pkgs/direnv.nix 17 | ../../pkgs/exa.nix # ls alternative 18 | ../../pkgs/trash-cli.nix # Safer rm 19 | ../../pkgs/htop.nix # Process viewer 20 | ../../pkgs/keychain.nix 21 | ../../pkgs/gpg.nix 22 | ../../pkgs/bat.nix # File previewer 23 | 24 | # Services 25 | ../../services/gpg-agent.nix 26 | # ../../services/dunst.nix 27 | 28 | # GUI 29 | # ../../pkgs/kitty.nix 30 | ../../pkgs/chromium.nix # Web browser 31 | # ../../pkgs/bitwarden.nix # Password manager 32 | # ../../pkgs/blugon # Screen temperature manager 33 | ]; 34 | 35 | home.packages = with pkgs; [ 36 | # GUI 37 | spotify 38 | 39 | # CLI 40 | ncdu # Curses interface for `du` 41 | file # Shows info about files 42 | neofetch # Shows system information 43 | pfetch # Smaller neofetch 44 | ]; 45 | 46 | programs.bash = { 47 | # Source nix 48 | # initExtra = ". ~/.nix-profile/etc/profile.d/nix.sh"; 49 | shellAliases = { 50 | rb = "nix build .#homeConfigurations.arch.activationPackage && result/activate"; 51 | }; 52 | }; 53 | 54 | nixpkgs.config.allowUnfree = true; 55 | 56 | home.sessionVariables = { 57 | GTK_IM_MODULE = "cedilla"; 58 | QT_IM_MODULE = "cedilla"; 59 | }; 60 | 61 | # Make home-manager work better on non-NixOS distros 62 | targets.genericLinux.enable = true; 63 | 64 | # Let Home Manager install and manage itself. 65 | programs.home-manager.enable = true; 66 | } 67 | -------------------------------------------------------------------------------- /home-configurations/box/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | let 4 | shellConfig = { 5 | shellAliases = { 6 | rb = "nix build .#homeConfigurations.box.activationPackage && result/activate"; 7 | }; 8 | }; 9 | in 10 | { 11 | imports = [ 12 | ../../utils/scripts 13 | 14 | # CLI 15 | ../../pkgs/base16-shell.nix # Different shell themes 16 | ../../pkgs/zoxide.nix # Jump directories 17 | ../../pkgs/bash.nix # Shell 18 | # ../../pkgs/starship.nix # Prompt 19 | ../../pkgs/editors/nvim 20 | ../../pkgs/readline # GNU readline input 21 | ../../pkgs/git.nix 22 | ../../pkgs/tmux # Terminal multiplexer 23 | ../../pkgs/fzf.nix # Fuzzy finder 24 | ../../pkgs/exa.nix # ls alternative 25 | ../../pkgs/trash-cli.nix # Safer rm 26 | ../../pkgs/htop.nix # Process viewer 27 | ../../pkgs/gpg.nix 28 | ../../pkgs/jq.nix # Work with json 29 | ../../pkgs/bat.nix # File previewer 30 | 31 | ../../pkgs/keychain.nix # ssh key caching 32 | ../../services/gpg-agent.nix 33 | ]; 34 | 35 | home.packages = with pkgs; [ 36 | # CLI 37 | ripgrep # File content finder 38 | fd # File finder 39 | ncdu # Curses interface for `du` 40 | file # Shows info about files 41 | neofetch # Shows system information 42 | pfetch # Smaller neofetch 43 | ]; 44 | 45 | programs.bash = shellConfig; 46 | 47 | # Let Home Manager install and manage itself. 48 | programs.home-manager.enable = true; 49 | } 50 | -------------------------------------------------------------------------------- /home-configurations/wsl/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | let 4 | shellConfig = { 5 | initExtra = " 6 | . ~/.nix-profile/etc/profile.d/nix.sh 7 | 8 | # Export display using VcXsrv 9 | export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0 10 | "; 11 | shellAliases = { 12 | rb = "nix build .#homeConfigurations.wsl.activationPackage && result/activate"; 13 | }; 14 | }; 15 | in 16 | { 17 | imports = [ 18 | ../../utils/scripts 19 | 20 | # CLI 21 | ../../pkgs/base16-shell.nix # Different shell themes 22 | ../../pkgs/zoxide.nix # Jump directories 23 | ../../pkgs/bash.nix # Shell 24 | ../../pkgs/editors/nvim 25 | ../../pkgs/readline # GNU readline input 26 | ../../pkgs/git.nix 27 | ../../pkgs/tmux # Terminal multiplexer 28 | ../../pkgs/fzf.nix # Fuzzy finder 29 | ../../pkgs/exa.nix # ls alternative 30 | ../../pkgs/trash-cli.nix # Safer rm 31 | ../../pkgs/htop.nix # Process viewer 32 | ../../pkgs/keychain.nix # Ssh key caching 33 | ../../pkgs/gpg.nix 34 | ../../pkgs/jq.nix # Work with json 35 | ../../pkgs/bat.nix # File previewer 36 | ../../pkgs/newsboat.nix # News reader 37 | ../../pkgs/tiny.nix # TUI IRC client 38 | 39 | ../../services/gpg-agent.nix 40 | ]; 41 | 42 | home.packages = with pkgs; [ 43 | # CLI 44 | bandwhich # Network inspector 45 | tealdeer # TLDR of man pages 46 | ripgrep # File content finder 47 | fd # File finder 48 | ncdu # Curses interface for `du` 49 | file # Shows info about files 50 | neofetch # Shows system information 51 | pfetch # Smaller neofetch 52 | ]; 53 | 54 | programs.bash = shellConfig; 55 | 56 | # Let Home Manager install and manage itself. 57 | programs.home-manager.enable = true; 58 | } 59 | -------------------------------------------------------------------------------- /hosts/chad/default.nix: -------------------------------------------------------------------------------- 1 | # Edit this configuration file to define what should be installed on 2 | # your system. Help is available in the configuration.nix(5) man page 3 | # and in the NixOS manual (accessible by running ‘nixos-help’). 4 | 5 | { config, lib, pkgs, username, ... }: 6 | 7 | { 8 | imports = [ 9 | ./hardware-configuration.nix 10 | ]; 11 | 12 | # Use the GRUB 2 boot loader. 13 | boot.loader.grub.enable = true; 14 | boot.loader.grub.version = 2; 15 | # boot.loader.grub.efiSupport = true; 16 | # boot.loader.grub.efiInstallAsRemovable = true; 17 | # boot.loader.efi.efiSysMountPoint = "/boot/efi"; 18 | # Define on which hard drive you want to install Grub. 19 | boot.loader.grub.devices = [ "/dev/sda" "/dev/sdb" ]; # or "nodev" for efi only 20 | 21 | networking.hostName = "chad"; # Define your hostname. 22 | # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. 23 | 24 | networking.hostId = "c0c79b2a"; # zfs requires it 25 | 26 | # Set your time zone. 27 | time.timeZone = "America/Sao_Paulo"; 28 | 29 | # The global useDHCP flag is deprecated, therefore explicitly set to false here. 30 | # Per-interface useDHCP will be mandatory in the future, so this generated config 31 | # replicates the default behaviour. 32 | networking.useDHCP = false; 33 | networking.interfaces.enp3s0.useDHCP = true; 34 | 35 | # Define a user account. Don't forget to set a password with ‘passwd’. 36 | users.users.vini = { 37 | isNormalUser = true; 38 | extraGroups = [ "wheel" "docker" ]; # Enable ‘sudo’ for the user. 39 | }; 40 | 41 | virtualisation = { 42 | containerd = { 43 | args = { 44 | "--storage-opt" = "dm.basesize=20G"; 45 | }; 46 | }; 47 | docker = { 48 | enable = true; 49 | storageDriver = "devicemapper"; 50 | }; 51 | }; 52 | 53 | # Enable the OpenSSH daemon. 54 | services.openssh.enable = true; 55 | 56 | services.samba = { 57 | enable = true; 58 | # openFirewall = true; 59 | extraConfig = '' 60 | hosts allow = 192.168.2. 127.0.0.1 localhost 61 | ''; 62 | shares = { 63 | samba = { 64 | path = "/home/vini/smb"; 65 | "read only" = "no"; 66 | }; 67 | }; 68 | }; 69 | 70 | nixpkgs.config.allowUnfree = true; 71 | 72 | # Open ports in the firewall. 73 | # networking.firewall.allowedTCPPorts = [ 8083 ]; 74 | # networking.firewall.allowedUDPPorts = [ ... ]; 75 | # Or disable the firewall altogether. 76 | networking.firewall.enable = false; 77 | # networking.firewall.allowPing = true; 78 | 79 | nix = { 80 | # registry.nixpkgs.flake = nixpkgs; 81 | package = pkgs.nixFlakes; 82 | extraOptions = lib.optionalString (config.nix.package == pkgs.nixFlakes) 83 | "experimental-features = nix-command flakes"; 84 | 85 | gc = { 86 | automatic = true; 87 | options = "--delete-older-than 2d"; 88 | }; 89 | 90 | settings = { 91 | # Caching 92 | substituters = [ 93 | "https://cache.nixos.org/" 94 | "https://nix-community.cachix.org" 95 | ]; 96 | trusted-public-keys = [ 97 | "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" 98 | ]; 99 | 100 | auto-optimise-store = true; 101 | }; 102 | }; 103 | 104 | # This value determines the NixOS release from which the default 105 | # settings for stateful data, like file locations and database versions 106 | # on your system were taken. It‘s perfectly fine and recommended to leave 107 | # this value at the release version of the first install of this system. 108 | # Before changing this value read the documentation for this option 109 | # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). 110 | system.stateVersion = "21.05"; # Did you read the comment? 111 | } 112 | -------------------------------------------------------------------------------- /hosts/chad/hardware-configuration.nix: -------------------------------------------------------------------------------- 1 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 | # and may be overwritten by future invocations. Please make changes 3 | # to /etc/nixos/configuration.nix instead. 4 | { config, lib, pkgs, modulesPath, ... }: 5 | 6 | { 7 | imports = 8 | [ (modulesPath + "/installer/scan/not-detected.nix") 9 | ]; 10 | 11 | boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ata_piix" "usbhid" "sd_mod" ]; 12 | boot.initrd.kernelModules = [ ]; 13 | boot.kernelModules = [ ]; 14 | boot.extraModulePackages = [ ]; 15 | 16 | fileSystems."/" = 17 | { device = "main/root"; 18 | fsType = "zfs"; 19 | }; 20 | 21 | swapDevices = 22 | [ { device = "/dev/disk/by-uuid/7e3a7a03-579e-4afc-a0df-9e4a9d116708"; } 23 | ]; 24 | } 25 | -------------------------------------------------------------------------------- /hosts/chad/home.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, inputs, lib, username, colorscheme, ... }: 2 | 3 | let 4 | rebuild-alias = { 5 | rb = "sudo nixos-rebuild switch --flake '.#chad'"; 6 | }; 7 | cli = with pkgs; [ 8 | neofetch 9 | pfetch 10 | bandwhich # Network inspector 11 | ripgrep # File content finder 12 | bottom # System monitor 13 | ncdu # Curses interface for `du` 14 | file # Show info about files 15 | fd # File finder 16 | ]; 17 | in 18 | { 19 | imports = [ 20 | ../../utils/scripts 21 | 22 | ../../pkgs/bash.nix # Shell 23 | ../../pkgs/zoxide.nix # Jump directories 24 | ../../pkgs/editors/nvim # Modal text editor 25 | ../../pkgs/readline # GNU readline input 26 | ../../pkgs/git.nix 27 | ../../pkgs/tmux # Terminal multiplexer 28 | ../../pkgs/fzf.nix # Fuzzy finder 29 | ../../pkgs/bat.nix # File previewer 30 | ../../pkgs/exa.nix # ls alternative 31 | ../../pkgs/trash-cli.nix # Safer rm 32 | # ../../pkgs/direnv.nix # Manages project environments 33 | ../../pkgs/keychain.nix 34 | ../../pkgs/gpg.nix 35 | ../../pkgs/jq.nix # Work with json 36 | ../../pkgs/nnn.nix # File manager 37 | ../../pkgs/tiny.nix # IRC Client 38 | ../../services/gpg-agent.nix 39 | ]; 40 | 41 | home.packages = cli; 42 | 43 | programs.bash.shellAliases = rebuild-alias; 44 | 45 | nixpkgs.config.allowUnfree = true; 46 | 47 | # Let Home Manager install and manage itself. 48 | # programs.home-manager.enable = true; 49 | 50 | # Home Manager needs a bit of information about you and the 51 | # paths it should manage. 52 | home.username = "${username}"; 53 | home.homeDirectory = "/home/${username}"; 54 | 55 | # This value determines the Home Manager release that your 56 | # configuration is compatible with. This helps avoid breakage 57 | # when a new Home Manager release introduces backwards 58 | # incompatible changes. 59 | # 60 | # You can update Home Manager without changing this value. See 61 | # the Home Manager release notes for a list of state version 62 | # changes in each release. 63 | home.stateVersion = "21.05"; 64 | } 65 | -------------------------------------------------------------------------------- /hosts/nixos/gamer.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, inputs, lib, colorscheme, ... }: 2 | 3 | let 4 | fonts = with pkgs; [ 5 | # (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) 6 | font-awesome 7 | noto-fonts-cjk 8 | ]; 9 | cli = with pkgs; [ 10 | bandwhich # Network inspector 11 | ripgrep # File content finder 12 | htop # System monitor 13 | ncdu # Curses interface for `du` 14 | file # Show info about files 15 | fd # File finder 16 | unzip # Easily unzip files 17 | wget 18 | ]; 19 | gui = with pkgs; [ 20 | firefox # browser 21 | ]; 22 | games = with pkgs; [ heroic ludusavi ]; 23 | in 24 | { 25 | imports = [ 26 | ../../pkgs/kitty.nix 27 | ]; 28 | 29 | services.redshift = { 30 | enable = true; 31 | dawnTime = "6:00-7:45"; 32 | duskTime = "18:35-20:15"; 33 | temperature.day = 4500; 34 | temperature.night = 2800; 35 | }; 36 | 37 | fonts.fontconfig.enable = true; 38 | 39 | home.packages = cli ++ gui ++ games ++ fonts; 40 | 41 | nixpkgs.config.allowUnfree = true; 42 | 43 | # Let Home Manager install and manage itself. 44 | # programs.home-manager.enable = true; 45 | 46 | # Home Manager needs a bit of information about you and the 47 | # paths it should manage. 48 | home.username = "gamer"; 49 | home.homeDirectory = "/home/gamer"; 50 | 51 | # This value determines the Home Manager release that your 52 | # configuration is compatible with. This helps avoid breakage 53 | # when a new Home Manager release introduces backwards 54 | # incompatible changes. 55 | # 56 | # You can update Home Manager without changing this value. See 57 | # the Home Manager release notes for a list of state version 58 | # changes in each release. 59 | home.stateVersion = "21.05"; 60 | } 61 | -------------------------------------------------------------------------------- /hosts/nixos/gpu-passthrough.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | # Important note: This configuration requires the `VT-D` feature to be enabled 4 | # inside your BIOS. 5 | let 6 | username = "vini"; 7 | in 8 | { 9 | imports = [ 10 | ../../nixos-pkgs/virt-manager.nix 11 | ]; 12 | 13 | boot = { 14 | kernelParams = [ 15 | # https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF#Setting_up_IOMMU 16 | "intel_iommu=on" 17 | "iommu=pt" 18 | 19 | # https://forums.unraid.net/topic/47345-performance-improvements-in-vms-by-adjusting-cpu-pinning-and-assignment/ 20 | # "isolcpus=1,5,2,6,3,7,4,0" 21 | 22 | "pcie_aspm=off" 23 | ]; 24 | 25 | kernelModules = [ 26 | "kvm-intel" 27 | "vfio_pci" 28 | "vfio_iommu_type1" 29 | "vfio_virqfd" 30 | "vfio" 31 | ]; 32 | 33 | blacklistedKernelModules = [ 34 | "nvidia" 35 | "nouveau" 36 | ]; 37 | 38 | extraModprobeConfig = "options vfio-pci ids=10de:1b81"; 39 | 40 | postBootCommands = '' 41 | DEVS="0000:0f:00.0 0000:0f:00.1" 42 | 43 | for DEV in $DEVS; do 44 | echo "vfio-pci" > /sys/bus/pci/devices/$DEV/driver_override 45 | done 46 | modprobe -i vfio-pci 47 | ''; 48 | }; 49 | 50 | services.udev.extraRules = '' 51 | # Symlink KMonad device 52 | ACTION=="add", ATTRS{name}=="KMonad output", SYMLINK+="KMONAD_DEVICE" 53 | ''; 54 | 55 | # Pipewire + pulseaudio support (you can also use just pulseaudio) 56 | services.pipewire = { 57 | enable = true; 58 | pulse.enable = true; 59 | }; 60 | 61 | # Scream 62 | systemd.tmpfiles.rules = [ 63 | "f /dev/shm/looking-glass 0660 ${username} qemu-libvirtd -" 64 | ]; 65 | 66 | systemd.user.services.scream-network = { 67 | enable = true; 68 | description = "Scream network"; 69 | serviceConfig = { 70 | ExecStart = "${pkgs.scream}/bin/scream -o pulse -i virbr0"; 71 | Restart = "always"; 72 | }; 73 | wantedBy = [ "default.target" ]; 74 | requires = [ "pipewire.service" ]; # Change to pulseaudio.service if using it 75 | }; 76 | 77 | virtualisation.libvirtd = { 78 | enable = true; 79 | onBoot = "ignore"; 80 | onShutdown = "shutdown"; 81 | qemu = { 82 | ovmf.enable = true; 83 | runAsRoot = true; # TODO: Might need to change 84 | }; 85 | }; 86 | 87 | environment.systemPackages = with pkgs; [ 88 | looking-glass-client 89 | ]; 90 | } 91 | 92 | -------------------------------------------------------------------------------- /hosts/nixos/hardware-configuration.nix: -------------------------------------------------------------------------------- 1 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 | # and may be overwritten by future invocations. Please make changes 3 | # to /etc/nixos/configuration.nix instead. 4 | { config, lib, pkgs, modulesPath, ... }: 5 | 6 | { 7 | imports = 8 | [ (modulesPath + "/installer/scan/not-detected.nix") 9 | ]; 10 | 11 | boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ]; 12 | boot.initrd.kernelModules = [ ]; 13 | boot.kernelModules = [ "kvm-amd" ]; 14 | boot.extraModulePackages = [ ]; 15 | 16 | fileSystems."/" = 17 | { device = "/dev/disk/by-uuid/748db999-4912-44d7-bb77-83f7f05ae896"; 18 | fsType = "ext4"; 19 | }; 20 | 21 | fileSystems."/boot" = 22 | { device = "/dev/disk/by-uuid/5D2D-8C9A"; 23 | fsType = "vfat"; 24 | }; 25 | 26 | swapDevices = 27 | [ { device = "/dev/disk/by-uuid/c83ecf1b-2284-4ad5-a0c1-34d61075b38e"; } 28 | ]; 29 | 30 | # Enables DHCP on each ethernet and wireless interface. In case of scripted networking 31 | # (the default) this is the recommended approach. When using systemd-networkd it's 32 | # still possible to use this option, but it's recommended to use it in conjunction 33 | # with explicit per-interface declarations with `networking.interfaces..useDHCP`. 34 | networking.useDHCP = lib.mkDefault true; 35 | # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; 36 | 37 | nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 38 | hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 39 | } 40 | -------------------------------------------------------------------------------- /hosts/nixos/home.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, inputs, lib, username, colorscheme, ... }: 2 | 3 | let 4 | rebuild-alias = { 5 | rb = "sudo nixos-rebuild switch --flake '.#nixos'"; 6 | }; 7 | fonts = with pkgs; [ 8 | # (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) 9 | font-awesome 10 | noto-fonts-cjk 11 | ]; 12 | cli = with pkgs; [ 13 | bandwhich # Network inspector 14 | ripgrep # File content finder 15 | htop # System monitor 16 | ncdu # Curses interface for `du` 17 | file # Show info about files 18 | fd # File finder 19 | unzip # Easily unzip files 20 | fastfetch 21 | pfetch # lightweight neofetch 22 | git-imerge 23 | kubectl 24 | minikube 25 | restic # backups 26 | lm_sensors 27 | wget 28 | ollama 29 | ]; 30 | gui = with pkgs; [ 31 | easyeffects 32 | gnomeExtensions.easyeffects-preset-selector 33 | 34 | zathura 35 | beekeeper-studio # database client 36 | mpv # anki uses MPV to play audio 37 | anki-bin # Spaced repetition 38 | firefox # browser 39 | calibre # Ebook manager 40 | sioyek # technical paper reader 41 | vlc 42 | logseq 43 | joplin-desktop 44 | ]; 45 | games = with pkgs; [ heroic ludusavi ]; 46 | proprietary = with pkgs; [ 47 | spotify 48 | # jetbrains.idea-ultimate 49 | ]; 50 | in 51 | { 52 | imports = [ 53 | ../../utils/scripts 54 | ../../profiles/haskell # ghci customization 55 | 56 | # CLI 57 | ../../pkgs/base16-shell.nix # Different shell themes 58 | ../../pkgs/bash.nix # Shell 59 | ../../pkgs/nix-index.nix # Show nixpkgs' packages of uninstalled binaries 60 | ../../pkgs/zoxide.nix # Jump directories 61 | ../../pkgs/editors/nvim # Modal text editor 62 | ../../pkgs/readline # GNU readline input 63 | ../../pkgs/git.nix 64 | ../../pkgs/tmux # Terminal multiplexer 65 | ../../pkgs/fzf.nix # Fuzzy finder 66 | ../../pkgs/bat.nix # File previewer 67 | ../../pkgs/exa.nix # ls alternative 68 | ../../pkgs/newsboat.nix # RSS Reader 69 | ../../pkgs/trash-cli.nix # Safer rm 70 | ../../pkgs/direnv.nix # Manages project environments 71 | ../../pkgs/keychain.nix 72 | ../../pkgs/gpg.nix 73 | ../../pkgs/jq.nix # Work with json 74 | ../../pkgs/nnn.nix # File manager 75 | ../../pkgs/tiny.nix # IRC Client 76 | ../../services/gpg-agent.nix 77 | # ../../services/gammastep.nix # Screen temperature manager 78 | ../../services/dunst.nix # notification daeomn 79 | 80 | # GUI 81 | # ../../pkgs/wayst.nix # terminal emulator 82 | ../../pkgs/kitty.nix 83 | ../../pkgs/editors/vscodium # Text editor 84 | ../../pkgs/pomatez.nix 85 | # ../../pkgs/mangohud.nix 86 | # ../../pkgs/editors/emacs # Another text editor 87 | # ../../pkgs/beekeeper-studio.nix # Database manager 88 | # ../../pkgs/lutris.nix 89 | # ../../pkgs/obs-studio.nix # Screen recording 90 | # ../../pkgs/mangohud.nix # Performance overlay for games 91 | # ../../pkgs/psst.nix # Spotify client (currently broken) 92 | # ../../pkgs/gtk.nix 93 | # ../../pkgs/qt.nix 94 | 95 | # Games 96 | # ../../pkgs/games/dwarf-fortress 97 | ]; 98 | 99 | services.kdeconnect.enable = true; 100 | 101 | services.redshift = { 102 | enable = true; 103 | dawnTime = "6:00-7:45"; 104 | duskTime = "18:35-20:15"; 105 | temperature.day = 4500; 106 | temperature.night = 2800; 107 | }; 108 | 109 | fonts.fontconfig.enable = true; 110 | 111 | dconf.settings = { 112 | "org/gnome/desktop/wm/preferences" = { 113 | "button-layout" = ":minimize,maximize,close"; 114 | }; 115 | "org/cinnamon/desktop/wm/preferences" = { 116 | "mouse-button-modifier" = ""; 117 | }; 118 | }; 119 | 120 | home.packages = cli ++ gui ++ games ++ proprietary ++ fonts; 121 | 122 | programs.bash.shellAliases = rebuild-alias; 123 | 124 | nixpkgs.config.allowUnfree = true; 125 | 126 | # Let Home Manager install and manage itself. 127 | # programs.home-manager.enable = true; 128 | 129 | # Home Manager needs a bit of information about you and the 130 | # paths it should manage. 131 | home.username = "${username}"; 132 | home.homeDirectory = "/home/${username}"; 133 | 134 | # This value determines the Home Manager release that your 135 | # configuration is compatible with. This helps avoid breakage 136 | # when a new Home Manager release introduces backwards 137 | # incompatible changes. 138 | # 139 | # You can update Home Manager without changing this value. See 140 | # the Home Manager release notes for a list of state version 141 | # changes in each release. 142 | home.stateVersion = "21.05"; 143 | } 144 | -------------------------------------------------------------------------------- /hosts/nixos/prime.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" '' 5 | export __NV_PRIME_RENDER_OFFLOAD=1 6 | export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 7 | export __GLX_VENDOR_LIBRARY_NAME=nvidia 8 | export __VK_LAYER_NV_optimus=NVIDIA_only 9 | exec -a "$1" "$@" 10 | ''; 11 | in 12 | { 13 | environment.systemPackages = [ 14 | nvidia-offload 15 | ]; 16 | 17 | services.xserver.config = '' 18 | # Integrated Intel GPU 19 | Section "Device" 20 | Identifier "iGPU" 21 | Driver "modesetting" 22 | EndSection 23 | 24 | # Dedicated NVIDIA GPU 25 | Section "Device" 26 | Identifier "dGPU" 27 | Driver "nvidia" 28 | EndSection 29 | 30 | Section "ServerLayout" 31 | Identifier "layout" 32 | Screen 0 "iGPU" 33 | EndSection 34 | 35 | Section "Screen" 36 | Identifier "iGPU" 37 | Device "iGPU" 38 | EndSection 39 | ''; 40 | 41 | services.xserver.videoDrivers = [ "nvidia" "intel" ]; 42 | hardware.nvidia.prime = { 43 | offload.enable = true; 44 | intelBusId = "PCI:0:2:0"; 45 | nvidiaBusId = "PCI:1:0:0"; 46 | }; 47 | } 48 | -------------------------------------------------------------------------------- /hosts/nixos/qmk-support.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | # Note that one still need to get a dev shell containing the qmk package 5 | services.udev.packages = [ 6 | pkgs.qmk-udev-rules 7 | ]; 8 | } 9 | -------------------------------------------------------------------------------- /lib/default.nix: -------------------------------------------------------------------------------- 1 | { ... } @inputs: 2 | 3 | let 4 | prelude = import ./prelude.nix; 5 | in 6 | rec { 7 | mkNixpkgs = 8 | { system 9 | , nixpkgs ? inputs.nixpkgs 10 | , allowUnfree ? true 11 | , overlays ? [ ] 12 | }: 13 | import nixpkgs { 14 | inherit system; 15 | overlays = [ 16 | (import ../overlay { inherit inputs; }) 17 | ] ++ overlays; 18 | config.allowUnfree = allowUnfree; 19 | }; 20 | 21 | mkHost = 22 | { host 23 | , username 24 | , extraUsers ? [ ] 25 | , system ? "x86_64-linux" 26 | , allowUnfree ? true 27 | , overlays ? [ ] 28 | , nixosModules ? [ ] 29 | , homeModules ? [ ] 30 | , colorscheme ? inputs.nix-colors.colorSchemes.tokyonight 31 | }: 32 | let 33 | pkgs = mkNixpkgs { inherit allowUnfree system overlays; }; 34 | extraUserConfigs = builtins.foldl' (acc: extraUser: acc // { 35 | ${extraUser} = { 36 | imports = [ (../hosts + "/${host}/${extraUser}.nix") ] ++ homeModules; 37 | }; 38 | }) {} extraUsers; 39 | in 40 | inputs.nixpkgs.lib.nixosSystem { 41 | inherit system; 42 | 43 | specialArgs = { 44 | inherit pkgs inputs username colorscheme; 45 | }; 46 | 47 | modules = nixosModules ++ [ 48 | (../hosts + "/${host}") 49 | inputs.home-manager.nixosModules.home-manager 50 | { 51 | home-manager = { 52 | users = extraUserConfigs // { 53 | ${username} = { 54 | imports = [ (../hosts + "/${host}/home.nix") ] ++ homeModules; 55 | }; 56 | }; 57 | 58 | extraSpecialArgs = { 59 | inherit inputs username pkgs prelude; 60 | 61 | colorscheme = { 62 | colors = colorscheme.palette; 63 | }; 64 | }; 65 | }; 66 | } 67 | ]; 68 | }; 69 | 70 | mkHome = 71 | { name 72 | , username 73 | , system ? "x86_64-linux" 74 | , stateVersion ? "21.11" 75 | , allowUnfree ? true 76 | , overlays ? [ ] 77 | , modules ? [ ] 78 | , colorscheme ? inputs.nix-colors.colorSchemes.tokyonight 79 | }: 80 | let 81 | pkgs = mkNixpkgs { inherit allowUnfree system overlays; }; 82 | homeDirectory = "/home/${username}"; 83 | in 84 | inputs.home-manager.lib.homeManagerConfiguration { 85 | # inherit system username homeDirectory pkgs; 86 | inherit pkgs; 87 | 88 | modules = [ 89 | { 90 | home = { 91 | inherit username homeDirectory stateVersion; 92 | }; 93 | } 94 | (../home-configurations + "/${name}") 95 | ] ++ modules; 96 | extraSpecialArgs = { 97 | inherit inputs system username prelude; 98 | 99 | colorscheme = { 100 | colors = colorscheme.palette; 101 | }; 102 | }; 103 | }; 104 | } 105 | -------------------------------------------------------------------------------- /lib/overlays.nix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viniciusmuller/dotfiles/814f5debdbafe40204b05e3db3032fdbe4a543ba/lib/overlays.nix -------------------------------------------------------------------------------- /lib/prelude.nix: -------------------------------------------------------------------------------- 1 | { 2 | mkLuaCode = 3 | ( 4 | code: 5 | '' 6 | lua << EOF 7 | ${code} 8 | EOF 9 | '' 10 | ); 11 | } 12 | -------------------------------------------------------------------------------- /nixos-pkgs/display-managers/lightdm.nix: -------------------------------------------------------------------------------- 1 | { ... }: 2 | 3 | { 4 | services.xserver.displayManager.lightdm.enable = true; 5 | } 6 | -------------------------------------------------------------------------------- /nixos-pkgs/display-managers/sddm/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | sddm-sugar-candy = pkgs.stdenv.mkDerivation rec { 5 | pname = "sddm-sugar-candy-theme"; 6 | version = "1.6"; 7 | dontBuild = true; 8 | installPhase = '' 9 | mkdir -p $out/share/sddm/themes/sugar-candy 10 | 11 | cat << EOT >> theme.conf.user 12 | ForceHideCompletePassword="true" 13 | EOT 14 | 15 | cp -aR $src/* theme.conf.user $out/share/sddm/themes/sugar-candy 16 | ''; 17 | src = pkgs.fetchFromGitHub { 18 | owner = "Kangie"; 19 | repo = "sddm-sugar-candy"; 20 | rev = "a1fae5159c8f7e44f0d8de124b14bae583edb5b8"; 21 | sha256 = "sha256-p2d7I0UBP63baW/q9MexYJQcqSmZ0L5rkwK3n66gmqM="; 22 | }; 23 | }; 24 | in 25 | { 26 | services.xserver = { 27 | enable = true; 28 | displayManager.sddm = { 29 | enable = true; 30 | theme = "sugar-candy"; 31 | }; 32 | }; 33 | 34 | environment.systemPackages = [ 35 | sddm-sugar-candy 36 | pkgs.libsForQt5.qt5.qtgraphicaleffects 37 | ]; 38 | } 39 | -------------------------------------------------------------------------------- /nixos-pkgs/docker.nix: -------------------------------------------------------------------------------- 1 | { username, ... }: 2 | 3 | { 4 | virtualisation.docker = { 5 | enable = true; 6 | extraOptions = '' 7 | --insecure-registry "http://registry:5000" 8 | ''; 9 | }; 10 | users.users.${username}.extraGroups = [ "docker" ]; 11 | } 12 | -------------------------------------------------------------------------------- /nixos-pkgs/grub/os-prober.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | boot = { 5 | loader = { 6 | grub = { 7 | enable = true; 8 | useOSProber = true; 9 | efiSupport = true; 10 | devices = [ "nodev" ]; 11 | }; 12 | efi = { 13 | canTouchEfiVariables = true; 14 | efiSysMountPoint = "/boot"; 15 | }; 16 | }; 17 | }; 18 | time.hardwareClockInLocalTime = true; 19 | } 20 | -------------------------------------------------------------------------------- /nixos-pkgs/grub/themes/fallout.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | falloutGrubTheme = pkgs.fetchFromGitHub { 5 | owner = "shvchk"; 6 | repo = "fallout-grub-theme"; 7 | rev = "87e4e220e4ce84a22ae6858704c8e872699dc914"; 8 | sha256 = "sha256-/OrOciVRaTuBEup1RWedWHZ0LNI+xF/NQnHHQkms6OI="; 9 | }; 10 | in 11 | { 12 | boot.loader.grub = { 13 | extraConfig = '' 14 | set theme=($drive1)//themes/fallout-grub-theme/theme.txt 15 | ''; 16 | splashImage = "${falloutGrubTheme}/background.png"; 17 | font = "${falloutGrubTheme}/fixedsys-regular-32.pf2"; 18 | }; 19 | 20 | system.activationScripts.copyGrubTheme = '' 21 | mkdir -p /boot/themes 22 | cp -R ${falloutGrubTheme}/ /boot/themes/fallout-grub-theme 23 | ''; 24 | } 25 | -------------------------------------------------------------------------------- /nixos-pkgs/kmonad/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, username, ... }: 2 | 3 | let 4 | kmonad = (import ../../pkgs/kmonad/derivation.nix) pkgs; 5 | in 6 | { 7 | imports = [ 8 | ./kmonad.nix 9 | ]; 10 | 11 | services.kmonad = { 12 | enable = true; 13 | # configfiles = [ ../../pkgs/kmonad/configs/ck61.kbd ]; 14 | package = kmonad; 15 | }; 16 | 17 | services.xserver = { 18 | xkbOptions = "compose:ralt"; 19 | layout = "us"; 20 | }; 21 | 22 | users.extraUsers.${username} = { 23 | extraGroups = [ "input" "uinput" ]; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /nixos-pkgs/kmonad/kmonad.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let cfg = config.services.kmonad; 4 | in 5 | 6 | with lib; 7 | { 8 | options.services.kmonad = { 9 | enable = mkOption { 10 | type = types.bool; 11 | default = false; 12 | description = '' 13 | If enabled, run kmonad after boot. 14 | ''; 15 | }; 16 | 17 | configfiles = mkOption { 18 | type = types.listOf types.path; 19 | default = [ ]; 20 | example = "[ my-config.kbd ]"; 21 | description = '' 22 | Config files for dedicated kmonad instances. 23 | ''; 24 | }; 25 | 26 | optionalconfigs = mkOption { 27 | type = types.listOf types.path; 28 | default = [ ]; 29 | example = "[ optional.kbd ]"; 30 | description = '' 31 | Config files for dedicated kmonad instances which may not always be present. 32 | ''; 33 | }; 34 | 35 | package = mkOption { 36 | type = types.package; 37 | default = import ./kmonad.nix; 38 | example = "import ./default.nix"; 39 | description = '' 40 | The kmonad package. 41 | ''; 42 | }; 43 | }; 44 | 45 | config = { 46 | environment.systemPackages = [ cfg.package ]; 47 | 48 | users.groups.uinput = { }; 49 | 50 | services.udev.extraRules = mkIf cfg.enable 51 | '' 52 | # KMonad user access to /dev/uinput 53 | KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput" 54 | ''; 55 | 56 | systemd = with lib; with builtins; 57 | let 58 | # If only one config file is supplied, unify all kmonad units under a target 59 | make-group = (length cfg.configfiles + length cfg.optionalconfigs) > 1; 60 | 61 | # All systemd units require the graphics target directly (if a single config), 62 | # or indirectly (via kmonad.target). 63 | wantedBy = [ "graphical.target" ]; 64 | 65 | mk-kmonad-target = services: { 66 | # The kmonad.target allows you to restart all kmonad instances with: 67 | # 68 | # systemctl restart kmonad.target 69 | # 70 | # this works because this unit requires all config-based services 71 | description = "KMonad target"; 72 | requires = map (service: service.name + ".service") services; 73 | inherit wantedBy; 74 | }; 75 | 76 | mk-kmonad-service = { is-optional }: kbd-path: 77 | let 78 | # prettify the service's name by taking the config filename... 79 | conf-file = lists.last (strings.splitString "/" (toString kbd-path)); 80 | # ...and dropping the extension 81 | conf-name = lists.head (strings.splitString "." conf-file); 82 | in 83 | { 84 | name = "kmonad-" + conf-name; 85 | value = { 86 | enable = true; 87 | description = "KMonad Instance for: " + conf-name; 88 | serviceConfig = { 89 | Type = "simple"; 90 | Restart = "always"; 91 | ExecStart = 92 | "${cfg.package}/bin/kmonad ${kbd-path}" + 93 | # kmonad will error on initialization for any unplugged keyboards 94 | # when run in systemd. All optional configs will silently error 95 | # 96 | # TODO: maybe try to restart the unit? 97 | (if is-optional then " || true" else ""); 98 | }; 99 | } // (if make-group 100 | then { partOf = [ "kmonad.target" ]; } 101 | else { inherit wantedBy; }); 102 | }; 103 | 104 | required-units = map (mk-kmonad-service { is-optional = false; }) cfg.configfiles; 105 | 106 | optional-units = map (mk-kmonad-service { is-optional = true; }) cfg.configfiles; 107 | 108 | in 109 | mkIf cfg.enable ({ 110 | # convert our output [{name=_; value=_;}] map to {name=value;} for the systemd module 111 | services = listToAttrs (required-units ++ optional-units); 112 | } // ( 113 | # additionally, if make-group is true, add the targets.kmonad attr and pass in all units 114 | attrsets.optionalAttrs make-group 115 | { targets.kmonad = mk-kmonad-target (required-units ++ optional-units); } 116 | ) 117 | ); 118 | }; 119 | } 120 | -------------------------------------------------------------------------------- /nixos-pkgs/lutris.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | home.packages = with pkgs; [ 5 | lutris 6 | ]; 7 | } 8 | -------------------------------------------------------------------------------- /nixos-pkgs/manpages.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | documentation.man.generateCaches = true; 5 | documentation.dev.enable = true; 6 | 7 | environment.systemPackages = with pkgs; [ 8 | man-pages 9 | man-pages-posix 10 | ]; 11 | } 12 | -------------------------------------------------------------------------------- /nixos-pkgs/slock.nix: -------------------------------------------------------------------------------- 1 | { pkgs, home-manager, username, ... }: 2 | 3 | { 4 | security.wrappers.slock.source = "${pkgs.slock.out}/bin/slock"; 5 | home-manager.users.${username} = import ../pkgs/suckless/slock.nix; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /nixos-pkgs/steam.nix: -------------------------------------------------------------------------------- 1 | { pkgs, home-manager, ... }: 2 | 3 | { 4 | programs.steam = { 5 | enable = true; 6 | remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play 7 | dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /nixos-pkgs/virt-manager.nix: -------------------------------------------------------------------------------- 1 | { pkgs, username, ... }: 2 | 3 | { 4 | virtualisation.libvirtd.enable = true; 5 | programs.dconf.enable = true; 6 | environment.systemPackages = with pkgs; [ virt-manager ]; 7 | users.users.${username}.extraGroups = [ "libvirtd" ]; 8 | } 9 | -------------------------------------------------------------------------------- /nixos-pkgs/virtualbox.nix: -------------------------------------------------------------------------------- 1 | { ... }: 2 | 3 | { 4 | virtualisation.virtualbox.host.enable = true; 5 | users.extraGroups.vboxusers.members = [ "vini" ]; 6 | } 7 | -------------------------------------------------------------------------------- /nixos-pkgs/wine.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | environment.systemPackages = with pkgs; [ 5 | # support both 32-bit and 64-bit applications 6 | wineWowPackages.stable 7 | # wine-staging (version with experimental features) 8 | wineWowPackages.staging 9 | winetricks 10 | ]; 11 | } 12 | -------------------------------------------------------------------------------- /nixos-pkgs/zsh.nix: -------------------------------------------------------------------------------- 1 | { pkgs, username, ... }: 2 | 3 | { 4 | users.extraUsers.${username}.shell = pkgs.zsh; 5 | home-manager.users.${username} = import ../pkgs/zsh.nix; 6 | } 7 | -------------------------------------------------------------------------------- /nixos-services/ckb-next.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, colorscheme, ... }: 2 | 3 | let 4 | # TODO: Use upstream when this gets merged 5 | ckb-next = pkgs.ckb-next.overrideAttrs (_: 6 | { 7 | src = pkgs.fetchFromGitHub { 8 | owner = "arcticlimer"; 9 | repo = "ckb-next"; 10 | rev = "d403b2b947422c417d283154f3700c9a83ab4d0c"; 11 | sha256 = "sha256-KMKk5XHTVge4IQ4SFdzXo7l6RZy+/rGkM0nGZ6tIqfg="; 12 | }; 13 | } 14 | ); 15 | colors = colorscheme.colors; 16 | in 17 | { 18 | hardware.ckb-next = { 19 | enable = true; 20 | package = ckb-next; 21 | }; 22 | 23 | systemd.user.services.ckb-next = { 24 | after = [ "default.target" ]; 25 | wantedBy = [ "default.target" ]; 26 | serviceConfig = { 27 | Type = "simple"; 28 | ExecStart = "${ckb-next}/bin/ckb-next -b"; 29 | Restart = "on-failure"; 30 | RestartSec = 5; 31 | }; 32 | }; 33 | 34 | # TODO: Make this reload when the colorscheme changes 35 | systemd.user.services.ckb-nix-colors = { 36 | enable = false; 37 | after = [ "ckb-next.target" ]; 38 | serviceConfig = { 39 | Type = "simple"; 40 | ExecStart = "${pkgs.bash}/bin/sh -c '${pkgs.coreutils}/bin/echo rgb ${colors.base0C}ff > /tmp/ckbpipe000'"; 41 | Restart = "on-failure"; 42 | RestartSec = 5; 43 | }; 44 | # Doesn't work as expected 45 | # reloadIfChanged = true; 46 | }; 47 | } 48 | -------------------------------------------------------------------------------- /nixos-services/noisetorch.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | programs.noisetorch.enable = true; 5 | 6 | systemd.user.services.noisetorch = { 7 | after = [ "default.target" ]; 8 | wantedBy = [ "default.target" ]; 9 | serviceConfig = { 10 | Type = "simple"; 11 | ExecStart = "${pkgs.noisetorch}/bin/noisetorch -i"; 12 | Restart = "on-failure"; 13 | RestartSec = 5; 14 | }; 15 | environment = { 16 | PULSE_SERVER = "/run/user/1000/pulse/native"; 17 | }; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /overlay/default.nix: -------------------------------------------------------------------------------- 1 | { inputs, ... }: 2 | 3 | final: prev: { 4 | # Custom packages 5 | # dwarf-fortress-custom = 6 | # inputs.local-nixpkgs.legacyPackages.${final.system}.dwarf-fortress-packages.dwarf-fortress-full; 7 | # cli-tools = import ../pkgs/cli-tools.nix { pkgs = final; }; 8 | # fzfpods = import ../pkgs/fzfpods.nix { pkgs = prev; }; 9 | } 10 | -------------------------------------------------------------------------------- /pkgs/alacritty.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | programs.alacritty = { 5 | enable = true; 6 | settings = { 7 | font = { 8 | size = 9; 9 | }; 10 | window = { 11 | padding = { 12 | x = 10; 13 | y = 10; 14 | }; 15 | decorations = "None"; 16 | }; 17 | bell.duration = 0; 18 | background_opacity = 1.0; 19 | mouse.hide_when_typing = true; 20 | cursor = { 21 | style = "Beam"; 22 | unfocused_hollow = true; 23 | }; 24 | }; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /pkgs/base16-shell.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | # Base16-shell fork that updates weekly 5 | base16-shell = pkgs.fetchFromGitHub { 6 | owner = "fnune"; 7 | repo = "base16-shell"; 8 | rev = "e94ac27230c78c32150bfda9f4427782dd5f9e92"; 9 | sha256 = "sha256-bbp3yRGB5r3m+DJSpTBF5I2Z4Pv7kl6DFj6OY2FwlSE="; 10 | }; 11 | 12 | base16-command = '' 13 | # Base16 Shell 14 | BASE16_SHELL=${base16-shell.outPath} 15 | [ -n "$PS1" ] && \ 16 | [ -s "$BASE16_SHELL/profile_helper.sh" ] && \ 17 | eval "$("$BASE16_SHELL/profile_helper.sh")" 18 | ''; 19 | in 20 | { 21 | programs.bash.initExtra = base16-command; 22 | programs.zsh.initExtra = base16-command; 23 | } 24 | -------------------------------------------------------------------------------- /pkgs/bash.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, ... }: 2 | 3 | let 4 | complete-alias = builtins.fetchGit { 5 | url = "https://github.com/cykerway/complete-alias"; 6 | rev = "b16b183f6bf0029b9714b0e0178b6bd28eda52f3"; 7 | }; 8 | tab-completion = builtins.fetchGit { 9 | url = "https://github.com/lincheney/fzf-tab-completion"; 10 | rev = "53eb325f573265a6105c9bd0aa56cd865c4e14b7"; 11 | }; 12 | ble-sh = pkgs.fetchFromGitHub { 13 | author = "akinomyoga"; 14 | repo = "ble.sh"; 15 | rev = "e5d8d00cf52bb899af0ecab563be12dfc11451ba"; 16 | }; 17 | in 18 | { 19 | programs.bash = { 20 | enable = true; 21 | historySize = 10000; 22 | shellOptions = [ 23 | # Auto cd to directories 24 | "autocd" 25 | 26 | # Append to history file rather than replacing it. 27 | "histappend" 28 | 29 | # check the window size after each command and, if 30 | # necessary, update the values of LINES and COLUMNS. 31 | "checkwinsize" 32 | 33 | # Extended globbing. 34 | "extglob" 35 | "globstar" 36 | 37 | # Warn if closing shell with running jobs. 38 | "checkjobs" 39 | ]; 40 | 41 | initExtra = '' 42 | parse_git_branch() { 43 | git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' 44 | } 45 | 46 | export PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\e[91m\]\$(parse_git_branch)\[\033[00m\]\$ " 47 | 48 | # --- GPG --- 49 | export GPG_TTY=$(tty) 50 | 51 | # --- Vi mode --- 52 | set -o vi 53 | bind -m vi-insert 'Control-l: clear-screen' 54 | 55 | # --- Complete aliases --- 56 | . ${complete-alias}/complete_alias 57 | complete -F _complete_alias $( \ 58 | alias | perl -lne 'print "$1 " if /^alias ([^=]*)=/' ) 59 | 60 | # --- Tab completion --- 61 | . ${tab-completion}/bash/fzf-bash-completion.sh 62 | bind -x '"\t": fzf_bash_completion' 63 | 64 | # --- Colored man pages --- 65 | export LESS_TERMCAP_mb=$'\e[1;32m' 66 | export LESS_TERMCAP_md=$'\e[1;32m' 67 | export LESS_TERMCAP_me=$'\e[0m' 68 | export LESS_TERMCAP_se=$'\e[0m' 69 | export LESS_TERMCAP_so=$'\e[01;33m' 70 | export LESS_TERMCAP_ue=$'\e[0m' 71 | export LESS_TERMCAP_us=$'\e[1;4;31m' 72 | ''; 73 | 74 | historyControl = [ 75 | "erasedups" 76 | "ignoredups" 77 | "ignorespace" 78 | ]; 79 | 80 | shellAliases = { 81 | c = "clear"; 82 | b = "cd -"; 83 | se = "sudoedit"; 84 | ns = "nix-shell -p"; 85 | nq = "nix search nixpkgs"; 86 | nd = "nix develop"; 87 | cvi = "convco commit --interactive"; 88 | }; 89 | }; 90 | 91 | home.sessionVariables = { 92 | EDITOR = "vim"; 93 | FZF_DEFAULT_OPTS = ''--prompt \" λ \"''; 94 | }; 95 | } 96 | -------------------------------------------------------------------------------- /pkgs/bat.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | programs.bat = { 5 | enable = true; 6 | config = { 7 | theme = "gruvbox-dark"; 8 | }; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /pkgs/beekeeper-studio.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | beekeeper-studio = pkgs.appimageTools.wrapType2 { 5 | name = "beekeeper-studio"; 6 | src = pkgs.fetchurl { 7 | url = "https://github.com/beekeeper-studio/beekeeper-studio/releases/download/v1.12.0/Beekeeper-Studio-1.12.0.AppImage"; 8 | sha256 = "sha256-jGofvkYCzjEhDeKiC+m+tDHRkmOLAZgof4thhvPUgwQ="; 9 | }; 10 | }; 11 | in 12 | { 13 | home.packages = [ beekeeper-studio ]; 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/betterlockscreen.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | # TODO: Upstream home-manager currently has this, maybe one day use it from it 5 | home.packages = with pkgs; [ 6 | betterlockscreen 7 | feh 8 | ]; 9 | } 10 | -------------------------------------------------------------------------------- /pkgs/bitwarden.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | home.packages = with pkgs; [ 5 | # bitwarden 6 | bitwarden-cli 7 | ]; 8 | } 9 | -------------------------------------------------------------------------------- /pkgs/blugon/config: -------------------------------------------------------------------------------- 1 | [main] 2 | readcurrent = False 3 | interval = 120 4 | backend = scg 5 | wait_for_x = False 6 | fade = False 7 | 8 | [current] 9 | min_temp = 1.0 10 | max_temp = 20000.0 11 | 12 | [wait_for_x] 13 | sleep_after_failed_startup = 0.1 14 | sleep_after_losing_x = 120.0 15 | 16 | [fade] 17 | steps = 10 18 | duration = 3.0 19 | 20 | [tty] 21 | color0 = 000000 22 | color1 = aa0000 23 | color2 = 00aa00 24 | color3 = aa5500 25 | color4 = 0000aa 26 | color5 = aa00aa 27 | color6 = 00aaaa 28 | color7 = aaaaaa 29 | color8 = 555555 30 | color9 = ff5555 31 | color10 = 55ff55 32 | color11 = ffff55 33 | color12 = 5555ff 34 | color13 = ff55ff 35 | color14 = 55ffff 36 | color15 = ffffff 37 | 38 | -------------------------------------------------------------------------------- /pkgs/blugon/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | home.packages = with pkgs; [ 5 | blugon 6 | ]; 7 | 8 | home.file = { 9 | ".config/blugon/config".source = ./config; 10 | ".config/blugon/gamma".source = ./gamma; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /pkgs/blugon/gamma: -------------------------------------------------------------------------------- 1 | # INTERVALS 2 | # hour [0, 23] 3 | # minute [0, 60] 4 | # red [0, 1] 5 | # green [0, 1] 6 | # blue [0, 1] 7 | # temperature [1000, 20000] 8 | # 9 | # TIME GAMMA 10 | # hour minute red green blue 11 | # 12 | # or: 13 | # hour minute temperature 14 | 0 0 1.0 0.80 0.55 15 | 4 30 1.0 0.83 0.65 16 | 8 0 1.0 0.96 1.00 17 | 17 0 1.0 0.88 0.80 18 | 21 0 1.0 0.82 0.65 19 | -------------------------------------------------------------------------------- /pkgs/chromium.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | programs.chromium = { 5 | enable = true; 6 | extensions = [ 7 | "pkehgijcmpdhfbdbbnkijodmdjhbjlgp" # Privacy badger 8 | "cjpalhdlnbpafiamejdnhcphjbkeiagm" # Ublock origin 9 | "eimadpbcbfnmbkopoojfekhnkhdbieeh" # Dark reader 10 | "nngceckbapebfimnlniiiahkandclblb" # Bitwarden 11 | "dbepggeogbaibhgnhhndojpepiihcmeb" # Vimium 12 | # "kbfnbcaeplbcioakkpcpgfkobkghlhen" # Grammarly 13 | # "lokjgaehpcnlmkebpmjiofccpklbmoci" # Toucan 14 | # "hoombieeljmmljlkjmnheibnpciblicm" # Language Reactor 15 | # { 16 | # id = "cjnmckjndlpiamhfimnnjmnckgghkjbl"; # Competitive companion 17 | # version = "2.25.2"; 18 | # } 19 | { 20 | id = "miljekjnhkpkelpomeehcbhlanppjegn"; # Material dark theme 21 | version = "1.0"; 22 | } 23 | ]; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /pkgs/conserve.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | let 4 | conserve = pkgs.rustPlatform.buildRustPackage rec { 5 | pname = "conserve"; 6 | version = "0.6.10"; 7 | 8 | src = pkgs.fetchFromGitHub { 9 | owner = "sourcefrog"; 10 | repo = "conserve"; 11 | rev = "v0.6.10"; 12 | sha256 = "sha256-U8LWbMwgG2iM2Z+mu/SzsgVpr3aWZgo62LAWVqT3Dsw="; 13 | }; 14 | 15 | cargoSha256 = "sha256-EDkuihS/45v28Nob+VNMGIfNX79xFJvnt0wS9FI7Hjg="; 16 | }; 17 | in 18 | { 19 | home.packages = [ conserve ]; 20 | } 21 | -------------------------------------------------------------------------------- /pkgs/direnv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | programs.direnv = { 5 | enable = true; 6 | nix-direnv.enable = true; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /pkgs/editors/doom/config/config.el: -------------------------------------------------------------------------------- 1 | ;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- 2 | 3 | ;;; Code: 4 | 5 | (persp-mode) 6 | 7 | (setq user "vinigm.nho" 8 | domain "gmail.com") 9 | 10 | (setq user-full-name "Vinícius Müller" 11 | user-mail-address (format "%s@%s" user domain)) 12 | 13 | ;; deft 14 | (after! deft 15 | (setq deft-directory "~/deft/notes") 16 | (setq deft-extensions '("md" "org"))) 17 | 18 | ;; kubernetes 19 | ; (use-package kubernetes 20 | ; :defer 21 | ; :commands (kubernetes-overview)) 22 | 23 | ; (use-package kubernetes-evil 24 | ; :defer 25 | ; :after kubernetes) 26 | 27 | ; (map! :leader 28 | ; (:prefix "o" 29 | ; :desc "Kubernetes" "K" 'kubernetes-overview)) 30 | 31 | ;; nix 32 | (setq nix-nixfmt-bin "nixpkgs-fmt") 33 | 34 | ;; notmuch 35 | ; (setq +notmuch-home-function (lambda () (notmuch-search "tag:inbox")) 36 | ; +notmuch-sync-backend 'mbsync) 37 | 38 | ;; org 39 | (setq org-directory "~/org/") 40 | 41 | ;; treemacs 42 | (after! treemacs 43 | (define-key treemacs-mode-map [mouse-1] #'treemacs-single-click-expand-action)) 44 | 45 | ;; ui 46 | (setq doom-theme 'modus-vivendi 47 | display-line-numbers-type t 48 | 49 | ;; modus 50 | modus-themes-region '(accented) 51 | modus-themes-org-blocks 'gray-background 52 | modus-themes-fringes 'subtle 53 | modus-themes-italic-constructs t 54 | modus-themes-bold-constructs t 55 | modus-themes-syntax '(green-strings) 56 | modus-themes-hl-line '(intense) 57 | modus-themes-paren-match '(intense) 58 | modus-themes-mode-line '(moody borderless) 59 | modus-themes-headings (quote ((1 . (overline variable-pitch 1.4)) 60 | (2 . (overline variable-pitch 1.25)) 61 | (3 . (overline 1.1)) 62 | (t . (monochrome))))) 63 | 64 | ;;; config.el ends here 65 | -------------------------------------------------------------------------------- /pkgs/editors/doom/config/packages.el: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viniciusmuller/dotfiles/814f5debdbafe40204b05e3db3032fdbe4a543ba/pkgs/editors/doom/config/packages.el -------------------------------------------------------------------------------- /pkgs/editors/doom/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | programs.doom-emacs = { 5 | enable = true; 6 | doomPrivateDir = ./config; 7 | emacsPackage = pkgs.emacs; 8 | }; 9 | 10 | services.emacs.enable = true; 11 | } 12 | -------------------------------------------------------------------------------- /pkgs/editors/emacs/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, inputs, ... }: 2 | 3 | let 4 | emacsPackaging = pkgs.emacsPackagesNg; 5 | my-emacs = ((pkgs.emacsPackagesFor pkgs.emacsGit).emacsWithPackages (epkgs: with epkgs; [ 6 | use-package 7 | 8 | # Usability 9 | vterm 10 | marginalia 11 | vertico 12 | consult 13 | corfu 14 | multiple-cursors 15 | transpose-frame 16 | projectile 17 | swiper 18 | perspective 19 | magit 20 | lsp-ui 21 | yasnippet 22 | yasnippet-snippets 23 | smartparens 24 | # pdf-tools 25 | ace-window 26 | 27 | # Fuzzy finding 28 | orderless # fuzzy completion for minibuffer 29 | 30 | # elsa # Linting Engine (currently broken on emacs 28+) 31 | flycheck 32 | flycheck-elsa 33 | flymake-flycheck 34 | 35 | # Modes 36 | nix-mode 37 | lsp-mode 38 | elixir-mode 39 | 40 | # Aesthetics 41 | diff-hl 42 | lsp-treemacs 43 | dashboard 44 | all-the-icons 45 | doom-modeline 46 | rainbow-delimiters 47 | 48 | # Org 49 | org-roam 50 | org-bullets 51 | 52 | evil 53 | evil-org 54 | ] ++ (with epkgs.elpaPackages; [ yasnippet-classic-snippets ]))); 55 | in 56 | { 57 | home.packages = [ 58 | my-emacs 59 | pkgs.emacs-all-the-icons-fonts 60 | ]; 61 | 62 | home.file.".emacs.d/init.el".text = builtins.readFile ./default.el; 63 | home.file.".emacs.d/theme.el".text = builtins.readFile ./theme.el; 64 | services.emacs.enable = true; 65 | services.emacs.package = my-emacs; 66 | } 67 | -------------------------------------------------------------------------------- /pkgs/editors/emacs/theme.el: -------------------------------------------------------------------------------- 1 | (load-theme 'adwaita t) 2 | 3 | (use-package doom-modeline 4 | :init (doom-modeline-mode 1)) 5 | 6 | (setq-default cursor-type 'box) 7 | (fringe-mode '(7 . 0)) 8 | (scroll-bar-mode -1) 9 | (menu-bar-mode +1) 10 | (tool-bar-mode -1) 11 | (toggle-scroll-bar -1) 12 | (display-battery-mode -1) 13 | (display-time-mode t) 14 | 15 | ; TODO: use [rainbow-mode](https://github.com/emacsmirror/rainbow-mode) to figure colors out 16 | (custom-set-faces 17 | '(rainbow-delimiters-depth-1-face ((t (:foreground "systemTealColor")))) 18 | '(rainbow-delimiters-depth-2-face ((t (:foreground "Brown")))) 19 | '(rainbow-delimiters-depth-3-face ((t (:foreground "Blue")))) 20 | '(rainbow-delimiters-depth-4-face ((t (:foreground "Orange")))) 21 | '(rainbow-delimiters-depth-5-face ((t (:foreground "Purple")))) 22 | '(rainbow-delimiters-depth-6-face ((t (:foreground "dark green")))) 23 | '(rainbow-delimiters-depth-9-face ((t (:foreground "indian red"))))) 24 | 25 | (provide 'theme) 26 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/README.md: -------------------------------------------------------------------------------- 1 | # Vim custom keybindings 2 | 3 | ## Normal keys rebindings 4 | - `t`: 5 | - `n`: Toggle nvim-tree 6 | - `l`: Toggle code symbols tree 7 | - `t`: Toggle trouble-nvim 8 | 9 | - `[`: 10 | - `q`: Go to previous element on the quickfix list 11 | - `Q`: Go to the first element on the quickfix list 12 | 13 | - `w`: Go to previous element in a location list 14 | - `W`: Go to the first element in a location list 15 | 16 | - `]`: 17 | - `q`: Go to next element on the quickfix list 18 | - `Q`: Go to the last element on the quickfix list 19 | 20 | - `w`: Go to next element in a location list 21 | - `W`: Go to the last element in a location list 22 | 23 | - `H`: Same as `^` 24 | - `L`: Same as `$` 25 | - `Q`: Same as `@@`, repeats last macro 26 | - ``: Same as q 27 | - ``: `:update` buffer 28 | 29 | 30 | 31 | 32 | ## Language server keybindings 33 | > These keys are added/overriden when there is a language server client attached: 34 | - `gr`: 35 | - `K`: Hover symbol on the cursor 36 | - `gd`: Go to definition 37 | - `gi`: Go to implementation 38 | - `gD`: Go to declaration 39 | - `gs`: Show type signature help 40 | - `[d:` Go to previous diagnostic 41 | - `]d`: Go to next diagnostic 42 | 43 | ## Leader key keybindings 44 | - Leader: `` 45 | 46 | - `.`: Find git tracked project files 47 | - `,`: Find buffers 48 | 49 | - `t`: Tabs and testing 50 | 51 | > Tests 52 | - `f`: Run tests in the current file 53 | - `s`: Run test suite 54 | - `l`: Run last test 55 | - `n`: Run test on the cursor 56 | - `v`: Jump to where last test ran 57 | - `D`: Go to type definition 58 | 59 | > Tabs 60 | - `o`: Prompts to open a new tab 61 | - `q`: Closes the current tab 62 | - `<`: Moves the current tab to the left 63 | - `>`: Moves the current tab to the right 64 | 65 | - `f`: Find 66 | - `f`: Files 67 | - `c`: Commits 68 | - `s`: Substring in files 69 | - `m`: Man pages 70 | - `h`: Vim help tags 71 | 72 | - `o`: Open 73 | - `t`: Terminal 74 | 75 | - `l`: Language server 76 | > These keybindings are only avaiable when there is a language server attached 77 | - `f`: Format current buffer 78 | - `r`: Rename symbol on the cursor 79 | - `a`: Request code action on the cursor 80 | - `q`: Open diagnostics in a location list 81 | - `d`: Open a popup with current diagnostic 82 | 83 | 84 | 85 | - `p`: Project 86 | - `t`: Lists project TODOs on a location list 87 | - `a`: Jumps to alternate file in a new buffer 88 | 89 | - `g`: Git 90 | - `g`: Opens vim-fugitive menu 91 | - `m`: Shows git commit message of the current line 92 | - `d`: Opens split diff of the current file 93 | - `l`: Shows git commit log 94 | - `b`: Open git branches fuzzy menu 95 | - `t`: Open git tags fuzzy menu 96 | 97 | - `v`: Vim 98 | - `r`: Reload the configuration 99 | - `q`: Quit vim, stopping if there are unsaved buffers 100 | - `Q`: QUIT vim, ignoring any unsaved buffers 101 | 102 | - `d`: Debug 103 | - `d`: Toggle breakpoint on the current line 104 | - `D`: Set conditional breakpoint on the current line 105 | - `l`: Set log point on the current line 106 | - `f`: Continue until next breakpoint 107 | - `u`: Toggle debugging UI 108 | - `r`: Open nvim-dap REPL 109 | - `j`: Step out 110 | - `k`: Step into 111 | 112 | - `q`: 113 | - `r`: Runs code in the file outputting it in a new window. If in visual mode, runs the current selection, otherwise runs the whole file. 114 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/colorschemes/dracula.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | dracula = { 5 | plugin = pkgs.vimUtils.buildVimPlugin { 6 | name = "dracula-nvim"; 7 | version = "2021-07-29"; 8 | 9 | src = pkgs.fetchFromGitHub { 10 | owner = "Mofiqul"; 11 | repo = "dracula.nvim"; 12 | rev = "2f98ce06c359fa3f9c34d274615b3f269f89e55c"; 13 | sha256 = "sha256-Zj9Mp7hwBhDr880dQ6RfiSm9xg58tNriwM3DJLKaNr8="; 14 | }; 15 | 16 | meta.homepage = "https://github.com/Mofiqul/dracula.nvim"; 17 | }; 18 | 19 | config = '' 20 | colorscheme dracula 21 | hi Cursorline guibg=#36394a 22 | hi ColorColumn guibg=#424763 23 | ''; 24 | }; 25 | in 26 | { 27 | programs.neovim.plugins = [ dracula ]; 28 | } 29 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/colorschemes/github-dark.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | github-dark = { 5 | plugin = pkgs.vimUtils.buildVimPlugin { 6 | name = "github-nvim-theme"; 7 | version = "2022-04-24"; 8 | src = pkgs.fetchFromGitHub { 9 | owner = "projekt0n"; 10 | repo = "github-nvim-theme"; 11 | rev = "9c641bde299ceb373b014a18eb5547fb4e9b57e6"; 12 | sha256 = "sha256-4WTV/T9eiQ8cmwSwK+Oyflry9qVNXDlDHvTQGx45bf4="; 13 | }; 14 | meta.homepage = "https://github.com/projekt0n/github-nvim-theme"; 15 | 16 | postPatch = "rm Makefile"; 17 | }; 18 | 19 | config = '' 20 | lua require('github-theme').setup({ theme_style = "dark_default", }) 21 | hi! link Statusline Text 22 | ''; 23 | }; 24 | in 25 | { 26 | programs.neovim.plugins = [ github-dark ]; 27 | } 28 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/colorschemes/gruvbox-material.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | gruvbox-material = { 5 | plugin = pkgs.vimPlugins.gruvbox-material; 6 | config = '' 7 | set bg=dark 8 | let g:gruvbox_material_background = 'hard' 9 | let g:gruvbox_material_enable_italic = 1 10 | colorscheme gruvbox-material 11 | ''; 12 | }; 13 | in 14 | { 15 | programs.neovim.plugins = [ gruvbox-material ]; 16 | } 17 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/colorschemes/gruvbox.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | gruvbox = { 5 | plugin = pkgs.vimPlugins.gruvbox-nvim; 6 | config = '' 7 | set bg=dark 8 | let g:gruvbox_italic = 1 9 | let g:gruvbox_contrast_dark = "medium" 10 | colorscheme gruvbox 11 | ''; 12 | }; 13 | in 14 | { 15 | programs.neovim.plugins = [ gruvbox ]; 16 | } 17 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/colorschemes/improved-darkblue.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | let 4 | improved-darkblue = { 5 | plugin = pkgs.writeText "improved-dark-blue" ""; 6 | config = '' 7 | colorscheme darkblue " Vim's default 8 | highlight CursorLine guibg=#001f6e 9 | highlight ColorColumn guibg=#001f6e 10 | highlight! Folded guifg=#c0c0c0 guibg=#404080 11 | highlight! FoldColumn guifg=#c0c0c0 guibg=#404080 12 | ''; 13 | }; 14 | in 15 | { 16 | programs.neovim.plugins = lib.mkBefore [ improved-darkblue ]; 17 | } 18 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/colorschemes/nix-colors.nix: -------------------------------------------------------------------------------- 1 | { pkgs, inputs, colorscheme, ... }: 2 | 3 | with inputs.nix-colors.lib { inherit pkgs; }; 4 | { 5 | programs.neovim.plugins = [ 6 | { 7 | plugin = vimThemeFromScheme { scheme = colorscheme; }; 8 | config = "colorscheme nix-${colorscheme.slug}"; 9 | } 10 | ]; 11 | 12 | xdg.configFile."nvim/init.vim".onChange = 13 | let 14 | nvr = "${pkgs.neovim-remote}/bin/nvr"; 15 | in 16 | '' 17 | ${nvr} --serverlist | while read server; do 18 | ${nvr} --servername $server --nostart -c ':so $MYVIMRC' & \ 19 | done 20 | ''; 21 | } 22 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/colorschemes/nord.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | nord = { 5 | plugin = pkgs.vimPlugins.nord-vim; 6 | config = '' 7 | colorscheme nord 8 | ''; 9 | }; 10 | in 11 | { 12 | programs.neovim.plugins = [ nord ]; 13 | } 14 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/colorschemes/onedark.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | onedark = { 5 | plugin = pkgs.vimUtils.buildVimPlugin { 6 | name = "my-onedark-nvim"; 7 | version = "2021-07-07"; 8 | 9 | src = pkgs.fetchFromGitHub { 10 | owner = "navarasu"; 11 | repo = "onedark.nvim"; 12 | rev = "35119a8b264fe9b06ec4245601b7722debb0dd0b"; 13 | sha256 = "sha256-jQHT8UqnRMj0FfXMGfcSijRKA/XPU+tWEb20vznXNRw="; 14 | }; 15 | 16 | meta.homepage = "https://github.com/navarasu/onedark.nvim"; 17 | }; 18 | config = '' 19 | let g:onedark_disable_toggle_style = 1 20 | colorscheme onedark 21 | ''; 22 | }; 23 | in 24 | { 25 | programs.neovim.plugins = [ onedark ]; 26 | } 27 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/colorschemes/tokyonight.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | tokyonight = { 5 | plugin = pkgs.vimPlugins.tokyonight-nvim; 6 | config = '' 7 | colorscheme tokyonight 8 | ''; 9 | }; 10 | in 11 | { 12 | programs.neovim.plugins = [ tokyonight ]; 13 | } 14 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/colorschemes/vscode.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | vscode = { 5 | plugin = pkgs.vimUtils.buildVimPlugin { 6 | name = "vscode-nvim"; 7 | version = "2021-07-29"; 8 | 9 | src = pkgs.fetchFromGitHub { 10 | owner = "Mofiqul"; 11 | repo = "vscode.nvim"; 12 | rev = "fca44117193b4b1dddf0df65214285295efbfb2d"; 13 | sha256 = "sha256-tuUfzORxWumwP2xmjW0Y9SbQwthXfQ9wf9HvezczOo4="; 14 | }; 15 | 16 | meta.homepage = "https://github.com/Mofiqul/vscode.nvim"; 17 | }; 18 | 19 | config = '' 20 | " hi Cursorline guibg=#36394a 21 | " hi ColorColumn guibg=#424763 22 | let g:vscode_style = "dark" 23 | colorscheme vscode 24 | ''; 25 | }; 26 | in 27 | { 28 | programs.neovim.plugins = [ vscode ]; 29 | } 30 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | with pkgs.vimPlugins; 4 | let 5 | aliases = { 6 | v = "nvim"; 7 | nv = "nvim"; 8 | }; 9 | in 10 | { 11 | imports = [ 12 | ./map-leader.nix 13 | 14 | # ---- Language server protocol ---- 15 | ./plugins/fidget-nvim.nix 16 | # ./plugins/lsp-signature.nix 17 | ./plugins/lspconfig.nix 18 | # ./plugins/lsp_lines.nix 19 | 20 | # ./lsp/omnisharp.nix 21 | ./lsp/go.nix 22 | ./lsp/zig.nix 23 | ./lsp/clangd.nix 24 | # ./lsp/erlang.nix 25 | # ./lsp/fsharp.nix 26 | ./lsp/rust.nix 27 | # ./lsp/clojure.nix 28 | 29 | # ./lsp/elixir-ls.nix 30 | # ./lsp/lexical.nix 31 | ./lsp/test-ls.nix 32 | 33 | # ./lsp/godot.nix 34 | # ./lsp/haskell.nix 35 | # ./lsp/latex.nix 36 | # ./lsp/lua.nix 37 | # ./lsp/node.nix 38 | # ./lsp/python.nix 39 | # ./lsp/rnix.nix 40 | ./lsp/nil.nix 41 | # ./lsp/ccls.nix 42 | 43 | # ---- Linting ---- 44 | # ./plugins/nvim-lint.nix 45 | 46 | # ---- General plugins ---- 47 | 48 | # Utils 49 | # ./plugins/tree-sitter.nix 50 | ./plugins/nvim-tree.nix 51 | ./plugins/projectionist.nix 52 | ./plugins/cmp.nix 53 | ./plugins/pears.nix 54 | # ./plugins/splitjoin.nix 55 | 56 | ./plugins/fzf.nix 57 | # ./plugins/telescope.nix 58 | 59 | # ./plugins/togglelist.nix 60 | # ./plugins/closetag.nix 61 | # ./plugins/neomake.nix 62 | ./plugins/slash.nix 63 | ./plugins/vim-test.nix 64 | # ./plugins/vim-slime.nix 65 | 66 | # Repl 67 | # ./plugins/conjure.nix 68 | 69 | # Debugging 70 | # ./plugins/dap.nix 71 | # ./plugins/dap-ui.nix 72 | 73 | # Git 74 | ./plugins/gitsigns.nix 75 | ./plugins/fugitive.nix 76 | 77 | # Aesthetic 78 | ./colorschemes/tokyonight.nix 79 | ./plugins/todo-comments.nix 80 | ]; 81 | 82 | programs.neovim = { 83 | enable = true; 84 | vimAlias = true; 85 | plugins = with pkgs.vimPlugins; [ 86 | undotree 87 | vim-polyglot 88 | targets-vim 89 | # nvim-unception 90 | vim-commentary 91 | vim-repeat 92 | vim-sensible 93 | vim-surround 94 | vim-tmux-navigator 95 | vim-visual-multi 96 | ]; 97 | 98 | extraPackages = with pkgs; [ 99 | xclip 100 | wl-clipboard 101 | ]; 102 | 103 | extraConfig = builtins.readFile ./init.vim; 104 | }; 105 | 106 | programs.bash.shellAliases = aliases; 107 | } 108 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/languages/rust-vim.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | # programs.neovim.plugins = [ pkgs.vimPlugins.rust-vim ]; 5 | xdg.configFile."nvim/after/ftplugin/rust.vim".text = '' 6 | nnoremap pr :!cargo run src/main.rs 7 | nnoremap pb :!cargo build 8 | ''; 9 | } 10 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/languages/vim-go.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | # programs.neovim.plugins = [ pkgs.vimPlugins.vim-go ]; 5 | xdg.configFile."nvim/after/ftplugin/go.vim".text = '' 6 | 7 | ''; 8 | } 9 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/lsp/ccls.nix: -------------------------------------------------------------------------------- 1 | { prelude, ... }: 2 | 3 | { 4 | programs.neovim.extraConfig = prelude.mkLuaCode '' 5 | require('lspconfig').ccls.setup { 6 | on_attach = on_attach, 7 | capabitilies = capabitilies 8 | } 9 | ''; 10 | } 11 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/lsp/clangd.nix: -------------------------------------------------------------------------------- 1 | { prelude, ... }: 2 | 3 | { 4 | programs.neovim.extraConfig = prelude.mkLuaCode '' 5 | require('lspconfig').clangd.setup { 6 | on_attach = on_attach, 7 | capabitilies = capabitilies 8 | } 9 | ''; 10 | } 11 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/lsp/clojure.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | { 4 | programs.neovim.extraConfig = prelude.mkLuaCode '' 5 | require('lspconfig').clojure_lsp.setup { 6 | on_attach = on_attach, 7 | capabilities = capabilities 8 | } 9 | ''; 10 | } 11 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/lsp/elixir-ls.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | { 4 | programs.neovim.extraConfig = prelude.mkLuaCode '' 5 | require('lspconfig').elixirls.setup{ 6 | on_attach = on_attach, 7 | capabilities = capabilities, 8 | cmd = { "elixir-ls" } 9 | } 10 | ''; 11 | } 12 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/lsp/erlang.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | { 4 | programs.neovim.extraConfig = prelude.mkLuaCode '' 5 | require('lspconfig').erlangls.setup{ 6 | on_attach = on_attach, 7 | capabilities = capabilities, 8 | } 9 | ''; 10 | } 11 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/lsp/fsharp.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | { 4 | programs.neovim.extraConfig = prelude.mkLuaCode '' 5 | require('lspconfig').fsautocomplete.setup{ 6 | on_attach = on_attach, 7 | capabilities = capabilities, 8 | } 9 | ''; 10 | } 11 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/lsp/go.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | { 4 | programs.neovim = { 5 | extraConfig = '' 6 | ${prelude.mkLuaCode '' 7 | require('lspconfig').gopls.setup{ 8 | on_attach = on_attach, 9 | capabilities = capabilities, 10 | flags = { 11 | debounce_text_changes = 150, 12 | } 13 | } 14 | ''} 15 | ''; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/lsp/godot.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | { 4 | programs.neovim = { 5 | extraConfig = prelude.mkLuaCode '' 6 | require('lspconfig').gdscript.setup{ 7 | on_attach = on_attach, 8 | capabilities = capabilities, 9 | flags = { 10 | debounce_text_changes = 150, 11 | } 12 | } 13 | ''; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/lsp/haskell.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | { 4 | programs.neovim.extraConfig = prelude.mkLuaCode '' 5 | require'lspconfig'.hls.setup{ 6 | on_attach = on_attach, 7 | capabilities = capabilities 8 | } 9 | ''; 10 | } 11 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/lsp/latex.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | { 4 | programs.neovim.extraConfig = prelude.mkLuaCode '' 5 | require'lspconfig'.texlab.setup{ 6 | on_attach = on_attach, 7 | capabilities = capabilities 8 | } 9 | ''; 10 | } 11 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/lsp/lexical.nix: -------------------------------------------------------------------------------- 1 | { prelude, ... }: 2 | 3 | { 4 | programs.neovim.extraConfig = prelude.mkLuaCode '' 5 | local lspconfig = require("lspconfig") 6 | local configs = require("lspconfig.configs") 7 | 8 | local cmd = "lexical" 9 | 10 | local lexical = { 11 | cmd = { cmd }, 12 | filetypes = { "elixir", "eelixir", "heex", "surface" }, 13 | settings = {}, 14 | } 15 | 16 | configs.lexical = { 17 | default_config = { 18 | cmd = lexical.cmd, 19 | filetypes = lexical.filetypes, 20 | settings = lexical.settings, 21 | }, 22 | } 23 | 24 | local function endswith(str, suffix) 25 | return string.sub(str, -#suffix) == suffix 26 | end 27 | 28 | lspconfig.lexical.setup({ 29 | on_attach = on_attach, 30 | capabilities = capabilities, 31 | root_dir = function(fname) 32 | local project = lspconfig.util.root_pattern(".git")(fname) 33 | 34 | if project and endswith(project, "open-source/lexical") then 35 | return project 36 | else 37 | return lspconfig.util.root_pattern("mix.exs", ".git")(fname) 38 | end 39 | end 40 | }) 41 | 42 | -- log config 43 | require("vim.lsp.log").set_format_func(vim.inspect) 44 | vim.lsp.set_log_level("debug") 45 | ''; 46 | } 47 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/lsp/lua.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | with pkgs; 4 | { 5 | programs.neovim.extraConfig = prelude.mkLuaCode '' 6 | require('lspconfig').sumneko_lua.setup { 7 | cmd = {'lua-language-server'}; 8 | on_attach = on_attach, 9 | capabilities = capabilities 10 | 11 | settings = { 12 | Lua = { 13 | runtime = { 14 | version = 'LuaJIT', 15 | }, 16 | diagnostics = { 17 | -- Get the language server to recognize the `vim` global 18 | globals = {'vim'}, 19 | }, 20 | workspace = { 21 | -- Make the server aware of Neovim runtime files 22 | library = vim.api.nvim_get_runtime_file("", true), 23 | }, 24 | telemetry = { 25 | enable = false, 26 | }, 27 | }, 28 | }, 29 | } 30 | ''; 31 | } 32 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/lsp/nil.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | { 4 | programs.neovim.extraConfig = prelude.mkLuaCode '' 5 | require('lspconfig').nil_ls.setup{ 6 | on_attach = on_attach, 7 | capabilities = capabilities 8 | } 9 | ''; 10 | } 11 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/lsp/node.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | with pkgs; 4 | { 5 | programs.neovim.extraConfig = prelude.mkLuaCode '' 6 | require('lspconfig').tsserver.setup{ 7 | on_attach = on_attach, 8 | capabilities = capabilities 9 | } 10 | ''; 11 | } 12 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/lsp/omnisharp.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | with pkgs; 4 | { 5 | programs.neovim.extraConfig = prelude.mkLuaCode '' 6 | local pid = vim.fn.getpid() 7 | local omnisharp_bin = "${omnisharp-roslyn}/bin/omnisharp" 8 | 9 | require('lspconfig').omnisharp.setup{ 10 | cmd = { omnisharp_bin, "--languageserver" , "--hostPID", tostring(pid) }; 11 | on_attach = on_attach, 12 | capabilities = capabilities 13 | } 14 | ''; 15 | } 16 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/lsp/python.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | { 4 | programs.neovim.extraConfig = prelude.mkLuaCode '' 5 | -- require('lspconfig').pylsp.setup{ 6 | -- cmd = {'pyls'}, 7 | -- on_attach = on_attach, 8 | -- capabilities = capabilities 9 | -- } 10 | 11 | require('lspconfig').jedi_language_server.setup{ 12 | on_attach = on_attach, 13 | capabilities = capabilities, 14 | flags = { 15 | debounce_text_changes = 150 16 | } 17 | } 18 | ''; 19 | } 20 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/lsp/rnix.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | { 4 | programs.neovim.extraConfig = prelude.mkLuaCode '' 5 | require('lspconfig').rnix.setup{ 6 | on_attach = on_attach, 7 | capabilities = capabilities 8 | } 9 | ''; 10 | } 11 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/lsp/rust.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | with pkgs; 4 | { 5 | programs.neovim.extraConfig = prelude.mkLuaCode '' 6 | require('lspconfig').rust_analyzer.setup{ 7 | on_attach = on_attach, 8 | capabilities = capabilities, 9 | settings = { 10 | ["rust-analyzer"] = { 11 | -- procMacro = { enable = true }, 12 | -- cargo = { loadOutDirsFromCheck = true } 13 | -- TODO: Couldn't get proc macros to work 14 | diagnostics = { disabled = { "unresolved-proc-macro" } } 15 | } 16 | } 17 | } 18 | ''; 19 | } 20 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/lsp/test-ls.nix: -------------------------------------------------------------------------------- 1 | { prelude, ... }: 2 | 3 | { 4 | programs.neovim.extraConfig = prelude.mkLuaCode '' 5 | local lspconfig = require("lspconfig") 6 | local configs = require("lspconfig.configs") 7 | 8 | local cmd = "/home/vini/projects/rust/open-source/test-ls/target/release/project-name" 9 | 10 | local test_ls = { 11 | cmd = { cmd }, 12 | filetypes = { "elixir", "eelixir", "heex", "surface" }, 13 | settings = {}, 14 | } 15 | 16 | configs.test_ls = { 17 | default_config = { 18 | cmd = test_ls.cmd, 19 | filetypes = test_ls.filetypes, 20 | settings = test_ls.settings, 21 | }, 22 | } 23 | 24 | local function endswith(str, suffix) 25 | return string.sub(str, -#suffix) == suffix 26 | end 27 | 28 | lspconfig.test_ls.setup({ 29 | on_attach = on_attach, 30 | capabilities = capabilities, 31 | root_dir = function(fname) 32 | local project = lspconfig.util.root_pattern(".git")(fname) 33 | return project 34 | end 35 | }) 36 | 37 | -- log config 38 | require("vim.lsp.log").set_format_func(vim.inspect) 39 | vim.lsp.set_log_level("debug") 40 | ''; 41 | } 42 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/lsp/zig.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | with pkgs; 4 | { 5 | programs.neovim.extraConfig = prelude.mkLuaCode '' 6 | require('lspconfig').zls.setup{ 7 | on_attach = on_attach, 8 | capabilities = capabilities 9 | } 10 | ''; 11 | } 12 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/map-leader.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | let 4 | leader-mappings = { 5 | plugin = pkgs.writeText "dummy" ""; 6 | config = '' 7 | let mapleader = " " 8 | let maplocalleader = "," 9 | ''; 10 | }; 11 | in 12 | { 13 | programs.neovim.plugins = lib.mkBefore [ leader-mappings ]; 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/alpha.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | let 4 | alpha = { 5 | plugin = pkgs.vimUtils.buildVimPlugin { 6 | name = "alpha-nvim"; 7 | version = "2022-01-08"; 8 | src = pkgs.fetchFromGitHub { 9 | owner = "goolord"; 10 | repo = "alpha-nvim"; 11 | rev = "e43067e7990ab800f623afb3f5743adcc8274ec2"; 12 | sha256 = "sha256-44mSqzis4hxlg1F4dIQ5m6N8fLX3L0iNqJ1OiKFts4Q="; 13 | }; 14 | # TODO: Vim can't build tags 15 | prePatch = "rm -r doc"; 16 | meta.homepage = "https://github.com/goolord/alpha-nvim"; 17 | }; 18 | 19 | config = prelude.mkLuaCode '' 20 | require('alpha').setup(require('alpha.themes.startify').opts) 21 | ''; 22 | }; 23 | in 24 | { 25 | programs.neovim.plugins = [ alpha ]; 26 | } 27 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/autopairs.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | let 4 | autopairs = { 5 | plugin = pkgs.vimPlugins.nvim-autopairs; 6 | config = prelude.mkLuaCode '' 7 | require('nvim-autopairs').setup() 8 | require("nvim-autopairs.completion.cmp").setup({ 9 | map_cr = true, -- map on insert mode 10 | map_complete = true -- it will auto insert `(` after select function or method item 11 | }) 12 | ''; 13 | }; 14 | in 15 | { 16 | programs.neovim.plugins = [ autopairs ]; 17 | } 18 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/base16.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | base16-vim = { 5 | plugin = pkgs.vimPlugins.base16-vim; 6 | config = '' 7 | let base16colorspace=256 " Access colors present in 256 colorspace 8 | set termguicolors 9 | ''; 10 | }; 11 | in 12 | { 13 | programs.neovim.plugins = [ base16-vim ]; 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/bufferline.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | let 4 | bufferline = { 5 | plugin = pkgs.vimPlugins.bufferline-nvim; 6 | config = '' 7 | set termguicolors 8 | 9 | ${prelude.mkLuaCode '' 10 | require("bufferline").setup{ 11 | options = { 12 | show_buffer_close_icons = false, 13 | show_close_icon = false, 14 | diagnostics = "nvim_lsp", 15 | diagnostics_update_in_insert = true, 16 | diagnostics_indicator = function(count, level, diagnostics_dict, context) 17 | local icon = level:match("error") and " " or " " 18 | return " " .. icon .. count 19 | end, 20 | offsets = { 21 | { 22 | filetype = "NvimTree", 23 | text = "File Explorer", 24 | highlight = "Directory", 25 | text_align = "left" 26 | } 27 | } 28 | } 29 | } 30 | ''} 31 | 32 | nnoremap , BufferLinePick 33 | nnoremap gt BufferLineCycleNext 34 | nnoremap gT BufferLineCyclePrev 35 | ''; 36 | }; 37 | in 38 | { 39 | programs.neovim.plugins = [ bufferline ]; 40 | } 41 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/chadtree.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | chadtree = { 5 | plugin = pkgs.vimPlugins.chadtree; 6 | config = "let g:chadtree_settings = {'xdg': v:true}"; 7 | }; 8 | in 9 | { 10 | programs.neovim.plugins = [ chadtree ]; 11 | } 12 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/closetag.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | closetag = { 5 | plugin = pkgs.vimPlugins.vim-closetag; 6 | config = '' 7 | " https://github.com/alvan/vim-closetag#usage 8 | let g:closetag_filenames = '*.html,*.tsx,*.jsx' 9 | ''; 10 | }; 11 | in 12 | { 13 | programs.neovim.plugins = [ closetag ]; 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/cmp.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | 4 | let 5 | cmp = { 6 | plugin = pkgs.vimPlugins.nvim-cmp; 7 | 8 | config = prelude.mkLuaCode '' 9 | local cmp = require('cmp') 10 | local compare = require('cmp.config.compare') 11 | local luasnip = require('luasnip') 12 | 13 | local has_words_before = function() 14 | local line, col = unpack(vim.api.nvim_win_get_cursor(0)) 15 | return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil 16 | end 17 | 18 | local lsp_symbols = { 19 | Text = " (Text) ", 20 | Method = " (Method)", 21 | Function = " (Function)", 22 | Constructor = " (Constructor)", 23 | Field = "ﴲ (Field)", 24 | Variable = " (Variable)", 25 | Class = " (Class)", 26 | Interface = "ﰮ (Interface)", 27 | Module = " (Module)", 28 | Property = "襁 (Property)", 29 | Unit = " (Unit)", 30 | Value = " (Value)", 31 | Enum = "練 (Enum)", 32 | Keyword = " (Keyword)", 33 | Snippet = " (Snippet)", 34 | Color = " (Color)", 35 | File = " (File)", 36 | Reference = " (Reference)", 37 | Folder = " (Folder)", 38 | EnumMember = " (EnumMember)", 39 | Constant = " ﲀ (Constant)", 40 | Struct = "ﳤ (Struct)", 41 | Event = " (Event)", 42 | Operator = " (Operator)", 43 | TypeParameter = " (TypeParameter)", 44 | } 45 | 46 | cmp.setup({ 47 | completion = { 48 | completeopt = 'menu,menuone,noinsert', 49 | }, 50 | formatting = { 51 | format = function(entry, vim_item) 52 | vim_item.kind = lsp_symbols[vim_item.kind] 53 | vim_item.menu = ({ 54 | buffer = "[Buffer]", 55 | nvim_lsp = "[LSP]", 56 | luasnip = "[LuaSnip]", 57 | })[entry.source.name] 58 | 59 | return vim_item 60 | end 61 | }, 62 | snippet = { 63 | expand = function(args) 64 | require('luasnip').lsp_expand(args.body) 65 | end 66 | }, 67 | mapping = { 68 | [''] = function(fallback) 69 | if cmp.visible() then 70 | cmp.select_next_item() 71 | elseif luasnip.expand_or_jumpable() then 72 | luasnip.expand_or_jump() 73 | elseif has_words_before() then 74 | cmp.complete() 75 | else 76 | fallback() 77 | end 78 | end, 79 | [''] = function(fallback) 80 | if cmp.visible() then 81 | cmp.select_prev_item() 82 | elseif luasnip.jumpable(-1) then 83 | luasnip.jump(-1) 84 | else 85 | fallback() 86 | end 87 | end, 88 | [''] = cmp.mapping.scroll_docs(-4), 89 | [''] = cmp.mapping.scroll_docs(4), 90 | [''] = cmp.mapping.complete(), 91 | [''] = cmp.mapping.close(), 92 | [''] = cmp.mapping.confirm({ 93 | behavior = cmp.ConfirmBehavior.Replace, 94 | select = true, 95 | }) 96 | }, 97 | -- sorting = { 98 | -- priority_weight = 2, 99 | -- comparators = { 100 | -- compare.offset, 101 | -- compare.exact, 102 | -- compare.score, 103 | -- compare.recently_used, 104 | -- compare.kind, 105 | -- compare.sort_text, 106 | -- compare.length, 107 | -- compare.order, 108 | -- } 109 | -- }, 110 | sources = cmp.config.sources({ 111 | { name = 'nvim_lsp', priority = 8 }, 112 | { name = 'luasnip' }, 113 | { name = 'buffer' }, 114 | { name = 'path' }, 115 | }) 116 | }) 117 | ''; 118 | }; 119 | cmp-engines = with pkgs.vimPlugins; [ 120 | cmp-nvim-lsp 121 | cmp-buffer 122 | cmp-path 123 | cmp_luasnip 124 | ]; 125 | in 126 | { 127 | imports = [ ./luasnip.nix ]; 128 | 129 | programs.neovim.plugins = [ 130 | cmp 131 | ] ++ cmp-engines; 132 | } 133 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/colorizer.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | colorizer = { 5 | plugin = pkgs.vimPlugins.nvim-colorizer-lua; 6 | config = '' 7 | set termguicolors 8 | lua require('colorizer').setup() 9 | ''; 10 | }; 11 | in 12 | { 13 | programs.neovim.plugins = [ colorizer ]; 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/compe.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | let 4 | compe = { 5 | plugin = pkgs.vimPlugins.nvim-compe; 6 | config = '' 7 | " Keybindings 8 | " inoremap compe#complete() 9 | " inoremap compe#confirm('') 10 | " inoremap compe#confirm(luaeval("require 'nvim-autopairs'.autopairs_cr()")) 11 | " inoremap compe#close('') 12 | " inoremap compe#scroll({ 'delta': +4 }) 13 | " inoremap compe#scroll({ 'delta': -4 }) 14 | 15 | " inoremap pumvisible() ? "\" : "\" 16 | " inoremap pumvisible() ? "\" : "\" 17 | 18 | ${prelude.mkLuaCode '' 19 | require('compe').setup { 20 | enabled = true; 21 | autocomplete = true; 22 | debug = false; 23 | min_length = 1; 24 | preselect = 'always'; 25 | throttle_time = 80; 26 | max_abbr_width = 100; 27 | max_kind_width = 100; 28 | max_menu_width = 100; 29 | documentation = true; 30 | 31 | source = { 32 | emoji = true; 33 | path = true; 34 | buffer = true; 35 | calc = true; 36 | spell = true; 37 | orgmode = true; 38 | nvim_lsp = true; 39 | nvim_lua = true; 40 | ultisnips = true; 41 | luasnip = true; 42 | vsnip = {priority = 100000}; 43 | neorg = true; 44 | }; 45 | } 46 | 47 | local t = function(str) 48 | return vim.api.nvim_replace_termcodes(str, true, true, true) 49 | end 50 | 51 | local check_back_space = function() 52 | local col = vim.fn.col('.') - 1 53 | if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then 54 | return true 55 | else 56 | return false 57 | end 58 | end 59 | 60 | _G.tab_complete = function() 61 | if vim.fn.pumvisible() == 1 then 62 | return t "" 63 | elseif vim.fn.call("vsnip#available", {1}) == 1 then 64 | return t "(vsnip-expand-or-jump)" 65 | elseif check_back_space() then 66 | return t "" 67 | else 68 | return vim.fn['compe#complete']() 69 | end 70 | end 71 | 72 | _G.s_tab_complete = function() 73 | if vim.fn.pumvisible() == 1 then 74 | return t "" 75 | elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then 76 | return t "(vsnip-jump-prev)" 77 | else 78 | return t "" 79 | end 80 | end 81 | 82 | vim.api.nvim_set_keymap("i", "", "v:lua.tab_complete()", {expr = true}) 83 | vim.api.nvim_set_keymap("s", "", "v:lua.tab_complete()", {expr = true}) 84 | vim.api.nvim_set_keymap("i", "", "v:lua.s_tab_complete()", {expr = true}) 85 | vim.api.nvim_set_keymap("s", "", "v:lua.s_tab_complete()", {expr = true}) 86 | ''} 87 | ''; 88 | }; 89 | in 90 | { 91 | programs.neovim.plugins = [ compe ]; 92 | } 93 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/conjure.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | conjure = { 5 | plugin = pkgs.vimPlugins.conjure; 6 | config = '' 7 | 8 | ''; 9 | }; 10 | in 11 | { 12 | programs.neovim.plugins = [ conjure ]; 13 | } 14 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/coq.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | coq = { 5 | plugin = pkgs.vimUtils.buildVimPlugin { 6 | name = "coq_nvim"; 7 | version = "2021-07-07"; 8 | 9 | src = pkgs.fetchFromGitHub { 10 | owner = "ms-jpq"; 11 | repo = "coq_nvim"; 12 | rev = "93bd544d9f9acd1a9e31cee6a36c6ed20c3fc7de"; 13 | sha256 = "sha256-gB97HNvZgkGa0qV3vRH6XJ9FxZnBoMHF84Q39CE3a0c="; 14 | }; 15 | 16 | meta.homepage = "https://github.com/ms-jpq/coq_nvim"; 17 | }; 18 | 19 | config = ""; 20 | }; 21 | in 22 | { 23 | programs.neovim.plugins = [ coq ]; 24 | } 25 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/dap-ui.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | let 4 | dap-ui = { 5 | plugin = pkgs.vimPlugins.nvim-dap-ui; 6 | config = '' 7 | nnoremap du lua require('dapui').toggle() 8 | 9 | augroup dap_ui 10 | au FileType dap-repl lua require('dap.ext.autocompl').attach() 11 | au BufEnter * :call SetDAPColors() 12 | augroup end 13 | 14 | function! SetDAPColors() 15 | hi default link DapUIVariable Normal 16 | hi default link DapUIScope Function 17 | hi default link DapUIDecoration Function 18 | hi default link DapUIType Type 19 | hi default link DapUISource Statement 20 | hi default link DapUILineNumber Constant 21 | hi default link DapUIFrameName Normal 22 | hi default link DapUIBreakpointsPath Function 23 | 24 | " Highlights below might change 25 | 26 | hi default link DapUIStoppedThread Function 27 | hi default link DapUIThread Function 28 | hi default link DapUIWatchesFrame Function 29 | hi default link DapUIWatchesHeader Function 30 | 31 | " hi default DapUIWatchesError guifg=#F70067 32 | hi default link DapUIWatchesError Error 33 | " hi default DapUIWatchesEmpty guifg=#F70067 34 | hi default link DapUIWatchesEmpty Error 35 | 36 | hi default DapUIFloatBorder guifg=#00F1F5 37 | hi default DapUIWatchesValue guifg=#A9FF68 38 | hi default DapUIBreakpointsInfo guifg=#A9FF68 39 | hi default DapUIBreakpointsCurrentLine guifg=#A9FF68 gui=bold 40 | 41 | hi default link DapUIBreakpointsLine DapUILineNumber 42 | endfunction 43 | 44 | ${prelude.mkLuaCode '' 45 | require('dapui').setup({ 46 | icons = { 47 | expanded = "▾", 48 | collapsed = "▸" 49 | }, 50 | mappings = { 51 | -- Use a table to apply multiple mappings 52 | expand = { "" }, 53 | open = "o", 54 | remove = "d", 55 | edit = "e", 56 | }, 57 | sidebar = { 58 | open_on_start = true, 59 | elements = { 60 | -- You can change the order of elements in the sidebar 61 | "scopes", 62 | "breakpoints", 63 | "stacks", 64 | "watches" 65 | }, 66 | width = 40, 67 | position = "left" -- Can be "left" or "right" 68 | }, 69 | tray = { 70 | open_on_start = true, 71 | elements = { 72 | "repl" 73 | }, 74 | height = 10, 75 | position = "bottom" -- Can be "bottom" or "top" 76 | }, 77 | floating = { 78 | max_height = nil, -- These can be integers or a float between 0 and 1. 79 | max_width = nil -- Floats will be treated as percentage of your screen. 80 | } 81 | }) 82 | ''} 83 | ''; 84 | }; 85 | in 86 | { 87 | programs.neovim.plugins = [ dap-ui ]; 88 | } 89 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/dap.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | let 4 | dap = { 5 | plugin = pkgs.vimPlugins.nvim-dap; 6 | config = '' 7 | nnoremap dd lua require('dap').toggle_breakpoint() 8 | nnoremap dD lua require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: ')) 9 | nnoremap df :lua require('dap').continue() 10 | nnoremap dj lua require('dap').step_out() 11 | nnoremap dk lua require('dap').step_into() 12 | nnoremap dl lua require('dap').set_breakpoint(nil, nil, vim.fn.input('Log point message: ')) 13 | nnoremap dr lua require('dap').repl.open() 14 | 15 | ${prelude.mkLuaCode '' 16 | -- require('dap.ext.vscode').load_launchjs() 17 | 18 | local dap = require('dap') 19 | 20 | dap.configurations.python = { 21 | { 22 | type = 'python'; 23 | request = 'launch'; 24 | name = "Launch file"; 25 | program = "''${fileDirname}"; 26 | }, 27 | } 28 | 29 | dap.adapters.python = { 30 | type = 'executable'; 31 | command = 'python'; 32 | args = { '-m', 'debugpy.adapter' }; 33 | } 34 | ''} 35 | ''; 36 | }; 37 | in 38 | { 39 | programs.neovim.plugins = [ dap ]; 40 | } 41 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/fidget-nvim.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | let 4 | fidget-nvim = { 5 | plugin = pkgs.vimPlugins.fidget-nvim; 6 | config = prelude.mkLuaCode '' 7 | require("fidget").setup({}) 8 | ''; 9 | }; 10 | in 11 | { 12 | programs.neovim.plugins = [ fidget-nvim ]; 13 | } 14 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/fugitive.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | fugitive = { 5 | plugin = pkgs.vimPlugins.vim-fugitive; 6 | config = '' 7 | nnoremap gg :tab G 8 | nnoremap gd :Gvdiffsplit 9 | nnoremap gD :!git diff 10 | nnoremap gl :Gclog 11 | ''; 12 | }; 13 | in 14 | { 15 | programs.neovim.plugins = [ fugitive ]; 16 | } 17 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/fzf-checkout.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | fzf-checkout = { 5 | plugin = pkgs.vimPlugins.fzf-checkout-vim; 6 | 7 | config = '' 8 | let g:fzf_checkout_git_options = '--sort=-committerdate' 9 | let g:fzf_tag_actions = { 10 | \ 'checkout': {'execute': '!{git} -C {cwd} checkout {branch}'}, 11 | \} 12 | 13 | nnoremap gb GBranches 14 | nnoremap gt GTags 15 | ''; 16 | }; 17 | 18 | in 19 | { 20 | programs.neovim.plugins = [ fzf-checkout ]; 21 | } 22 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/fzf-session.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | fzf-session = { 5 | plugin = pkgs.vimUtils.buildVimPlugin { 6 | name = "fzf-session.vim"; 7 | version = "2021-07-29"; 8 | 9 | src = pkgs.fetchFromGitHub { 10 | owner = "arcticlimer"; 11 | repo = "fzf-session.vim"; 12 | rev = "dd6a28753677e9790d16db56b8d38a7bcf7ff979"; 13 | sha256 = "sha256-GabgJli7XGFJ2lRi8KWvqoknFX5KaN0GpWLik5M0gpg="; 14 | }; 15 | 16 | meta.homepage = "https://github.com/arcticlimer/fzf-session.vim"; 17 | }; 18 | 19 | config = '' 20 | " Creating session directory 21 | let s:fzf_session_path = '~/.fzf_session' 22 | call mkdir(expand(s:fzf_session_path), "p") 23 | let g:fzf_session_path = s:fzf_session_path 24 | 25 | " Keybindings 26 | nnoremap ss :Session 27 | nnoremap sd :SDelete 28 | nnoremap sl :Sessions 29 | ''; 30 | }; 31 | in 32 | { 33 | programs.neovim.plugins = [ fzf-session ]; 34 | } 35 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/fzf.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | fzf-vim = { 5 | plugin = pkgs.vimPlugins.fzf-vim; 6 | config = '' 7 | let $FZF_DEFAULT_COMMAND = 'fd -H' 8 | let $FZF_DEFAULT_OPTS = '--exact --reverse --bind ctrl-a:select-all' 9 | let g:fzf_preview_window = ['right:50%', 'ctrl-/'] 10 | 11 | nnoremap . GFiles 12 | nnoremap ; Rg 13 | nnoremap / Lines 14 | nnoremap ff Files 15 | nnoremap fc Commits 16 | nnoremap fh Helptags 17 | nnoremap fm Apropos 18 | 19 | " CTRL-A CTRL-Q to select all and build quickfix list 20 | function! s:build_quickfix_list(lines) 21 | call setqflist(map(copy(a:lines), '{ "filename": v:val }')) 22 | copen 23 | cc 24 | endfunction 25 | 26 | let g:fzf_action = { 27 | \ 'ctrl-q': function('s:build_quickfix_list'), 28 | \ 'ctrl-t': 'tab split', 29 | \ 'ctrl-x': 'split', 30 | \ 'ctrl-v': 'vsplit' } 31 | 32 | " Rg with --hidden 33 | command! -bang -nargs=* Rg 34 | \ call fzf#vim#grep( 35 | \ 'rg --hidden --column --line-number --no-heading --color=always --smart-case -- '.shellescape(), 1, 36 | \ fzf#vim#with_preview(), 0) 37 | 38 | command! -nargs=? Apropos call fzf#run(fzf#wrap({'source': 'apropos .'.shellescape().' | cut -d " " -f 1', 'sink': 'tab Man', 'options': ['--preview', 'MANPAGER=cat MANWIDTH='.(&columns/2-4).' man {}']})) 39 | ''; 40 | }; 41 | in 42 | { 43 | programs.neovim.plugins = [ fzf-vim ]; 44 | home.packages = with pkgs; [ fzf fd ripgrep ]; 45 | } 46 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/git-blame.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | git-blame = { 5 | plugin = pkgs.vimPlugins.git-blame-nvim; 6 | config = "let g:gitblame_date_format = '%r'"; 7 | }; 8 | in 9 | { 10 | programs.neovim.plugins = [ git-blame ]; 11 | } 12 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/gitsigns.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | let 4 | gitsigns = { 5 | plugin = pkgs.vimPlugins.gitsigns-nvim; 6 | config = '' 7 | nnoremap gm lua require('gitsigns').blame_line(true) 8 | 9 | ${prelude.mkLuaCode '' 10 | require('gitsigns').setup{ 11 | current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` 12 | current_line_blame_opts = { 13 | virt_text = true, 14 | virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' 15 | delay = 100, 16 | ignore_whitespace = false, 17 | }, 18 | current_line_blame_formatter = ', - ', 19 | } 20 | 21 | local gs = package.loaded.gitsigns 22 | 23 | local function map(mode, l, r, opts) 24 | opts = opts or {} 25 | opts.buffer = bufnr 26 | vim.keymap.set(mode, l, r, opts) 27 | end 28 | 29 | -- Navigation 30 | map('n', ']c', function() 31 | if vim.wo.diff then return ']c' end 32 | vim.schedule(function() gs.next_hunk() end) 33 | return '' 34 | end, {expr=true}) 35 | 36 | map('n', '[c', function() 37 | if vim.wo.diff then return '[c' end 38 | vim.schedule(function() gs.prev_hunk() end) 39 | return '' 40 | end, {expr=true}) 41 | 42 | -- Actions 43 | map({'n', 'v'}, 'hs', ':Gitsigns stage_hunk') 44 | map({'n', 'v'}, 'hr', ':Gitsigns reset_hunk') 45 | map('n', 'hS', gs.stage_buffer) 46 | map('n', 'hu', gs.undo_stage_hunk) 47 | map('n', 'hR', gs.reset_buffer) 48 | map('n', 'hp', gs.preview_hunk) 49 | map('n', 'hb', function() gs.blame_line{full=true} end) 50 | map('n', 'tb', gs.toggle_current_line_blame) 51 | map('n', 'hd', gs.diffthis) 52 | map('n', 'hD', function() gs.diffthis('~') end) 53 | map('n', 'td', gs.toggle_deleted) 54 | 55 | -- Text object 56 | map({'o', 'x'}, 'ih', ':Gitsigns select_hunk') 57 | ''} 58 | ''; 59 | }; 60 | in 61 | { 62 | programs.neovim.plugins = [ gitsigns ]; 63 | } 64 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/indentline.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | indentline = { 5 | plugin = pkgs.vimPlugins.indent-blankline-nvim; 6 | config = '' 7 | let g:indent_blankline_char = '│' 8 | ''; 9 | }; 10 | in 11 | { 12 | programs.neovim.plugins = [ indentline ]; 13 | } 14 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/lfe.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | lfe = { 5 | plugin = pkgs.vimPlugins.vim-lfe; 6 | config = '' 7 | autocmd FileType lfe setlocal commentstring=#\|\ %s\ \|# 8 | ''; 9 | }; 10 | in 11 | { 12 | programs.neovim.plugins = [ lfe ]; 13 | } 14 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/lsp-extensions.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | lsp-extensions = { 5 | plugin = pkgs.vimPlugins.lsp_extensions-nvim; 6 | config = '' 7 | function MyInlayHints() 8 | lua require('lsp_extensions').inlay_hints{ prefix = ' » ', enabled = {"ChainingHint", "TypeHint", "ParameterHint"} } 9 | endfunction 10 | 11 | augroup lsp_extension 12 | autocmd InsertLeave,TextChanged,BufRead *.rs call MyInlayHints() 13 | augroup end 14 | ''; 15 | }; 16 | in 17 | { 18 | programs.neovim.plugins = [ lsp-extensions ]; 19 | } 20 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/lsp-signature.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | let 4 | lsp-signature = { 5 | plugin = pkgs.vimPlugins.lsp_signature-nvim; 6 | config = prelude.mkLuaCode "require('lsp_signature').setup()"; 7 | }; 8 | in 9 | { 10 | programs.neovim.plugins = [ lsp-signature ]; 11 | } 12 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/lsp_lines.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | let 4 | lsp_lines = pkgs.vimUtils.buildVimPlugin { 5 | name = "vim-quickrun"; 6 | version = "2021-07-07"; 7 | 8 | src = pkgs.fetchFromSourcehut { 9 | owner = "~whynothugo"; 10 | repo = "lsp_lines.nvim"; 11 | rev = "db67e94c813aae166c3d2f119ea7d2e85164922a"; 12 | sha256 = "sha256-iAeay6uS2JBRaqxarWZ0Dcqb1RugUPdi7oBexrgE43c="; 13 | }; 14 | }; 15 | plugin = { 16 | plugin = lsp_lines; 17 | config = prelude.mkLuaCode '' 18 | -- Disable virtual_text since it's redundant due to lsp_lines. 19 | vim.diagnostic.config({ 20 | virtual_text = false, 21 | }) 22 | 23 | require('lsp_lines').setup() 24 | ''; 25 | }; 26 | in 27 | { 28 | programs.neovim.plugins = [ plugin ]; 29 | } 30 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/lspconfig.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | let 4 | lspconfig = { 5 | plugin = pkgs.vimPlugins.nvim-lspconfig; 6 | config = prelude.mkLuaCode '' 7 | -- This function needs to be global, so that other lsp configs inside 8 | -- ./lsp will be able to reference it in their setup. 9 | _G.on_attach = function(client, bufnr) 10 | local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end 11 | local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end 12 | 13 | vim.wo.signcolumn = 'yes' 14 | 15 | -- Mappings. 16 | local opts = { noremap=true, silent=true } 17 | 18 | -- See `:help vim.lsp.*` for documentation on any of the below functions 19 | 20 | -- buf_set_keymap('n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) 21 | -- buf_set_keymap('n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) 22 | -- buf_set_keymap('n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) 23 | 24 | buf_set_keymap('n', '[d', 'lua vim.lsp.diagnostic.goto_prev()', opts) 25 | buf_set_keymap('n', ']d', 'lua vim.lsp.diagnostic.goto_next()', opts) 26 | buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) 27 | 28 | buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) 29 | buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) 30 | buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) 31 | buf_set_keymap('n', '', 'lua vim.lsp.buf.definition()', opts) 32 | buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) 33 | buf_set_keymap('n', 'D', 'lua vim.lsp.buf.type_definition()', opts) 34 | 35 | buf_set_keymap('n', 'ld', 'lua vim.diagnostic.open_float()', opts) 36 | 37 | buf_set_keymap('n', 'lq', 'lua vim.diagnostic.set_loclist()', opts) 38 | 39 | vim.keymap.set('n', 'lf', function() 40 | vim.lsp.buf.format { async = true } 41 | end, opts) 42 | 43 | buf_set_keymap('n', 'lr', 'lua vim.lsp.buf.rename()', opts) 44 | buf_set_keymap('n', 'ls', 'lua vim.lsp.buf.workspace_symbol("")', opts) 45 | buf_set_keymap('n', 'la', 'lua vim.lsp.buf.code_action()', opts) 46 | end 47 | 48 | -- Lsp capabilities 49 | _G.capabilities = vim.lsp.protocol.make_client_capabilities() 50 | ''; 51 | }; 52 | in 53 | { 54 | programs.neovim.plugins = [ 55 | lspconfig 56 | ]; 57 | } 58 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/lualine.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | let 4 | lualine = { 5 | plugin = pkgs.vimPlugins.lualine-nvim; 6 | config = prelude.mkLuaCode '' 7 | require('lualine').setup { 8 | options = { 9 | icons_enabled = true, 10 | theme = 'auto', 11 | component_separators = {'', ''}, 12 | section_separators = {'', ''}, 13 | disabled_filetypes = {} 14 | }, 15 | sections = { 16 | lualine_a = {'mode'}, 17 | lualine_b = { 18 | 'branch', 19 | {'diagnostics', sources = {'nvim_diagnostic'}} 20 | }, 21 | lualine_c = { 22 | { 23 | 'filename', 24 | path = 1 25 | } 26 | }, 27 | lualine_x = {'encoding', 'fileformat', 'filetype'}, 28 | lualine_y = {'progress'}, 29 | lualine_z = {'location'} 30 | }, 31 | inactive_sections = { 32 | lualine_a = {}, 33 | lualine_b = {}, 34 | lualine_c = {'filename'}, 35 | lualine_x = {'location'}, 36 | lualine_y = {}, 37 | lualine_z = {} 38 | }, 39 | tabline = {}, 40 | extensions = {'nvim-tree'} 41 | } 42 | ''; 43 | }; 44 | in 45 | { 46 | programs.neovim.plugins = [ lualine ]; 47 | } 48 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/luasnip.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | let 4 | luasnip = { 5 | plugin = pkgs.vimPlugins.luasnip; 6 | }; 7 | in 8 | { 9 | programs.neovim.plugins = [ 10 | luasnip 11 | ]; 12 | } 13 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/neomake.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | neomake = { 5 | plugin = pkgs.vimPlugins.neomake; 6 | config = '' 7 | call neomake#configure#automake('nrwi', 500) 8 | ''; 9 | }; 10 | in 11 | { 12 | programs.neovim.plugins = [ neomake ]; 13 | } 14 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/neorg.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | let 4 | neorg = { 5 | plugin = pkgs.vimPlugins.neorg; 6 | config = prelude.mkLuaCode '' 7 | require('neorg').setup { 8 | -- Tell Neorg what modules to load 9 | load = { 10 | ["core.defaults"] = {}, -- Load all the default modules 11 | ["core.keybinds"] = { 12 | config = { 13 | default_keybinds = true, 14 | norg_leader = "o" 15 | } 16 | }, -- Load keybinds 17 | ["core.norg.concealer"] = {}, -- Allows for use of icons 18 | ["core.norg.dirman"] = { -- Manage your directories with Neorg 19 | config = { 20 | workspaces = { 21 | my_workspace = "~/.neorg" 22 | } 23 | } 24 | } 25 | }, 26 | } 27 | ''; 28 | }; 29 | in 30 | { 31 | programs.neovim.plugins = [ neorg ]; 32 | } 33 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/neovim-session-manager.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | let 4 | session-manager = { 5 | plugin = pkgs.vimUtils.buildVimPlugin { 6 | name = "neovim-session-manager"; 7 | version = "2022-01-08"; 8 | src = pkgs.fetchFromGitHub { 9 | owner = "Shatur"; 10 | repo = "neovim-session-manager"; 11 | rev = "bff80bee884d7f728dd1030d7639a422475d5269"; 12 | sha256 = "sha256-2DswlA71s7EUAb8dDGwGsAaH23ietbOi4o0QMz3p6Lg="; 13 | }; 14 | meta.homepage = "https://github.com/Shatur/neovim-session-manager"; 15 | }; 16 | 17 | config = prelude.mkLuaCode '' 18 | local Path = require('plenary.path') 19 | 20 | require('session_manager').setup({ 21 | sessions_dir = Path:new(vim.fn.stdpath('data'), 'sessions'), -- The directory where the session files will be saved. 22 | path_replacer = '__', -- The character to which the path separator will be replaced for session files. 23 | colon_replacer = '++', -- The character to which the colon symbol will be replaced for session files. 24 | 25 | -- Define what to do when Neovim is started without arguments. Possible values: Disabled, CurrentDir, LastSession 26 | autoload_mode = require('session_manager.config').AutoloadMode.CurrentDir, 27 | 28 | autosave_last_session = true, -- Automatically save last session on exit. 29 | autosave_ignore_not_normal = true, -- Plugin will not save a session when no writable and listed buffers are opened. 30 | autosave_only_in_session = true, -- Always autosaves session. If true, only autosaves after a session is active. 31 | }) 32 | -- require('telescope').load_extension('sessions') 33 | ''; 34 | }; 35 | in 36 | { 37 | programs.neovim.plugins = [ 38 | session-manager 39 | pkgs.vimPlugins.plenary-nvim 40 | # pkgs.vimPlugins.telescope-nvim 41 | ]; 42 | } 43 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/nvim-lint.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | let 4 | nvim-lint = { 5 | plugin = pkgs.vimPlugins.nvim-lint; 6 | config = '' 7 | ${prelude.mkLuaCode '' 8 | require('lint').linters_by_ft = { 9 | go = {'golangcilint',} 10 | } 11 | ''} 12 | 13 | " TODO: Autocommands not working (but they work if manually pasted into vim's CLI) 14 | augroup nvim_lint 15 | " au BufWritePost lua require('lint').try_lint() 16 | " au InsertLeave lua require('lint').try_lint() 17 | augroup end 18 | ''; 19 | }; 20 | in 21 | { 22 | programs.neovim.plugins = [ nvim-lint ]; 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/nvim-tree.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | let 4 | nvim-tree = { 5 | plugin = pkgs.vimPlugins.nvim-tree-lua; 6 | config = '' 7 | ${prelude.mkLuaCode '' 8 | require('nvim-tree').setup { 9 | renderer = { 10 | icons = { 11 | show = { 12 | file = false, 13 | folder = false, 14 | folder_arrow = false, 15 | git = false, 16 | } 17 | }, 18 | indent_markers = { 19 | enable = true, 20 | inline_arrows = true, 21 | icons = { 22 | corner = "└", 23 | edge = "│", 24 | item = "│", 25 | bottom = "─", 26 | none = " ", 27 | }, 28 | }, 29 | }, 30 | hijack_directories = { 31 | enable = true, 32 | auto_open = true, 33 | }, 34 | open_on_tab = false, 35 | hijack_cursor = false, 36 | update_cwd = false, 37 | update_focused_file = { 38 | enable = true, 39 | update_cwd = false, 40 | ignore_list = {} 41 | }, 42 | system_open = { 43 | cmd = nil, 44 | args = {} 45 | }, 46 | view = { 47 | adaptive_size = true, 48 | width = 30, 49 | side = 'left', 50 | } 51 | } 52 | ''} 53 | 54 | nnoremap tn NvimTreeToggle 55 | ''; 56 | }; 57 | in 58 | { 59 | programs.neovim.plugins = [ nvim-tree ]; 60 | } 61 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/orgmode-nvim.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | let 4 | orgmode = { 5 | plugin = pkgs.vimUtils.buildVimPlugin { 6 | name = "orgmode.nvim"; 7 | version = "2021-07-07"; 8 | 9 | src = pkgs.fetchFromGitHub { 10 | owner = "kristijanhusak"; 11 | repo = "orgmode.nvim"; 12 | rev = "9b412b3a8356d15423f953f90d56c38b8917f290"; 13 | sha256 = "sha256-chAMa6PR88jM356mQAr2T6D11Utzfm60+o1AMZdgT9g="; 14 | }; 15 | 16 | postPatch = "rm Makefile"; 17 | 18 | meta.homepage = "https://github.com/kristijanhusak/orgmode.nvim"; 19 | }; 20 | 21 | config = "lua require('orgmode').setup{}"; 22 | }; 23 | in 24 | { 25 | programs.neovim.plugins = [ orgmode ]; 26 | } 27 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/pears.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | let 4 | pears = { 5 | plugin = pkgs.vimPlugins.pears-nvim; 6 | config = prelude.mkLuaCode "require('pears').setup()"; 7 | }; 8 | in 9 | { 10 | programs.neovim.plugins = [ pears ]; 11 | } 12 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/presence.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | let 4 | presence = { 5 | plugin = presence-nvim; 6 | config = prelude.mkLuaCode '' 7 | require("presence"):setup({ 8 | -- General options 9 | auto_update = true, 10 | neovim_image_text = "The One True Text Editor", 11 | main_image = "file", -- Main image display (either "neovim" or "file") 12 | log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error") 13 | enable_line_number = false, -- Displays the current line number instead of the current project 14 | 15 | -- Rich Presence text options 16 | editing_text = "Editing %s", -- Format string rendered when an editable file is loaded in the buffer 17 | file_explorer_text = "Browsing %s", -- Format string rendered when browsing a file explorer 18 | workspace_text = "Working on %s", -- Workspace format string (either string or function(git_project_name: string|nil, buffer: string): string) 19 | line_number_text = "Line %s out of %s", -- Line number format string (for when enable_line_number is set to true) 20 | }) 21 | ''; 22 | }; 23 | in 24 | { 25 | programs.neovim.plugins = [ presence ]; 26 | } 27 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/projectionist.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | projectionist = { 5 | plugin = pkgs.vimPlugins.vim-projectionist; 6 | config = "nnoremap pa A"; 7 | }; 8 | in 9 | { 10 | programs.neovim.plugins = [ projectionist ]; 11 | } 12 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/rainbow.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | rainbow = { 5 | plugin = pkgs.vimPlugins.rainbow; 6 | config = '' 7 | let g:rainbow_active = 1 8 | ''; 9 | }; 10 | in 11 | { 12 | programs.neovim.plugins = [ rainbow ]; 13 | } 14 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/slash.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | slash = { 5 | plugin = pkgs.vimPlugins.vim-slash; 6 | config = '' 7 | noremap (slash-after) zz 8 | ''; 9 | }; 10 | in 11 | { 12 | programs.neovim.plugins = [ slash ]; 13 | } 14 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/splitjoin.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | vim-splitjoin = { 5 | plugin = pkgs.vimPlugins.splitjoin-vim; 6 | config = '' 7 | let g:splitjoin_align = 1 8 | ''; 9 | }; 10 | in 11 | { 12 | programs.neovim.plugins = [ vim-splitjoin ]; 13 | } 14 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/startscreen.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | startscreen = { 5 | plugin = pkgs.vimUtils.buildVimPlugin { 6 | name = "startscreen-nvim"; 7 | version = "2021-08-02"; 8 | 9 | src = pkgs.fetchFromGitHub { 10 | owner = "arp242"; 11 | repo = "startscreen.vim"; 12 | rev = "90bf116b3adb78a635be101193f98b1e99164af9"; 13 | sha256 = "sha256-UhFU8Bw2NdodTfTaP1VIJ37hAavY5LrN4VIM0XX0y94="; 14 | }; 15 | 16 | meta.homepage = "https://github.com/arp242/startscreen.vim"; 17 | }; 18 | 19 | config = '' 20 | function! T() 21 | let message =<< trim END 22 | ██████ ██████ ██████ █████ 23 | ██ ██ ██ ██ ██ ██ ██ ██ 24 | ██████ ██ ██ ██████ ███████ 25 | ██ ██ ██ ██ ██ ██ ██ ██ 26 | ██████ ██████ ██ ██ ██ ██ 27 | 28 | ███ ███ ██████ ███ ██ ███████ ████████ ██████ █████ ██████ 29 | ████ ████ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ 30 | ██ ████ ██ ██ ██ ██ ██ ██ ███████ ██ ██████ ███████ ██ ██ 31 | ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ 32 | ██ ██ ██████ ██ ████ ███████ ██ ██ ██ ██ ██ ██████ 33 | END 34 | 35 | setlocal modifiable 36 | put =message 37 | :%>>> 38 | normal gg0 39 | setlocal nomodifiable 40 | endfun 41 | 42 | let g:Startscreen_function = function('T') 43 | ''; 44 | }; 45 | in 46 | { 47 | programs.neovim.plugins = [ startscreen ]; 48 | } 49 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/telescope.nix: -------------------------------------------------------------------------------- 1 | { pkgs, prelude, ... }: 2 | 3 | let 4 | telescope = { 5 | plugin = pkgs.vimPlugins.telescope-nvim; 6 | config = '' 7 | ${prelude.mkLuaCode '' 8 | local actions = require('telescope.actions') 9 | require('telescope').setup({ 10 | defaults = { 11 | prompt_prefix = " λ ", 12 | mappings = { 13 | i = { 14 | [""] = actions.close, 15 | [""] = "move_selection_previous", 16 | [""] = "move_selection_next", 17 | [""] = "preview_scrolling_up", 18 | [""] = "preview_scrolling_down", 19 | }, 20 | }, 21 | extensions = { 22 | fzf = { 23 | fuzzy = true, -- false will only do exact matching 24 | override_generic_sorter = false, -- override the generic sorter 25 | override_file_sorter = true, -- override the file sorter 26 | case_mode = "smart_case", -- or "ignore_case" or "respect_case" 27 | } 28 | } 29 | }, 30 | }) 31 | 32 | require('telescope').load_extension('fzf') 33 | ''} 34 | 35 | nnoremap , Telescope buffers 36 | nnoremap . Telescope git_files theme=ivy 37 | nnoremap ; Telescope live_grep theme=ivy 38 | nnoremap fh Telescope help_tags 39 | nnoremap fm Telescope man_pages 40 | nnoremap fs Telescope lsp_workspace_symbols 41 | nnoremap fa Telescope lsp_code_actions theme=cursor 42 | 43 | nnoremap fc Telescope git_commits 44 | nnoremap gb Telescope git_branches 45 | ''; 46 | }; 47 | telescope-extensions = with pkgs.vimPlugins; [ 48 | telescope-fzf-native-nvim 49 | ]; 50 | in 51 | { 52 | programs.neovim.plugins = [ telescope ] ++ telescope-extensions; 53 | home.packages = with pkgs; [ fd ripgrep ]; 54 | } 55 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/todo-comments.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | todo-comments = { 5 | plugin = pkgs.vimPlugins.todo-comments-nvim; 6 | config = '' 7 | nnoremap pt TodoQuickFix 8 | lua require('todo-comments').setup{} 9 | ''; 10 | }; 11 | 12 | in 13 | { 14 | programs.neovim.plugins = [ todo-comments ]; 15 | } 16 | -------------------------------------------------------------------------------- /pkgs/editors/nvim/plugins/togglelist.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | togglelist = { 5 | plugin = pkgs.vimPlugins.vim-togglelist; 6 | config = '' 7 | let g:toggle_list_no_mappings = 1 8 | nnoremap