DEVELOPMENT ENVIRONMENT

~liljamo/nvim-flake

ref: 4ed9178b9dd3269ab18119afa74ea2db858f54ad nvim-flake/flake.nix -rw-r--r-- 1.1 KiB
4ed9178bJonni Liljamo feat(lsp): init 3 months ago
                                                                                
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
{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
    flake-parts.url = "github:hercules-ci/flake-parts";
    nixvim = {
      url = "github:nix-community/nixvim";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = inputs @ {
    self,
    nixpkgs,
    flake-parts,
    nixvim,
  }:
    flake-parts.lib.mkFlake {
      inherit inputs;
    } {
      systems = [
        "x86_64-linux"
      ];

      perSystem = {
        pkgs,
        system,
        ...
      }: let
        nvLib = nixvim.lib.${system};
        nv = nixvim.legacyPackages.${system};
        nvModule = {
          inherit pkgs;
          module = import ./config;
        };
        nvim = nv.makeNixvimWithModule nvModule;
      in {
        checks.default = nvLib.check.mkTestDerivationFromNixvimModule nvModule;
        packages = {
          inherit nvim;
          default = nvim;
        };

        devShells.default = pkgs.mkShell {
          buildInputs = [
            nvim

            pkgs.nil
            pkgs.alejandra
          ];
        };
      };
    };
}