flocon/modules/options/systemVars.nix
Anthony Rodriguez fc876b2ea5
treewide: update options API
The options API has been updated, in order for a more flexible setup
with `local.modules.desktop.enable` being replaced with an enum of
desktops at `local.systemVars.desktop`, which allows for switching
desktop environments by changing a single option. This is so that we can
switch to cosmic and only enable the programs we need (i.e. disable
greetd because we use cosmic-greeter and enable terminals since that is
desktop related). This is simpler than having a different module per
desktop.
2025-02-06 18:47:01 +01:00

44 lines
860 B
Nix

{
lib,
options,
...
}: let
inherit (lib) mkOption;
inherit (lib.types) enum str;
in {
options.local.systemVars = {
hostName = mkOption {
type = str;
description = ''
hostname for the current host
'';
default = null;
};
username = mkOption {
type = str;
description = ''
username for the home directory
'';
default = "user";
};
desktop = mkOption {
type = enum ["none" "Hyprland" "cosmic"];
default = "none";
description = ''
the desktop environment to be used
'';
};
};
config.assertions = [
{
assertion = options.local.systemVars.hostName.isDefined;
}
{
assertion = options.local.systemVars.username.isDefined;
}
{
assertion = options.local.systemVars.desktop.isDefined;
}
];
}