Files
nvim/flake.nix

85 lines
2.5 KiB
Nix
Raw Normal View History

2023-04-02 13:26:27 +03:00
{
description = "NVIM Configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = inputs @ {
self,
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
};
recursiveMerge = attrList: let
f = attrPath:
builtins.zipAttrsWith (n: values:
if pkgs.lib.tail values == []
then pkgs.lib.head values
else if pkgs.lib.all pkgs.lib.isList values
then pkgs.lib.unique (pkgs.lib.concatLists values)
else if pkgs.lib.all pkgs.lib.isAttrs values
then f (attrPath ++ [n]) values
else pkgs.lib.last values);
in
f [] attrList;
in rec {
dependencies = with pkgs;
[
ripgrep
zsh # terminal requires it
git
curl # needed to fetch titles from urls
];
neovim-augmented = recursiveMerge [
pkgs.neovim-unwrapped
{buildInputs = dependencies;}
];
2023-04-02 13:46:42 +03:00
packages.pwnvim = pkgs.wrapNeovim neovim-augmented {
2023-04-02 13:26:27 +03:00
viAlias = true;
vimAlias = true;
withNodeJs = false;
withPython3 = false;
withRuby = false;
extraPython3Packages = false;
extraMakeWrapperArgs = ''--prefix PATH : "${pkgs.lib.makeBinPath dependencies}"'';
# make sure impatient is loaded before everything else to speed things up
configure = {
customRC =
''
lua << EOF
package.path = "${self}/?.lua;" .. package.path
''
+ pkgs.lib.readFile ./init.lua
+ ''
EOF
'';
packages.myPlugins = with pkgs.vimPlugins; {
2023-04-02 14:08:15 +03:00
start = with pkgs.vimPlugins; [
2023-04-02 13:26:27 +03:00
# Common dependencies of other plugins
popup-nvim # dependency of some other plugins
2023-04-02 14:08:15 +03:00
];
2023-04-02 13:26:27 +03:00
opt = with pkgs.vimPlugins; [
# grammar check
vim-grammarous
];
};
};
};
2023-04-02 13:46:42 +03:00
apps.pwnvim = flake-utils.lib.mkApp {
drv = packages.pwnvim;
name = "pwnvim";
2023-04-02 13:26:27 +03:00
exePath = "/bin/nvim";
};
2023-04-02 13:46:42 +03:00
packages.default = packages.pwnvim;
apps.default = apps.pwnvim;
2023-04-02 13:26:27 +03:00
devShell = pkgs.mkShell {
2023-04-02 13:46:42 +03:00
buildInputs = with pkgs; [packages.pwnvim] ++ dependencies;
2023-04-02 13:26:27 +03:00
};
});
}