From e8119880f308253ed44864bb1b701bf4439b5385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 15 Jul 2024 16:15:56 +0200 Subject: [PATCH] templates/new-clan: share disko configuration between machines --- templates/new-clan/flake.nix | 10 ++--- templates/new-clan/machines/sara/disko.nix | 41 ------------------- .../{machines/jon => modules}/disko.nix | 0 3 files changed, 4 insertions(+), 47 deletions(-) delete mode 100644 templates/new-clan/machines/sara/disko.nix rename templates/new-clan/{machines/jon => modules}/disko.nix (100%) diff --git a/templates/new-clan/flake.nix b/templates/new-clan/flake.nix index 82cd47b2e..155166100 100644 --- a/templates/new-clan/flake.nix +++ b/templates/new-clan/flake.nix @@ -34,6 +34,7 @@ jon = { imports = [ ./modules/shared.nix + ./modules/disko.nix ./machines/jon/configuration.nix ]; @@ -45,9 +46,7 @@ clan.core.networking.targetHost = pkgs.lib.mkDefault "root@jon"; # ssh root@flash-installer.local lsblk --output NAME,ID-LINK,FSTYPE,SIZE,MOUNTPOINT - disko.devices.disk.main = { - device = "/dev/disk/by-id/__CHANGE_ME__"; - }; + disko.devices.disk.main.device = "/dev/disk/by-id/__CHANGE_ME__"; # IMPORTANT! Add your SSH key here # e.g. > cat ~/.ssh/id_ed25519.pub @@ -64,6 +63,7 @@ sara = { imports = [ ./modules/shared.nix + ./modules/disko.nix ./machines/sara/configuration.nix ]; @@ -75,9 +75,7 @@ clan.core.networking.targetHost = pkgs.lib.mkDefault "root@sara"; # ssh root@flash-installer.local lsblk --output NAME,ID-LINK,FSTYPE,SIZE,MOUNTPOINT - disko.devices.disk.main = { - device = "/dev/disk/by-id/__CHANGE_ME__"; - }; + disko.devices.disk.main.device = "/dev/disk/by-id/__CHANGE_ME__"; # IMPORTANT! Add your SSH key here # e.g. > cat ~/.ssh/id_ed25519.pub diff --git a/templates/new-clan/machines/sara/disko.nix b/templates/new-clan/machines/sara/disko.nix deleted file mode 100644 index 7a7509584..000000000 --- a/templates/new-clan/machines/sara/disko.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ lib, ... }: -{ - boot.loader.grub.efiSupport = lib.mkDefault true; - boot.loader.grub.efiInstallAsRemovable = lib.mkDefault true; - disko.devices = { - disk = { - main = { - type = "disk"; - # Set the following in flake.nix for each maschine: - # device = ; - content = { - type = "gpt"; - partitions = { - boot = { - size = "1M"; - type = "EF02"; # for grub MBR - priority = 1; - }; - ESP = { - size = "512M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - }; - root = { - size = "100%"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; - }; - }; - }; - }; - }; - }; -} diff --git a/templates/new-clan/machines/jon/disko.nix b/templates/new-clan/modules/disko.nix similarity index 100% rename from templates/new-clan/machines/jon/disko.nix rename to templates/new-clan/modules/disko.nix