PortValhalla/lib/modules/os.nix

64 lines
1.7 KiB
Nix
Raw Normal View History

2024-08-23 16:11:48 +00:00
{ lib, ... }:
2024-10-06 19:25:34 +00:00
let inherit (lib) mkOption types;
in {
options = {
valhalla = mkOption {
type = types.submodule (
2024-11-29 00:13:58 +00:00
{ extendModules, ... }:
let
2024-10-06 19:25:34 +00:00
osVariant = extendModules {
modules = [
({ config, ... }: {
options = {
config = mkOption {
type = types.attrs;
description = "The configuration of the Operating System.";
default = builtins.removeAttrs config [ "_module" "config" "linux" "windows" ];
visible = false;
};
2024-08-23 16:11:48 +00:00
};
2024-10-06 19:25:34 +00:00
})
];
};
2024-08-23 16:11:48 +00:00
2024-10-06 19:25:34 +00:00
linuxVariant = osVariant.extendModules {
modules = [
({ ... }: {
options = {
secureBoot = mkOption {
type = types.bool;
description = "A value indicating whether the system supports Secure Boot.";
default = false;
};
2024-08-23 16:11:48 +00:00
};
2024-10-06 19:25:34 +00:00
})
];
};
windowsVariant = osVariant.extendModules { };
2024-11-29 00:13:58 +00:00
in
{
2024-10-06 19:25:34 +00:00
options = {
linux = mkOption {
inherit (linuxVariant) type;
description = "The options for setting up Linux.";
default = { };
visible = "shallow";
};
windows = mkOption {
inherit (windowsVariant) type;
description = "The options for setting up Windows.";
default = { };
visible = "shallow";
};
};
2024-11-29 00:13:58 +00:00
}
);
2024-08-23 16:11:48 +00:00
2024-10-06 19:25:34 +00:00
description = "Configuration for PortValhalla.";
default = { };
2024-08-23 16:11:48 +00:00
};
2024-10-06 19:25:34 +00:00
};
}