zaphyra's git: nixfiles

zaphyra's nixfiles

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 
{

  system = "x86_64-linux";
  nixpkgsStable = true;

  id = 5;
  domain = "fc9f.de";

  sshPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH+aZ4jTRDA9Bf9i8UBdGzucahtpDZbjtyaTfR5BE9j4";
  wgPublicKey = "yP1kDJLP4YmHjDLKlOu7bwyd7wCkPHHAx4tY28b/Mms=";

  hardware = {
    cpuVendor = "intel";
    allowHibernation = false;
  };

  networking = {
    ip4IsPrivate = false;
    ip4Address = "152.89.106.158";
    ip4PrefixLength = 22;
    defaultGateway4 = "152.89.104.1";

    ip6IsPrivate = false;
    ip6Address = "2a03:4000:39:e9a::1";
    ip6PrefixLength = 64;
    defaultGateway6 = "fe80::1";

    dn42 = {
      ip6Address = "fd6b:6174:6a61::5";
      ip6PrefixLength = 128;
    };
  };

  nixosConfiguration =
    {
      machineConfig,
      ...
    }:
    {

      sops.secrets = {
        wgPrivateKey = {
          owner = "systemd-network";
          group = "systemd-network";
        };
      };

      common = {
        profiles.netcup.enable = true;
        configure = {
          primaryNetworkInterface.enable = true;
          rootDisk.swap = {
            enable = true;
            size = "2G";
          };
        };
      };

      zpha.profiles = {
        zaphyra.enable = true;
        dn42 = {
          enable = true;
          addresses = [
            "${machineConfig.networking.dn42.ip6Address}/${toString machineConfig.networking.dn42.ip6PrefixLength}"
          ];
        };
      };

    };

}