Split shared host config into dedicated modules
- Add shared modules for boot, hardware, networking, input, and host defaults - Move host-specific TOML flags to new option namespaces - Update SSH and service defaults for the new layout
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
{
|
||||
imports = [
|
||||
./facter.nix
|
||||
./graphics/vaapi.nix
|
||||
./power-save.nix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkOption types;
|
||||
cfg = config.unexplrd.hardware.graphics.vaapi;
|
||||
in {
|
||||
options.unexplrd.hardware.graphics.vaapi = mkOption {
|
||||
type = types.nullOr (types.enum ["intel-media-driver" "nvidia"]);
|
||||
default = null;
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
(mkIf (cfg == "intel-media-driver") {
|
||||
hardware.graphics.extraPackages = with pkgs; [
|
||||
intel-compute-runtime
|
||||
intel-media-driver
|
||||
vpl-gpu-rt
|
||||
];
|
||||
})
|
||||
(mkIf (cfg == "nvidia") {
|
||||
hardware.graphics.extraPackages = with pkgs; [
|
||||
nvidia-vaapi-driver
|
||||
];
|
||||
})
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
cfg = config.unexplrd.hardware.powerSave;
|
||||
in {
|
||||
options.unexplrd.hardware.powerSave.enable =
|
||||
mkEnableOption "power saving defaults";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
powerManagement.enable = true;
|
||||
powerManagement.powertop.enable = true;
|
||||
services.power-profiles-daemon.enable = true;
|
||||
services.thermald.enable = true;
|
||||
services.upower.enable = true;
|
||||
hardware.bluetooth.settings.Policy.AutoEnable = false;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user