From b0fce67f2f51b796993b196e229d2f031cf024a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Thu, 10 Apr 2025 21:35:42 +0200 Subject: [PATCH] disko/tungsten: port config from vanadium --- nix/disko/tungsten/default.nix | 90 ++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 nix/disko/tungsten/default.nix diff --git a/nix/disko/tungsten/default.nix b/nix/disko/tungsten/default.nix new file mode 100644 index 00000000..b8a078eb --- /dev/null +++ b/nix/disko/tungsten/default.nix @@ -0,0 +1,90 @@ +# Adapted from: https://github.com/nix-community/disko/blob/master/example/luks-lvm.nix +{ + disko.devices = { + disk = { + main = { + type = "disk"; + device = throw "change me"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "500M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = ["umask=0077"]; + }; + }; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "crypted"; + extraOpenArgs = []; + settings = { + allowDiscards = true; + }; + content = { + type = "lvm_pv"; + vg = "pool"; + }; + }; + }; + }; + }; + }; + }; + lvm_vg = { + pool = { + type = "lvm_vg"; + lvs = { + root = { + size = "75G"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + mountOptions = ["defaults"]; + }; + }; + nix = { + size = "200G"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/nix"; + mountOptions = ["noatime"]; + }; + }; + swap = { + size = "48G"; # > 32G for hibernation + content = { + type = "swap"; + discardPolicy = "both"; + resumeDevice = true; + }; + }; + home = { + size = "100%FREE"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/home"; + }; + }; + }; + }; + }; + nodev = { + "/tmp" = { + fsType = "tmpfs"; + mountOptions = [ + "size=4G" + ]; + }; + }; + }; +}