refactor(nixos): move system config options to main nixos module

This commit is contained in:
Mohammad Rafiq 2025-06-16 19:17:47 +08:00
parent bf63f44875
commit 91c2790b62
No known key found for this signature in database
20 changed files with 124 additions and 149 deletions

View file

@ -1,9 +0,0 @@
{ config, ... }:
{
config = {
services.pipewire = {
enable = true;
pulse.enable = true;
};
};
}

View file

@ -1,37 +1,15 @@
{
lib,
config,
...
}:
{ lib, ... }:
let
inherit (lib) singleton;
in
{
imports = [
./audio.nix
];
options.hardware = {
platform = lib.pantheon.mkStrOption;
config = {
services.fwupd.enable = true;
persistDirs = singleton "/var/lib/bluetooth";
hardware.bluetooth = {
enable = true;
settings.General.Experimental = true;
};
hardware.xone.enable = true;
};
config = lib.mkMerge [
{
services.fwupd.enable = true;
persistDirs = singleton "/var/lib/bluetooth";
hardware.bluetooth = {
enable = true;
settings.General.Experimental = true;
};
hardware.xone.enable = true;
}
(lib.mkIf (config.hardware.platform == "amd") {
hardware.cpu.amd.updateMicrocode = true;
boot.kernelModules = [ "kvm-amd" ];
})
(lib.mkIf (config.hardware.platform == "intel") {
hardware.cpu.intel.updateMicrocode = true;
boot.kernelModules = [ "kvm-intel" ];
})
];
}

View file

@ -0,0 +1,3 @@
{
imports = [ ./x86_64.nix ];
}

View file

@ -0,0 +1,18 @@
{ config, lib, ... }:
let
inherit (lib) singleton mkOption;
inherit (lib.types) enum;
cfg = config.hardware.platform;
in
{
options.hardware.platform = mkOption {
type = enum [
"amd"
"intel"
];
};
config = {
hardware.cpu.${cfg}.updateMicrocode = true;
boot.kernelModules = singleton "kvm-${cfg}";
};
}