This repository has been archived by the owner on May 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
85 lines (77 loc) · 2.7 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{
description = "A nixvim configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixvim.url = "github:nix-community/nixvim";
nixvim.inputs.nixpkgs.follows = "nixpkgs";
nixvim.inputs.flake-parts.follows = "flake-parts";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-compat = { url = "github:inclyc/flake-compat"; flake = false; };
# NVIM v0.10.0-dev-2873+g8cca78715
neovim = { url = "github:neovim/neovim"; flake = false; };
vimPlugins_nvim-sops = { url = "github:lucidph3nx/nvim-sops"; flake = false; };
};
outputs =
{ nixvim
, nixpkgs
, flake-parts
, neovim
, ...
} @ inputs:
let
nixvimConfig = import ./config; # import the module directly
# all vimPlugins from inputs with prefix "vimPlugins_"
# example:
# inputs.vimPlugins_myvim-plugins-from-github.url = "github:owner/repo";
# inputs.vimPlugins_myvim-plugins-from-github.flake = false;
mkFlake2VimPlugins = import ./nix/lib/mkFlake2VimPlugin.nix inputs;
in
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
perSystem =
{ pkgs
, system
, ...
}:
{
_module.args.pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
(_final: prev: {
nvim = nixvim.legacyPackages.${system}.makeNixvimWithModule {
inherit pkgs;
module = nixvimConfig;
# You can use `extraSpecialArgs` to pass additional arguments to your module files
# extraSpecialArgs = { # inherit (inputs) foo; };
};
neovim-unwrapped = prev.neovim-unwrapped.overrideAttrs (_: { version = "0.10.0-dev-2873"; src = neovim; });
vimPlugins = prev.vimPlugins.extend (_final: _prev:
mkFlake2VimPlugins {
buildVimPlugin = prev.vimUtils.buildVimPlugin;
lib = prev.lib;
}
);
})
];
};
checks = {
# Run `nix flake check .` to verify that your config is not broken
default = nixvim.lib.${system}.check.mkTestDerivationFromNvim {
inherit (pkgs) nvim;
name = "A nixvim configuration";
};
};
devShells.default = pkgs.mkShell { packages = [ pkgs.nvim ]; };
packages = {
# Lets you run `nix run .` to start nixvim
default = pkgs.nvim;
};
};
};
}