mirror of
https://github.com/ItsDrike/nixdots
synced 2025-06-29 07:00:41 +00:00
Add workstation-specific settings
This commit is contained in:
parent
fca6296841
commit
27b0d375f2
18 changed files with 258 additions and 9 deletions
|
@ -1,5 +1,6 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./hardware.nix
|
||||
./roles.nix
|
||||
];
|
||||
}
|
||||
|
|
|
@ -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
35
options/device/roles.nix
Normal 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.
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue