create module for disk configuration
This commit is contained in:
parent
8a7c1ba6a9
commit
04e9ce3abb
4 changed files with 52 additions and 72 deletions
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
imports = [ ./terraform-database.nix ./data-disk.nix ./ssh-certificates.nix ./k3s ];
|
||||
imports = [ ./terraform-database.nix ./data-disk.nix ./ssh-certificates.nix ./k3s ./disko.nix ];
|
||||
}
|
||||
|
|
43
modules/custom/disko.nix
Normal file
43
modules/custom/disko.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{ lib, config, ... }:
|
||||
let cfg = config.custom.disko;
|
||||
in {
|
||||
options = {
|
||||
custom = {
|
||||
disko.osDiskDevice = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
The disk device to be used for the operating system.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# TODO: rename this to 'osDisk'. Unfortunately, we would need to run nixos-anywhere again then
|
||||
config.disko.devices.disk.vdb = {
|
||||
device = cfg.osDiskDevice;
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
type = "EF00";
|
||||
size = "500M";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
};
|
||||
root = {
|
||||
end = "-4G";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "btrfs";
|
||||
mountpoint = "/";
|
||||
};
|
||||
};
|
||||
swap = { size = "100%"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Reference in a new issue