Allow OS specific settings

This commit is contained in:
Manuel Thalmann 2024-08-23 18:11:48 +02:00
parent 46bce1eb16
commit ec1368950e

38
lib/modules/os.nix Normal file
View file

@ -0,0 +1,38 @@
{ lib, ... }:
let
inherit (lib)
mkOption
types
;
in {
options = {
valhalla = mkOption {
type = types.submodule (
{ extendModules, ... }:
let
osVariant = extendModules { };
linuxVariant = osVariant.extendModules { };
windowsVariant = osVariant.extendModules { };
in {
options = {
linux = mkOption {
inherit (linuxVariant) type;
description = "The Linux specific configuration.";
default = {};
visible = "shallow";
};
windows = mkOption {
inherit (windowsVariant) type;
description = "The Windows specific configuration.";
default = {};
visible = "shallow";
};
};
});
description = "Configuration for PortValhalla.";
default = {};
};
};
}