From 8b7f2f3ea49c086d29e5dd5e52077d0ea530b085 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Fri, 23 Aug 2024 18:11:48 +0200 Subject: [PATCH] Allow OS specific settings --- lib/modules/os.nix | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 lib/modules/os.nix diff --git a/lib/modules/os.nix b/lib/modules/os.nix new file mode 100644 index 00000000..15783edf --- /dev/null +++ b/lib/modules/os.nix @@ -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 = {}; + }; + }; + } \ No newline at end of file