From 8095738a8f62fa50350c471e021995b6d1d02f7c Mon Sep 17 00:00:00 2001 From: Romain Paquet Date: Sun, 25 May 2025 23:23:38 +0200 Subject: [PATCH] move genepi disk to ext4 using clan --- machines/genepi/configuration.nix | 2 + machines/genepi/disko.nix | 66 ++++++++++--------------------- 2 files changed, 22 insertions(+), 46 deletions(-) diff --git a/machines/genepi/configuration.nix b/machines/genepi/configuration.nix index 1c684c3..d373c90 100644 --- a/machines/genepi/configuration.nix +++ b/machines/genepi/configuration.nix @@ -37,6 +37,8 @@ networking.hostName = "genepi"; clan.core.networking.targetHost = "root@genepi.local"; + disko.devices.disk.main.device = "/dev/disk/by-id/ata-WD_Green_M.2_2280_480GB_2251E6411147"; + nix.gc = { automatic = true; dates = "weekly"; diff --git a/machines/genepi/disko.nix b/machines/genepi/disko.nix index 0c1659c..a1249bb 100644 --- a/machines/genepi/disko.nix +++ b/machines/genepi/disko.nix @@ -1,66 +1,40 @@ { + clan-core, + config, + ... +}: +let + suffix = config.clan.core.vars.generators.disk-id.files.diskId.value; +in +{ + imports = [ clan-core.clanModules.disk-id ]; + disko.devices.disk.main = { + name = "main-" + suffix; type = "disk"; - device = "/dev/disk/by-id/ata-WD_Green_M.2_2280_480GB_2251E6411147"; content = { type = "gpt"; partitions = { - ESP = { + boot = { + type = "EF02"; + size = "1M"; priority = 1; - name = "ESP"; - start = "1M"; - end = "512M"; + }; + ESP = { type = "EF00"; + size = "512M"; content = { type = "filesystem"; format = "vfat"; mountpoint = "/boot"; - mountOptions = [ "umask=0077" ]; }; }; root = { end = "-4G"; content = { - type = "btrfs"; - extraArgs = [ - "-L" - "nixos" - "-f" # Override existing partition - ]; - subvolumes = { - "/root" = { - mountpoint = "/"; - mountOptions = [ - "subvol=root" - "compress=zstd" - "noatime" - ]; - }; - "/home" = { - mountpoint = "/home"; - mountOptions = [ - "subvol=home" - "compress=zstd" - "noatime" - ]; - }; - "/nix" = { - mountpoint = "/nix"; - mountOptions = [ - "subvol=nix" - "compress=zstd" - "noatime" - ]; - }; - "/log" = { - mountpoint = "/var/log"; - mountOptions = [ - "subvol=log" - "compress=zstd" - "noatime" - ]; - }; - }; + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; }; }; swap = {