diff options
| author | Isabella Bastaja <isabella@sorre.xyz> | 2026-10-26 17:33:37 +0100 |
|---|---|---|
| committer | Isabella Bastaja <isabella@sorre.xyz> | 2026-10-27 01:27:22 +0100 |
| commit | d144b08349c3f47ff92ec19f527366dbb4bc3f51 (patch) | |
| tree | acd93ac2930c17aa3fd6330be166febf01fc0844 | |
| parent | 82f84cf435dd5cbaf7f650996f97fd9205ed50d3 (diff) | |
enode: add swap partition
| -rw-r--r-- | hosts/enode/default.nix | 8 | ||||
| -rw-r--r-- | hosts/enode/disko.nix | 31 |
2 files changed, 25 insertions, 14 deletions
diff --git a/hosts/enode/default.nix b/hosts/enode/default.nix index d52cd6e..593f291 100644 --- a/hosts/enode/default.nix +++ b/hosts/enode/default.nix @@ -1,7 +1,6 @@ { pkgs, inputs, - modulesPath, ... }: { @@ -11,9 +10,11 @@ ./headscale.nix ./caddy.nix ./disko.nix - "${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix" ]; + # disable local builds of anything, machine doesn't have enough RAM + nix.settings.max-jobs = 0; + services.btrfs.autoScrub = { enable = true; interval = "weekly"; @@ -97,9 +98,6 @@ pkgs.git pkgs.helix ]; - shellAliases = { - rb = "cd /home/isabella/nixos-config && git pull --rebase && sudo nixos-rebuild switch --flake"; - }; }; # This value determines the NixOS release from which the default diff --git a/hosts/enode/disko.nix b/hosts/enode/disko.nix index 2f51ab4..259e805 100644 --- a/hosts/enode/disko.nix +++ b/hosts/enode/disko.nix @@ -1,12 +1,4 @@ let - espPartition = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ - "umask=0077" - ]; - }; rootPartition = { type = "btrfs"; extraArgs = [ "-f" ]; # override existing partition @@ -84,9 +76,30 @@ in label = "boot"; size = "1G"; type = "EF00"; - content = espPartition; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "umask=0077" + ]; + }; + }; + swap = { + priority = 2; + name = "swap"; + label = "swap"; + size = "4G"; + content = { + type = "swap"; + discardPolicy = "both"; + postCreateHook = '' + swapon "$device" + ''; + }; }; root = { + priority = 3; size = "100%"; name = "root"; label = "root"; |
