aboutsummaryrefslogtreecommitdiff
path: root/hosts/mercury/nixos.nix
blob: ff386cd1389ce9fa5d21c56128a099540f35be67 (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
49
50
51
52
{
  inputs,
  hosts,
  lib,
  ...
}: {
  imports = [
    ./disks.nix
    ./battery.nix

    ./wireguard.nix
    ./networking.nix

    inputs.nixos-facter-modules.nixosModules.facter
    inputs.lanzaboote.nixosModules.lanzaboote
  ];
  facter.reportPath = ./facter.json;

  services.upower.enable = true;

  programs.ssh.extraConfig =
    hosts
    |> (lib.mapAttrsToList (hostname: hostAttrs:
      if hostAttrs ? ip
      then ''
        Host ${hostname}
          ${
          if hostAttrs ? jump
          then "ProxyJump ${hostAttrs.jump}"
          else ""
        }
          HostName ${hostAttrs.ip}
      ''
      else ""))
    |> (builtins.filter (s: s != ""))
    |> (lib.concatStringsSep "\n");

  programs.kdeconnect.enable = true;

  security.pki.certificates = [
    hosts.ganymede.caddy-root-ca
  ];

  # get perl out of my closure
  system = {
    etc.overlay.enable = true;
    nixos-init.enable = true;
  };

  # required for vm testing
  virtualisation.vmVariant.virtualisation.diskSize = 8192;
}