summary refs log tree commit diff
path: root/hosts/default.nix
blob: 164030cd3a26c61bf456d5c77c70ee22399f8ced (plain)
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
inputs: let
  commonProfiles = [
    {
      imports = [
        ../profiles/nix.nix
        ../profiles/tzlil.nix
        ../profiles/security.nix
        ../profiles/ssh.nix
        ../profiles/network.nix
	../profiles/impermanence.nix
      ];
    }
    inputs.agenix.nixosModules.age
  ];

  commonHome = [
    inputs.home-manager.nixosModule
    {
      home-manager = {
        useGlobalPkgs = true;
        extraSpecialArgs = {inherit inputs;};
      };
    }
  ];

  nixinate = host: {
    _module.args.nixinate = {
      inherit host;
      sshUser = "tzlil";
      buildOn = "remote"; # valid args are "local" or "remote"
      substituteOnTarget = true; # if buildOn is "local" then it will substitute on the target, "-s"
      hermetic = false;
    };
  };
in {
  navi = inputs.nixpkgs.lib.nixosSystem {
    system = "x86_64-linux";
    specialArgs = {inherit inputs;};
    modules =
      [
        "${inputs.self}/hosts/navi"
        {networking.hostName = "navi";}
        (nixinate "navi")
      ]
      ++ commonProfiles
      ++ commonHome;
  };
}