template: use disko module direcly
All checks were successful
checks / checks (pull_request) Successful in 2m13s
checks / checks-impure (pull_request) Successful in 1m56s

This commit is contained in:
Johannes Kirschbauer 2024-04-30 19:16:13 +02:00
parent bfe4f2c8f4
commit 56fad0fd4a
Signed by: hsjobeki
SSH Key Fingerprint: SHA256:vX3utDqig7Ph5L0JPv87ZTPb/w7cMzREKVZzzLFg9qU
4 changed files with 51 additions and 4 deletions

View File

@ -89,6 +89,10 @@ Adding or configuring a new machine requires two simple steps:
# ...
machines = {
"jon" = {
imports = [
# ...
./modules/disko.nix
];
# ...
# Change this to the correct ip-address or hostname
@ -96,7 +100,7 @@ Adding or configuring a new machine requires two simple steps:
clan.networking.targetHost = pkgs.lib.mkDefault "root@<hostname>"
# Change this to the ID-LINK of the desired disk shown by 'lsblk'
clan.diskLayouts.singleDiskExt4 = {
disko.devices.disk.main = {
device = "/dev/disk/by-id/__CHANGE_ME__";
}
@ -115,6 +119,10 @@ Adding or configuring a new machine requires two simple steps:
# ...
machines = {
"jon" = {
imports = [
# ...
./modules/disko.nix
];
# ...
# Change this to the correct ip-address or hostname
@ -122,7 +130,7 @@ Adding or configuring a new machine requires two simple steps:
clan.networking.targetHost = pkgs.lib.mkDefault "root@<hostname>"
# Change this to the ID-LINK of the desired disk shown by 'lsblk'
clan.diskLayouts.singleDiskExt4 = {
disko.devices.disk.main = {
device = "/dev/disk/by-id/__CHANGE_ME__";
}

View File

@ -69,6 +69,7 @@ Below is a guide on how to structure this in your flake.nix:
jon = {
imports = [
./machines/jon/configuration.nix
./modules/disko.nix
# ... more modules
];
nixpkgs.hostPlatform = "x86_64-linux";
@ -78,7 +79,7 @@ Below is a guide on how to structure this in your flake.nix:
clan.networking.targetHost = pkgs.lib.mkDefault "root@jon";
# remote> lsblk --output NAME,ID-LINK,FSTYPE,SIZE,MOUNTPOINT
clan.diskLayouts.singleDiskExt4 = {
disko.devices.disk.main = {
device = "/dev/disk/by-id/nvme-eui.e8238fa6bf530001001b448b4aec2929";
};

View File

@ -45,6 +45,7 @@
sara = {
imports = [
./modules/shared.nix
./modules/disko.nix
./machines/sara/configuration.nix
];
@ -58,7 +59,7 @@
# local> clan facts generate
# remote> lsblk --output NAME,PTUUID,FSTYPE,SIZE,MOUNTPOINT
clan.diskLayouts.singleDiskExt4 = {
disko.devices.disk.main = {
device = "/dev/disk/by-id/__CHANGE_ME__";
};

View File

@ -0,0 +1,37 @@
{
disko.devices = {
disk = {
main = {
type = "disk";
# Set the following in flake.nix for each maschine:
# device = <uuid>;
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02"; # for grub MBR
};
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
};
};
}