diff options
Diffstat (limited to 'hosts/skadhi/hw.nix')
| -rw-r--r-- | hosts/skadhi/hw.nix | 67 |
1 files changed, 4 insertions, 63 deletions
diff --git a/hosts/skadhi/hw.nix b/hosts/skadhi/hw.nix index 0eb16b7a..687f04d8 100644 --- a/hosts/skadhi/hw.nix +++ b/hosts/skadhi/hw.nix | |||
| @@ -1,79 +1,20 @@ | |||
| 1 | { flake, flakeInputs, pkgs, config, lib, ... }: | 1 | { flake, flakeInputs, pkgs, config, lib, ... }: |
| 2 | { | 2 | { |
| 3 | imports = with flake.nixosModules.systemProfiles; [ | 3 | imports = [ |
| 4 | flakeInputs.nixos-hardware.nixosModules.framework-13-7040-amd | 4 | flakeInputs.nixos-hardware.nixosModules.framework-13-7040-amd |
| 5 | disko | ||
| 6 | ]; | 5 | ]; |
| 7 | 6 | ||
| 8 | config = { | 7 | config = { |
| 9 | hardware.framework.laptop13.audioEnhancement.enable = true; | 8 | hardware.framework.laptop13.audioEnhancement.enable = false; |
| 9 | hardware.enableRedistributableFirmware = true; | ||
| 10 | services.fstrim.enable = false; | 10 | services.fstrim.enable = false; |
| 11 | 11 | ||
| 12 | services.udev.extraRules = '' | 12 | services.udev.extraRules = '' |
| 13 | ACTION=="add", SUBSYSTEM=="acpi", DRIVERS=="button", ATTRS{hid}=="PNP0C0D", ATTR{power/wakeup}="disabled" | 13 | ACTION=="add", SUBSYSTEM=="platform", DRIVER=="acpi-button", KERNEL=="PNP0C0D:00", ATTR{power/wakeup}="disabled" |
| 14 | ACTION=="add", SUBSYSTEM=="serio", DRIVERS=="atkbd", ATTR{power/wakeup}="disabled" | 14 | ACTION=="add", SUBSYSTEM=="serio", DRIVERS=="atkbd", ATTR{power/wakeup}="disabled" |
| 15 | ACTION=="add", SUBSYSTEM=="i2c", DRIVERS=="i2c_hid_acpi", ATTRS{name}=="PIXA3854:00", ATTR{power/wakeup}="disabled" | 15 | ACTION=="add", SUBSYSTEM=="i2c", DRIVERS=="i2c_hid_acpi", ATTRS{name}=="PIXA3854:00", ATTR{power/wakeup}="disabled" |
| 16 | ''; | 16 | ''; |
| 17 | 17 | ||
| 18 | nixpkgs.system = "x86_64-linux"; | 18 | nixpkgs.system = "x86_64-linux"; |
| 19 | |||
| 20 | disko.devices = { | ||
| 21 | disk.nvm = { | ||
| 22 | type = "disk"; | ||
| 23 | device = "/dev/nvme0n1"; | ||
| 24 | content = { | ||
| 25 | type = "gpt"; | ||
| 26 | partitions = { | ||
| 27 | ESP = { | ||
| 28 | size = "512M"; | ||
| 29 | type = "EF00"; | ||
| 30 | content = { | ||
| 31 | type = "filesystem"; | ||
| 32 | format = "vfat"; | ||
| 33 | mountpoint = "/boot"; | ||
| 34 | mountOptions = [ | ||
| 35 | "fmask=0033" "dmask=0022" | ||
| 36 | ]; | ||
| 37 | }; | ||
| 38 | }; | ||
| 39 | luks = { | ||
| 40 | size = "100%"; | ||
| 41 | content = { | ||
| 42 | type = "luks"; | ||
| 43 | name = "nvm"; | ||
| 44 | extraFormatArgs = [ | ||
| 45 | "--cipher" "aegis128-random" | ||
| 46 | "--key-size" "128" | ||
| 47 | "--integrity" "aead" | ||
| 48 | ]; | ||
| 49 | content = { | ||
| 50 | type = "btrfs"; | ||
| 51 | extraArgs = let | ||
| 52 | subvols = ["/persistent"] ++ map (p: "/persistent/${p}") ["/nix" "/var/log"]; | ||
| 53 | restricted = map (p: "/persistent/${p}") ["/root"]; | ||
| 54 | in [ | ||
| 55 | "--csum" "blake2" | ||
| 56 | "--compress" "zstd:15" | ||
| 57 | "--rootdir" (toString (pkgs.runCommand "rootdir" { | ||
| 58 | } '' | ||
| 59 | mkdir $out | ||
| 60 | install -d ${lib.concatMapStringsSep " " (p: "$out/${p}") subvols} | ||
| 61 | install -m 0700 -d ${lib.concatMapStringsSep " " (p: "$out/${p}") restricted} | ||
| 62 | '')) | ||
| 63 | ] ++ lib.concatMap (p: ["--subvol" p]) subvols; | ||
| 64 | subvolumes = { | ||
| 65 | "/persistent".mountpoint = "/persistent"; | ||
| 66 | "/swap" = { | ||
| 67 | mountpoint = "/.swap"; | ||
| 68 | swap.swapfile.size = "96G"; | ||
| 69 | }; | ||
| 70 | }; | ||
| 71 | }; | ||
| 72 | }; | ||
| 73 | }; | ||
| 74 | }; | ||
| 75 | }; | ||
| 76 | }; | ||
| 77 | }; | ||
| 78 | }; | 19 | }; |
| 79 | } | 20 | } |
