make storage.osDisk optional

This commit is contained in:
Pim Kunis 2024-02-29 20:59:48 +01:00
parent 0fe9aef9f5
commit 317ad27b2a
2 changed files with 2 additions and 9 deletions

View file

@ -3,12 +3,5 @@
kind = "physical";
arch = "aarch64-linux";
isRaspberryPi = true;
nixosModule.lab = {
# TODO: can we do this differently?
storage = {
osDisk = "/dev/sda";
};
};
};
}

View file

@ -3,7 +3,7 @@ let cfg = config.lab.storage;
in {
options.lab.storage = {
osDisk = lib.mkOption {
type = lib.types.str;
type = with lib.types; nullOr str;
description = ''
The disk to be used for the machine's operating system.
'';
@ -40,8 +40,8 @@ in {
})
];
# TODO: Rename this to 'osDisk'. Unfortunately, we would need to run nixos-anywhere again then.
disko = lib.mkIf machine.isHypervisor {
# TODO: Rename this to 'osDisk'. Unfortunately, we would need to run nixos-anywhere again then.
devices.disk.vdb = {
device = cfg.osDisk;
type = "disk";