diff options
author | Cody Hiar <cody@hiar.ca> | 2022-06-08 20:07:46 -0600 |
---|---|---|
committer | Cody Hiar <cody@hiar.ca> | 2022-06-08 20:07:46 -0600 |
commit | 398d05b2d8558557da753d1adef03803d4294add (patch) | |
tree | 42005ee5227434a49bdd7d608cbfeadb9d758b80 /flake.nix | |
parent | 835b02c0b3679edbab296cc5823f87145632289b (diff) |
Get config and plugins into flake
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 73 |
1 files changed, 67 insertions, 6 deletions
@@ -3,9 +3,13 @@ inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; + vim-angry-reviewer = { + url = "github:anufrievroman/vim-angry-reviewer"; + flake = false; + }; }; - outputs = { self, nixpkgs }: + outputs = { self, nixpkgs, ... }@inputs: let system = "x86_64-linux"; pkgs = import nixpkgs { @@ -20,10 +24,9 @@ }; in rec { # For nix < 2.7 - # For nix >= 2.7 they should grab from: + # For nix >= 2.7 they should grab automatically from: # apps.${system}.default # packages.${system}.default - # automatically defaultApp.${system} = apps.${system}.default; defaultPackage.${system} = packages.${system}.default; @@ -34,15 +37,73 @@ }; default = nvim; }; - packages.${system} = with pkgs; rec { + # Read the init.lua from the repo. + initfile = pkgs.lib.readFile ./init.lua; + packages.${system} = with pkgs; let + # Vim angry reviewer wasn't packaged when I build this. Easy enough to + # package myself. + vim-angry-reviewer = vimUtils.buildVimPluginFrom2Nix { + pname = "vim-angry-reviewer"; + version = "HEAD"; + src = inputs.vim-angry-reviewer; + }; + # My custom neovim with my init file and all the plugins I use. + myneovim = (neovim.override { + configure = { + customRC = '' + lua << EOF + ${initfile} + EOF + ''; + packages.myPlugins = with vimPlugins; { + start = [ + # Colorscheme + nord-nvim + + # Syntax coloring + nvim-ts-rainbow + (nvim-treesitter.withPlugins (plugins: tree-sitter.allGrammars)) + + # Autocompletes + nvim-lspconfig + nvim-cmp + cmp-nvim-lsp + completion-nvim + + # File navigation + lf-vim + vim-floaterm + + # The rest + vim-commentary + vim-surround + vim-repeat + fzf-vim + vim-argwrap + vim-fugitive + indent-blankline-nvim + camelcasemotion + hop-nvim + ale + goyo-vim + vim-oscyank + ack-vim + vim-angry-reviewer + ]; + }; + }; + }); + in + rec { default = neovimCH; neovimCH = symlinkJoin { name = "neovim"; - paths = [ pkgs.neovim ]; + paths = [ myneovim ]; buildInputs = [ pkgs.makeWrapper ]; postBuild = with pkgs; '' rm $out/bin/nvim BINPATH=${lib.makeBinPath [ + gcc nodejs mypython pyright @@ -52,7 +113,7 @@ shellcheck hadolint ]} - makeWrapper ${neovim}/bin/nvim $out/bin/nvim --prefix PATH : $BINPATH + makeWrapper ${myneovim}/bin/nvim $out/bin/nvim --prefix PATH : $BINPATH ''; }; }; |