summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2026-09-22 14:43:25 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2026-09-22 14:43:25 +0200
commit037bee53a4e719ba3ed4ccc48b3c6a2edc52b883 (patch)
tree94758735d079c299cffb9caefb6a653f6394129e
parent9df93d51af39f242a00c3ae598ad55e17ab91f69 (diff)
downloadnixos-037bee53a4e719ba3ed4ccc48b3c6a2edc52b883.tar
nixos-037bee53a4e719ba3ed4ccc48b3c6a2edc52b883.tar.gz
nixos-037bee53a4e719ba3ed4ccc48b3c6a2edc52b883.tar.bz2
nixos-037bee53a4e719ba3ed4ccc48b3c6a2edc52b883.tar.xz
nixos-037bee53a4e719ba3ed4ccc48b3c6a2edc52b883.zip
skadhi: initial commit
-rw-r--r--accounts/gkleen@skadhi/default.nix24
-rw-r--r--accounts/root@skadhi.nix10
-rw-r--r--flake.lock22
-rw-r--r--flake.nix4
-rw-r--r--hosts/sif/default.nix6
-rw-r--r--hosts/skadhi/default.nix87
-rw-r--r--hosts/skadhi/hw.nix72
-rw-r--r--system-profiles/disko.nix5
-rw-r--r--system-profiles/networkmanager.nix14
-rw-r--r--users/gkleen/default.nix2
10 files changed, 233 insertions, 13 deletions
diff --git a/accounts/gkleen@skadhi/default.nix b/accounts/gkleen@skadhi/default.nix
new file mode 100644
index 00000000..97faf86c
--- /dev/null
+++ b/accounts/gkleen@skadhi/default.nix
@@ -0,0 +1,24 @@
1{ flake, userName, config, lib, ... }:
2let
3 user = config.users.users.${userName};
4in {
5 imports = with flake.nixosModules.userProfiles.${userName}; [
6 zsh
7 ];
8
9 config = {
10 users.users.gkleen.group = "gkleen";
11 users.groups.gkleen = {};
12 systemd.tmpfiles.settings.home-directories.${user.home} = lib.mkForce {
13 v = {
14 mode = user.homeMode;
15 user = user.name;
16 inherit (user) group;
17 };
18 };
19
20 home-manager.users.${userName} = {
21 home.stateVersion = "26.05";
22 };
23 };
24}
diff --git a/accounts/root@skadhi.nix b/accounts/root@skadhi.nix
new file mode 100644
index 00000000..425d9a04
--- /dev/null
+++ b/accounts/root@skadhi.nix
@@ -0,0 +1,10 @@
1{ flake, userName, ... }:
2{
3 imports = with flake.nixosModules.userProfiles.${userName}; [
4 zsh
5 ];
6
7 config.home-manager.users.${userName} = {
8 home.stateVersion = "26.05";
9 };
10}
diff --git a/flake.lock b/flake.lock
index 27cc7f81..9d71635e 100644
--- a/flake.lock
+++ b/flake.lock
@@ -105,6 +105,27 @@
105 "type": "github" 105 "type": "github"
106 } 106 }
107 }, 107 },
108 "disko": {
109 "inputs": {
110 "nixpkgs": [
111 "nixpkgs"
112 ]
113 },
114 "locked": {
115 "lastModified": 1768920986,
116 "narHash": "sha256-CNzzBsRhq7gg4BMBuTDObiWDH/rFYHEuDRVOwCcwXw4=",
117 "owner": "nix-community",
118 "repo": "disko",
119 "rev": "de5708739256238fb912c62f03988815db89ec9a",
120 "type": "github"
121 },
122 "original": {
123 "owner": "nix-community",
124 "ref": "latest",
125 "repo": "disko",
126 "type": "github"
127 }
128 },
108 "flake-compat": { 129 "flake-compat": {
109 "flake": false, 130 "flake": false,
110 "locked": { 131 "locked": {
@@ -1312,6 +1333,7 @@
1312 "backup-utils": "backup-utils", 1333 "backup-utils": "backup-utils",
1313 "ca-util": "ca-util", 1334 "ca-util": "ca-util",
1314 "deploy-rs": "deploy-rs", 1335 "deploy-rs": "deploy-rs",
1336 "disko": "disko",
1315 "flake-compat": "flake-compat_3", 1337 "flake-compat": "flake-compat_3",
1316 "flake-registry": "flake-registry", 1338 "flake-registry": "flake-registry",
1317 "flake-utils": "flake-utils", 1339 "flake-utils": "flake-utils",
diff --git a/flake.nix b/flake.nix
index 421bb2c8..f69dd773 100644
--- a/flake.nix
+++ b/flake.nix
@@ -246,6 +246,10 @@
246 flake-utils.follows = "flake-utils"; 246 flake-utils.follows = "flake-utils";
247 }; 247 };
248 }; 248 };
249 disko = {
250 url = "github:nix-community/disko/latest";
251 inputs.nixpkgs.follows = "nixpkgs";
252 };
249 }; 253 };
250 254
251 outputs = { self, nixpkgs, home-manager, sops-nix, deploy-rs, nvfetcher, niri-flake, ... }@inputs: 255 outputs = { self, nixpkgs, home-manager, sops-nix, deploy-rs, nvfetcher, niri-flake, ... }@inputs:
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}
diff --git a/system-profiles/disko.nix b/system-profiles/disko.nix
new file mode 100644
index 00000000..52e1f003
--- /dev/null
+++ b/system-profiles/disko.nix
@@ -0,0 +1,5 @@
1{ flakeInputs, ... }: {
2 imports = [
3 flakeInputs.disko.nixosModules.disko
4 ];
5}
diff --git a/system-profiles/networkmanager.nix b/system-profiles/networkmanager.nix
index 7ffd688a..3c6cb24e 100644
--- a/system-profiles/networkmanager.nix
+++ b/system-profiles/networkmanager.nix
@@ -1,21 +1,23 @@
1{ config, lib, ... }: 1{ config, pkgs, lib, ... }:
2
3with lib;
4
5{ 2{
6 config = { 3 config = {
7 networking = { 4 networking = {
8 networkmanager = { 5 networkmanager = {
9 enable = true; 6 enable = true;
10 dhcp = "internal"; 7 dhcp = "internal";
11 dns = mkForce "dnsmasq"; 8 dns = lib.mkForce "dnsmasq";
12 logLevel = "INFO"; 9 logLevel = "INFO";
13 settings.connectivity.uri = "https://online.yggdrasil.li"; 10 settings.connectivity.uri = "https://online.yggdrasil.li";
14 }; 11 };
15 }; 12 };
16 13
14 environment.etc."NetworkManager/dnsmasq.d/dnssec.conf".text = ''
15 conf-file=${pkgs.dnsmasq}/share/dnsmasq/trust-anchors.conf
16 dnssec
17 '';
18
17 systemd.services."NetworkManager-wait-online".enable = false; 19 systemd.services."NetworkManager-wait-online".enable = false;
18 systemd.services."systemd-networkd-wait-online".enable = mkForce false; 20 systemd.services."systemd-networkd-wait-online".enable = lib.mkForce false;
19 21
20 services.resolved.enable = false; 22 services.resolved.enable = false;
21 }; 23 };
diff --git a/users/gkleen/default.nix b/users/gkleen/default.nix
index 9f606ea4..9aa3b632 100644
--- a/users/gkleen/default.nix
+++ b/users/gkleen/default.nix
@@ -8,7 +8,7 @@ in {
8 8
9 users.users.${userName} = { 9 users.users.${userName} = {
10 description = "Gregor Kleen"; 10 description = "Gregor Kleen";
11 extraGroups = [ "wheel" "networkmanager" "lp" "dialout" "audio" "video" "xmpp" "mail" "ssh" "vboxusers" "libvirtd" "wireshark" "games" "webdav"]; 11 extraGroups = [ "users" "wheel" "networkmanager" "lp" "dialout" "audio" "video" "xmpp" "mail" "ssh" "vboxusers" "libvirtd" "wireshark" "games" "webdav"];
12 createHome = true; 12 createHome = true;
13 home = "/home/${userName}"; 13 home = "/home/${userName}";
14 shell = "${pkgs.zsh}/bin/zsh"; 14 shell = "${pkgs.zsh}/bin/zsh";