Add workstation-specific settings

This commit is contained in:
ItsDrike 2024-04-13 20:10:01 +02:00
parent fca6296841
commit 27b0d375f2
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0
18 changed files with 258 additions and 9 deletions

View file

@ -3,5 +3,6 @@ _: {
./device
./home
./system
./workstation
];
}

View file

@ -1,5 +1,6 @@
_: {
{
imports = [
./hardware.nix
./roles.nix
];
}

View file

@ -14,12 +14,6 @@ in
'';
};
virtual-machine = mkOption {
type = lib.types.bool;
default = false;
description = "Is this system a virtual machine?";
};
hasTPM = mkOption {
type = lib.types.bool;
default = false;

35
options/device/roles.nix Normal file
View file

@ -0,0 +1,35 @@
{ lib, config, ... }: let
inherit (lib) mkOption types;
cfg = config.myOptions.device;
in {
options.myOptions.device.roles = {
type = mkOption {
type = types.enum ["laptop" "desktop" "server"];
default = "";
description = ''
The type/purpoes of the device that will be used within the rest of the configuration.
- laptop: portable devices with battery optimizations
- desktop: stationary devices configured for maximum performance
- server: server and infrastructure
'';
};
virtual-machine = mkOption {
type = lib.types.bool;
default = false;
description = "Is this system a virtual machine?";
};
isWorkstation = mkOption {
type = lib.types.bool;
default = builtins.elem cfg.type ["laptop" "desktop"];
readOnly = true;
description = ''
Is this machine a workstation?
Workstation machines are meant for regular day-to-day use.
'';
};
};
}

View file

@ -0,0 +1,16 @@
{ lib, config, ... }: with lib; let
inherit (lib) mkEnableOption mkOption literalExpression types;
cfg = config.myOptions.workstation;
in
{
options.myOptions.workstation = {
printing = {
enable = mkEnableOption ''
printing support using cups.
Also adds some drivers for common printers.
'';
};
};
}