slight refactor/rocm packages

This commit is contained in:
Reid 2026-05-14 19:21:21 -07:00
parent 981d285606
commit 043ba21e98
Signed by: reidlab
GPG key ID: DAF5EAF6665839FD
4 changed files with 18 additions and 16 deletions

View file

@ -49,22 +49,18 @@
}; };
}); });
mkPkgs = system: pkgs: extraOverlays: commonNixpkgsConfig = {
import pkgs { config.allowUnfree = true;
inherit system; config.allowAliases = true;
config.allowUnfree = true; overlays = [
config.allowAliases = true;
overlays = extraOverlays ++ (lib.attrValues self.overlays);
};
pkgsFor = eachSystem (system:
mkPkgs system nixpkgs [
self.overlays.default self.overlays.default
inputs.cachyos-kernel.overlays.pinned inputs.cachyos-kernel.overlays.pinned
inputs.niri.overlays.niri inputs.niri.overlays.niri
inputs.nix-vscode-extensions.overlays.default inputs.nix-vscode-extensions.overlays.default
] ] ++ (lib.attrValues self.overlays);
); };
pkgsFor = eachSystem (system: import nixpkgs ({ inherit system; } // commonNixpkgsConfig));
in { in {
lib = lib.my; lib = lib.my;
@ -82,6 +78,6 @@
nixosModules = mapModulesRec ./modules import; nixosModules = mapModulesRec ./modules import;
nixosConfigurations = mapHosts ./hosts { inherit pkgsFor; }; nixosConfigurations = mapHosts ./hosts { inherit commonNixpkgsConfig; };
}; };
} }

View file

@ -11,7 +11,7 @@
in rec { in rec {
mkHost = path: { mkHost = path: {
system, system,
pkgsFor, commonNixpkgsConfig,
... ...
}: }:
nixosSystem { nixosSystem {
@ -21,8 +21,7 @@ in rec {
modules = [ modules = [
{ {
nixpkgs.pkgs = pkgsFor.${system}; nixpkgs = commonNixpkgsConfig // { hostPlatform = lib.mkDefault system; };
nixpkgs.hostPlatform = lib.mkDefault system;
networking.hostName = networking.hostName =
mkDefault (removeSuffix ".nix" (baseNameOf path)); mkDefault (removeSuffix ".nix" (baseNameOf path));
} }

View file

@ -10,10 +10,15 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# opencl
hardware.amdgpu.opencl.enable = true; hardware.amdgpu.opencl.enable = true;
nixpkgs.config.rocmSupport = true;
# oc
hardware.amdgpu.overdrive.enable = cfg.overclock; hardware.amdgpu.overdrive.enable = cfg.overclock;
services.lact.enable = cfg.overclock; services.lact.enable = cfg.overclock;
# top
environment.systemPackages = with pkgs; [ amdgpu_top ]; environment.systemPackages = with pkgs; [ amdgpu_top ];
# radv > amdvlk # radv > amdvlk

View file

@ -13,12 +13,14 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# top
environment.systemPackages = with pkgs; [ intel-gpu-tools ]; environment.systemPackages = with pkgs; [ intel-gpu-tools ];
hardware.intel-gpu-tools.enable = true; hardware.intel-gpu-tools.enable = true;
boot.kernelParams = [ boot.kernelParams = [
# enable gpu virtualization # enable gpu virtualization
"i915.enable_gvt=1" "i915.enable_gvt=1"
# explicitly enable power saving options (framebuffer compression)
] ++ optional cfg.powersave "i915.enable_fbc=1"; ] ++ optional cfg.powersave "i915.enable_fbc=1";
}; };
} }