summaryrefslogtreecommitdiff
path: root/hosts
diff options
context:
space:
mode:
Diffstat (limited to 'hosts')
-rw-r--r--hosts/sif/default.nix6
-rw-r--r--hosts/skadhi/default.nix87
-rw-r--r--hosts/skadhi/hw.nix72
3 files changed, 159 insertions, 6 deletions
diff --git a/hosts/sif/default.nix b/hosts/sif/default.nix
index 6e5571b5..5ea9dfd2 100644
--- a/hosts/sif/default.nix
+++ b/hosts/sif/default.nix
@@ -122,12 +122,6 @@ in {
122 useNetworkd = true; 122 useNetworkd = true;
123 }; 123 };
124 124
125 environment.etc."NetworkManager/dnsmasq.d/dnssec.conf" = {
126 text = ''
127 conf-file=${pkgs.dnsmasq}/share/dnsmasq/trust-anchors.conf
128 dnssec
129 '';
130 };
131 environment.etc."NetworkManager/dnsmasq.d/libvirt_dnsmasq.conf" = { 125 environment.etc."NetworkManager/dnsmasq.d/libvirt_dnsmasq.conf" = {
132 text = '' 126 text = ''
133 except-interface=virbr0 127 except-interface=virbr0
diff --git a/hosts/skadhi/default.nix b/hosts/skadhi/default.nix
new file mode 100644
index 00000000..e9d5cc59
--- /dev/null
+++ b/hosts/skadhi/default.nix
@@ -0,0 +1,87 @@
1{ flake, flakeInputs, pkgs, config, lib, ... }:
2{
3 imports = with flake.nixosModules.systemProfiles; [
4 ./hw.nix
5 tmpfs-root default-locale openssh niri-unstable networkmanager lanzaboote zswap
6 flakeInputs.nixVirt.nixosModules.default
7 ];
8
9 config = {
10 system.stateVersion = "26.05";
11
12 fileSystems."/persistent".neededForBoot = true;
13 environment.persistence."/persistent" = {
14 hideMounts = true;
15 directories = [
16 "/nix"
17 "/root"
18 "/home"
19 "/var/log"
20 "/var/lib/nixos"
21 "/var/lib/sops-nix"
22 "/var/lib/systemd"
23 ];
24 timezone = true;
25 };
26
27 boot = {
28 initrd.systemd = {
29 emergencyAccess = config.users.users.root.hashedPassword;
30 extraBin = {
31 "vim" = lib.getExe pkgs.vim;
32 "grep" = lib.getExe pkgs.gnugrep;
33 };
34 };
35
36 lanzaboote.configurationLimit = 15;
37 loader = {
38 efi.canTouchEfiVariables = true;
39 timeout = null;
40 };
41
42 plymouth.enable = true;
43
44 kernelPackages = pkgs.linuxPackages_7_2;
45 consoleLogLevel = 3;
46 kernelParams = [
47 "quiet"
48 "boot.shell_on_fail"
49 "udev.log_priority=3"
50 "rd.systemd.show_status=auto"
51 "plymouth.use-simpledrm"
52 ];
53
54 tmp.useTmpfs = true;
55 };
56
57 services.timesyncd.enable = false;
58 services.chrony = {
59 enable = true;
60 enableNTS = true;
61 servers = [];
62 extraConfig = ''
63 pool time.cloudflare.com iburst nts
64 pool nts.netnod.se prefer iburst nts
65 server ptbtime1.ptb.de prefer iburst nts
66 server ptbtime2.ptb.de prefer iburst nts
67 server ptbtime3.ptb.de prefer iburst nts
68 server ptbtime4.ptb.de prefer iburst nts
69 pool ntppool1.time.nl prefer iburst nts
70 pool ntppool2.time.nl prefer iburst nts
71
72 authselectmode require
73 minsources 3
74
75 nocerttimecheck 1
76
77 leapsectz right/UTC
78
79 makestep 0.1 3
80
81 cmdport 0
82 '';
83 };
84
85 services.userborn.importLegacyState = false;
86 };
87}
diff --git a/hosts/skadhi/hw.nix b/hosts/skadhi/hw.nix
new file mode 100644
index 00000000..b95fc24c
--- /dev/null
+++ b/hosts/skadhi/hw.nix
@@ -0,0 +1,72 @@
1{ flake, flakeInputs, pkgs, config, lib, ... }:
2{
3 imports = with flake.nixosModules.systemProfiles; [
4 flakeInputs.nixos-hardware.nixosModules.framework-13-7040-amd
5 disko
6 ];
7
8 config = {
9 hardware.framework.laptop13.audioEnhancement.enable = true;
10 services.fstrim.enable = false;
11
12 nixpkgs.system = "x86_64-linux";
13
14 disko.devices = {
15 disk.nvm = {
16 type = "disk";
17 device = "/dev/nvm0n1";
18 content = {
19 type = "gpt";
20 partitions = {
21 ESP = {
22 size = "512M";
23 type = "EF00";
24 content = {
25 type = "filesystem";
26 format = "vfat";
27 mountpoint = "/boot";
28 mountOptions = [
29 "fmask=0033" "dmask=0022"
30 ];
31 };
32 };
33 luks = {
34 size = "100%";
35 content = {
36 type = "luks";
37 name = "nvm";
38 extraFormatArgs = [
39 "--cipher" "aegis128-random"
40 "--key-size" "128"
41 "--integrity" "aead"
42 ];
43 content = {
44 type = "btrfs";
45 extraArgs = let
46 subvols = ["/persistent"] ++ map (p: "/persistent/${p}") ["/nix" "/home" "/var/log"];
47 restricted = map (p: "/persistent/${p}") ["/root"];
48 in [
49 "--csum" "blake2"
50 "--compress" "zstd:15"
51 "--rootdir" (pkgs.runCommand "rootdir" {
52 } ''
53 install -d ${lib.escapeShellArgs (map (p: "$out/${p}") subvols)}
54 install -m 0700 -d ${lib.escapeShellArgs (map (p: "$out/${p}") restricted)}
55 '')
56 ] ++ lib.concatMap (p: ["--subvol" p]) subvols;
57 subvolumes = {
58 "/persistent".mountpoint = "/persistent";
59 "/swap" = {
60 mountpoint = "/.swap";
61 swap.swapfile.size = "96G";
62 };
63 };
64 };
65 };
66 };
67 };
68 };
69 };
70 };
71 };
72}