diff options
Diffstat (limited to 'hosts/skadhi/hw.nix')
| -rw-r--r-- | hosts/skadhi/hw.nix | 72 |
1 files changed, 72 insertions, 0 deletions
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 | } | ||
