PortValhalla/lib/modules/os.nix

65 lines
1.9 KiB
Nix
Raw Normal View History

2024-08-23 16:11:48 +00:00
{ lib, ... }:
let
inherit (lib)
mkOption
types
;
in {
options = {
valhalla = mkOption {
type = types.submodule (
{ extendModules, ... }:
let
2024-08-25 01:58:28 +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-09-19 22:56:56 +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
windowsVariant = osVariant.extendModules { };
in {
options = {
linux = mkOption {
inherit (linuxVariant) type;
2024-08-23 17:02:06 +00:00
description = "The options for setting up Linux.";
2024-08-23 16:11:48 +00:00
default = {};
visible = "shallow";
};
windows = mkOption {
inherit (windowsVariant) type;
2024-08-23 17:02:06 +00:00
description = "The options for setting up Windows.";
2024-08-23 16:11:48 +00:00
default = {};
visible = "shallow";
};
};
});
description = "Configuration for PortValhalla.";
default = {};
};
};
}