about summary refs log tree commit diff
path: root/nix/default.nix
blob: 8b46c580e1ba75bbe091f3e34db37b4a74017b26 (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
{ inputs }:

{
  mkSystem =
    { hostname
    , system
    }:
    inputs.nixpkgs.lib.nixosSystem {
      inherit system;
      specialArgs = {
        inherit inputs system hostname;
      };
      modules = [
        ../modules
        ../hosts/${hostname}
        ./private-wireguard.nix
        {
          networking.hostName = hostname;
          nixpkgs = {
            config.allowUnfree = true;
            overlays = [
              inputs.emacs-overlay.overlay
              inputs.nur.overlay
              (final: prev: {
                tools = {
                  gerrit-hook = import ../tools/gerrit-hook final;
                };
              })
            ];
          };
          # Add each input as a registry
          nix.registry = inputs.nixpkgs.lib.mapAttrs'
            (n: v:
              inputs.nixpkgs.lib.nameValuePair (n) ({ flake = v; }))
            inputs;
        }
      ];
    };
}