refactor(treewide): cleanup
This commit is contained in:
parent
2fe6c44941
commit
2d93503bbc
30 changed files with 76 additions and 273 deletions
|
|
@ -36,7 +36,7 @@ in
|
|||
isNormalUser = true;
|
||||
shell = pkgs.${cfg.shell};
|
||||
initialPassword = "password";
|
||||
openssh.authorizedKeys = "${cfg.sshKey}";
|
||||
openssh.authorizedKeys.keys = [ "${cfg.sshKey}" ];
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"video"
|
||||
|
|
|
|||
|
|
@ -4,5 +4,6 @@
|
|||
./name
|
||||
./type
|
||||
./function
|
||||
./hardware
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,12 +5,6 @@ let
|
|||
in
|
||||
|
||||
{
|
||||
imports = [
|
||||
./gaming
|
||||
./workstation
|
||||
./media-server
|
||||
];
|
||||
|
||||
options.systemModules.host.function = mkOption {
|
||||
type = with types; listOf (enum ["gaming" "workstation" "media-server"]);
|
||||
default = [];
|
||||
|
|
|
|||
|
|
@ -2,19 +2,18 @@
|
|||
|
||||
let
|
||||
inherit (lib) mkMerge mkEnableOption mkIf versionAtLeast versionOlder;
|
||||
hardware = config.systemModules.host.hardware.cpu;
|
||||
cfg = hardware.amd;
|
||||
kernelVersion = config.kernelPackages.kernel.version;
|
||||
inherit (builtins) elem;
|
||||
cpu = config.systemModules.host.hardware.cpu;
|
||||
cfg = cpu.amd;
|
||||
kernelVersion = config.boot.kernelPackages.kernel.version;
|
||||
kernelVersionAtLeast = versionAtLeast kernelVersion;
|
||||
kernelVersionOlder= versionOlder kernelVersion;
|
||||
in
|
||||
|
||||
{
|
||||
options.systemModules.host.hardware.cpu.amd = {
|
||||
pstate.enable = mkEnableOption "Enable pstate amd module";
|
||||
};
|
||||
options.systemModules.host.hardware.cpu.amd.pstate.enable = mkEnableOption "Enable amd pstate module";
|
||||
|
||||
config = mkIf (builtins.elem hardware.type ["amd"]) {
|
||||
config = mkIf (elem cpu.type ["amd"]) {
|
||||
environment.systemPackages = [pkgs.amdctl];
|
||||
hardware.cpu.amd.updateMicrocode = true;
|
||||
boot = mkMerge [
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@
|
|||
./cpu
|
||||
./gpu
|
||||
./features
|
||||
./ssd
|
||||
./common
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
let
|
||||
features = config.systemModules.host.hardware.ssd;
|
||||
features = config.systemModules.host.hardware.features;
|
||||
inherit (lib) mkIf;
|
||||
inherit (builtins) elem;
|
||||
in
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ in
|
|||
};
|
||||
|
||||
config = {
|
||||
networking.hostname = cfg.name;
|
||||
networking.hostName = cfg.name;
|
||||
environment.sessionVariables.HN = cfg.name;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue