summary refs log tree commit diff stats
path: root/flake/default.nix
blob: 8b8d63434592b11dc282610f1a1d2031ddc5ede6 (plain) (blame)
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
{inputs, ...}: {
  perSystem = {
    config,
    system,
    ...
  }: let
    pkgs = import inputs.nixpkgs {
      inherit system;
      overlays = [inputs.nixvim.overlays.default];
    };
    nixVimConfig =
      (import ../hm/nixvim/config.nix pkgs)
      // {
        colorschemes.gruvbox.enable = true;
        plugins.airline.settings.theme = "minimalist";
      };
    nvim = inputs.nixvim.legacyPackages."${system}".makeNixvim nixVimConfig;
    hooks = inputs.self.checks.${system}.pre-commit;
  in {
    devShells.default = pkgs.mkShell {
      inherit (hooks) shellHook;
      buildInputs = hooks.enabledPackages;
      packages = with pkgs; [
        nil
        statix
        alejandra
        sops
        inputs.ragenix.packages."${system}".default
      ];
    };

    formatter = pkgs.alejandra;

    packages = {
      inherit nvim;
      default = nvim;
    };
    checks = {
      nvim = inputs.nixvim.lib.${system}.check.mkTestDerivationFromNvim {
        inherit nvim;
        name = "My NixVim Configuration";
      };
      pre-commit = inputs.git-hooks.lib.${system}.run {
        src = ./.;
        hooks = {
          alejandra.enable = true;
        };
      };
    };
  };
  flake = {
    nixosConfigurations = import ./nixosConfigurations inputs;
    homeConfigurations."silas" = inputs.home-manager.lib.homeManagerConfiguration {
      pkgs = import inputs.nixpkgs {
        system = "x86_64-linux";
        overlays = [inputs.nixvim.overlays.default];
      };
      modules = [../hm/silas];
      extraSpecialArgs = inputs;
    };
  };
}