nichts/modules/options/system/options.mod.nix

84 lines
2.4 KiB
Nix

{
config,
lib,
...
}: let
inherit (builtins) elemAt;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) enum listOf str nullOr bool;
inherit (lib.lists) elem;
inherit (config.modules.system) systemType;
in {
options.modules.system = {
users = mkOption {
type = listOf str;
default = ["cr"];
description = "A list of users on the system.";
};
autoLogin = mkOption {
type = bool;
default = false;
description = ''
Whether to enable passwordless login. This is generally useful on systems with
FDE (Full Disk Encryption) enabled. It is a security risk for systems without FDE.
'';
};
systemType = mkOption {
type = nullOr (enum ["desktop" "laptop" "server"]);
default = null;
description = ''
The type of the current system. This is used to determine whether things like graphical
environments and power-saving programs should be installed or not.
'';
};
isGraphical = mkOption {
type = bool;
default = elem systemType ["desktop" "laptop"];
description = ''
Whether the current system is a graphical system.
'';
};
yubikeySupport = {
enable = mkEnableOption "yubikey support";
deviceType = mkOption {
type = nullOr (enum ["NFC5" "nano"]);
default = null;
description = "A list of device models to enable Yubikey support for";
};
};
sound = {
enable = mkEnableOption "sound related programs and audio-dependent programs";
};
impermanence = {
enable = mkEnableOption "Enable Impermanence";
};
video = {
enable = mkEnableOption "video drivers and programs that require a graphical user interface";
nvidia = mkEnableOption "Nvidia graphics drivers";
amd = mkEnableOption "AMD graphics drivers";
};
hardware.bluetooth = {
enable = mkEnableOption "bluetooth modules, drivers and configuration program(s)";
powerOnBoot = mkEnableOption "Enable bluetooth on boot";
};
# should the device enable printing module and try to load common printer modules
# you might need to add more drivers to the printing module for your printer to work
printing = {
enable = mkEnableOption "printing";
extraDrivers = mkOption {
type = listOf str;
default = [];
description = "A list of extra drivers to enable for printing";
};
};
};
}