PortValhalla/lib/modules/os.nix

52 lines
1.5 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-08-23 16:11:48 +00:00
linuxVariant = osVariant.extendModules { };
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 = {};
};
};
}