mirror of
https://github.com/ItsDrike/nixdots
synced 2025-06-29 03:10:43 +00:00
Use roles properly
Originally, I was including all role configurations for all hosts, and controlling which get applied in the role configs with a check in each file. This is a very repetetive and annoying approach. Instead, now the role directory is included manually from the hosts config for devices which meet that role, removing the role options.
This commit is contained in:
parent
c6c3ecb1e9
commit
00016063fe
27 changed files with 375 additions and 610 deletions
|
@ -1,49 +1,11 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.myOptions.device.roles;
|
||||
{lib, ...}: let
|
||||
inherit (lib) mkOption;
|
||||
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.
|
||||
'';
|
||||
};
|
||||
|
||||
isUniMachine = mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Should University specific configuration be applied?
|
||||
|
||||
(Things like University specific software, etc.)
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue