2024-07-20 13:18:01 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit (builtins) elemAt;
|
|
|
|
inherit (lib.options) mkOption mkEnableOption;
|
2025-06-12 20:10:52 +02:00
|
|
|
inherit (lib.types) enum listOf str nullOr bool oneOf;
|
|
|
|
inherit (lib.lists) elem;
|
|
|
|
|
|
|
|
inherit (config.modules.system) systemType;
|
2024-07-20 13:18:01 +02:00
|
|
|
in {
|
|
|
|
imports = [
|
|
|
|
# configuration options for nixos activation scripts
|
|
|
|
# ./activation.nix
|
|
|
|
|
|
|
|
# boot/impermanence mounts
|
|
|
|
# ./boot.nix
|
|
|
|
# ./impermanence.nix
|
|
|
|
|
|
|
|
# network and overall hardening
|
|
|
|
./networking
|
|
|
|
# ./security.nix
|
|
|
|
# ./encryption.nix
|
|
|
|
|
|
|
|
# filesystems
|
|
|
|
# ./fs.nix
|
|
|
|
|
|
|
|
# package and program related options
|
|
|
|
# ./services
|
|
|
|
./programs
|
|
|
|
|
2024-08-16 16:03:47 +02:00
|
|
|
# monitor configuration
|
|
|
|
./monitors.nix
|
2024-07-20 13:18:01 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
options.modules.system = {
|
|
|
|
mainUser = mkOption {
|
|
|
|
type = enum config.modules.system.users;
|
|
|
|
default = elemAt config.modules.system.users 0;
|
|
|
|
description = ''
|
|
|
|
The username of the main user for your system.
|
|
|
|
|
|
|
|
In case of a multiple systems, this will be the user with priority in ordered lists and enabled options.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
users = mkOption {
|
|
|
|
type = listOf str;
|
2025-06-12 20:10:52 +02:00
|
|
|
default = ["cr"];
|
2024-11-03 23:41:44 +01:00
|
|
|
description = "A list of users on the system.";
|
2024-07-20 13:18:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
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.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2025-06-12 20:10:52 +02:00
|
|
|
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.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2024-07-20 13:18:01 +02:00
|
|
|
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";
|
|
|
|
};
|
2024-09-25 18:04:42 +02:00
|
|
|
impermanence = {
|
|
|
|
enable = mkEnableOption "Enable Impermanence";
|
|
|
|
};
|
2025-06-12 20:10:52 +02:00
|
|
|
|
2024-07-20 13:18:01 +02:00
|
|
|
video = {
|
|
|
|
enable = mkEnableOption "video drivers and programs that require a graphical user interface";
|
2024-08-16 22:46:01 +02:00
|
|
|
nvidia = mkEnableOption "Nvidia graphics drivers";
|
|
|
|
amd = mkEnableOption "AMD graphics drivers";
|
2024-07-20 13:18:01 +02:00
|
|
|
};
|
|
|
|
|
2024-08-16 22:46:01 +02:00
|
|
|
hardware.bluetooth = {
|
2024-07-20 13:18:01 +02:00
|
|
|
enable = mkEnableOption "bluetooth modules, drivers and configuration program(s)";
|
2024-08-16 22:46:01 +02:00
|
|
|
powerOnBoot = mkEnableOption "Enable bluetooth on boot";
|
2024-07-20 13:18:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
# 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";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|