summaryrefslogtreecommitdiff
path: root/hosts/skadhi/default.nix
blob: 87d1e3134f33977b091891402b2b80b45e13fe43 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{ flake, flakeInputs, pkgs, config, lib, ... }:
{
  imports = with flake.nixosModules.systemProfiles; [
    ./hw.nix
    tmpfs-root default-locale openssh niri-unstable networkmanager lanzaboote zswap
    flakeInputs.nixVirt.nixosModules.default
  ];

  config = {
    system.stateVersion = "26.05";

    fileSystems."/persistent".neededForBoot = true;
    environment.persistence."/persistent" = {
      hideMounts = true;
      directories = [
        "/nix"
        "/root"
        "/var/log"
        "/var/lib/nixos"
        "/var/lib/sops-nix"
        "/var/lib/systemd"
      ];
      timezone = true;
    };

    boot = {
      initrd.systemd = {
        emergencyAccess = config.users.users.root.hashedPassword;
        extraBin = {
          "vim" = lib.getExe pkgs.vim;
          "grep" = lib.getExe pkgs.gnugrep;
        };
      };

      lanzaboote.configurationLimit = 15;
      loader = {
        efi.canTouchEfiVariables = true;
        timeout = null;
      };

      plymouth.enable = true;

      kernelPackages = pkgs.linuxPackages_7_2;
      consoleLogLevel = 3;
      kernelParams = [
        "quiet"
        "boot.shell_on_fail"
        "udev.log_priority=3"
        "rd.systemd.show_status=auto"
        "plymouth.use-simpledrm"
      ];

      tmp.useTmpfs = true;
    };

    services.timesyncd.enable = false;
    services.chrony = {
      enable = true;
      enableNTS = true;
      servers = [];
      extraConfig = ''
        pool time.cloudflare.com iburst nts
        pool nts.netnod.se prefer iburst nts
        server ptbtime1.ptb.de prefer iburst nts
        server ptbtime2.ptb.de prefer iburst nts
        server ptbtime3.ptb.de prefer iburst nts
        server ptbtime4.ptb.de prefer iburst nts
        pool ntppool1.time.nl prefer iburst nts
        pool ntppool2.time.nl prefer iburst nts

        authselectmode require
        minsources 3

        nocerttimecheck 1

        leapsectz right/UTC

        makestep 0.1 3

        cmdport 0
      '';
    };

    services.userborn.importLegacyState = false;
  };
}