refactor(treewide): cleanup

This commit is contained in:
ooks-io 2024-04-30 20:20:35 +12:00
parent 2fe6c44941
commit 2d93503bbc
30 changed files with 76 additions and 273 deletions

View file

@ -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"

View file

@ -4,5 +4,6 @@
./name
./type
./function
./hardware
];
}

View file

@ -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 = [];

View file

@ -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 [

View file

@ -3,6 +3,6 @@
./cpu
./gpu
./features
./ssd
./common
];
}

View file

@ -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

View file

@ -15,7 +15,7 @@ in
};
config = {
networking.hostname = cfg.name;
networking.hostName = cfg.name;
environment.sessionVariables.HN = cfg.name;
};
}