forked from clan/clan-core
template: use disko module direcly
This commit is contained in:
parent
bfe4f2c8f4
commit
56fad0fd4a
@ -89,6 +89,10 @@ Adding or configuring a new machine requires two simple steps:
|
|||||||
# ...
|
# ...
|
||||||
machines = {
|
machines = {
|
||||||
"jon" = {
|
"jon" = {
|
||||||
|
imports = [
|
||||||
|
# ...
|
||||||
|
./modules/disko.nix
|
||||||
|
];
|
||||||
# ...
|
# ...
|
||||||
|
|
||||||
# Change this to the correct ip-address or hostname
|
# 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>"
|
clan.networking.targetHost = pkgs.lib.mkDefault "root@<hostname>"
|
||||||
|
|
||||||
# Change this to the ID-LINK of the desired disk shown by 'lsblk'
|
# 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__";
|
device = "/dev/disk/by-id/__CHANGE_ME__";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,6 +119,10 @@ Adding or configuring a new machine requires two simple steps:
|
|||||||
# ...
|
# ...
|
||||||
machines = {
|
machines = {
|
||||||
"jon" = {
|
"jon" = {
|
||||||
|
imports = [
|
||||||
|
# ...
|
||||||
|
./modules/disko.nix
|
||||||
|
];
|
||||||
# ...
|
# ...
|
||||||
|
|
||||||
# Change this to the correct ip-address or hostname
|
# 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>"
|
clan.networking.targetHost = pkgs.lib.mkDefault "root@<hostname>"
|
||||||
|
|
||||||
# Change this to the ID-LINK of the desired disk shown by 'lsblk'
|
# 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__";
|
device = "/dev/disk/by-id/__CHANGE_ME__";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,6 +69,7 @@ Below is a guide on how to structure this in your flake.nix:
|
|||||||
jon = {
|
jon = {
|
||||||
imports = [
|
imports = [
|
||||||
./machines/jon/configuration.nix
|
./machines/jon/configuration.nix
|
||||||
|
./modules/disko.nix
|
||||||
# ... more modules
|
# ... more modules
|
||||||
];
|
];
|
||||||
nixpkgs.hostPlatform = "x86_64-linux";
|
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";
|
clan.networking.targetHost = pkgs.lib.mkDefault "root@jon";
|
||||||
|
|
||||||
# remote> lsblk --output NAME,ID-LINK,FSTYPE,SIZE,MOUNTPOINT
|
# remote> lsblk --output NAME,ID-LINK,FSTYPE,SIZE,MOUNTPOINT
|
||||||
clan.diskLayouts.singleDiskExt4 = {
|
disko.devices.disk.main = {
|
||||||
device = "/dev/disk/by-id/nvme-eui.e8238fa6bf530001001b448b4aec2929";
|
device = "/dev/disk/by-id/nvme-eui.e8238fa6bf530001001b448b4aec2929";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
sara = {
|
sara = {
|
||||||
imports = [
|
imports = [
|
||||||
./modules/shared.nix
|
./modules/shared.nix
|
||||||
|
./modules/disko.nix
|
||||||
./machines/sara/configuration.nix
|
./machines/sara/configuration.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -58,7 +59,7 @@
|
|||||||
# local> clan facts generate
|
# local> clan facts generate
|
||||||
|
|
||||||
# remote> lsblk --output NAME,PTUUID,FSTYPE,SIZE,MOUNTPOINT
|
# remote> lsblk --output NAME,PTUUID,FSTYPE,SIZE,MOUNTPOINT
|
||||||
clan.diskLayouts.singleDiskExt4 = {
|
disko.devices.disk.main = {
|
||||||
device = "/dev/disk/by-id/__CHANGE_ME__";
|
device = "/dev/disk/by-id/__CHANGE_ME__";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
37
templates/new-clan/modules/disko.nix
Normal file
37
templates/new-clan/modules/disko.nix
Normal 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 = "/";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user