slight refactor/rocm packages
This commit is contained in:
parent
981d285606
commit
043ba21e98
4 changed files with 18 additions and 16 deletions
22
flake.nix
22
flake.nix
|
|
@ -49,22 +49,18 @@
|
|||
};
|
||||
});
|
||||
|
||||
mkPkgs = system: pkgs: extraOverlays:
|
||||
import pkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
config.allowAliases = true;
|
||||
overlays = extraOverlays ++ (lib.attrValues self.overlays);
|
||||
};
|
||||
|
||||
pkgsFor = eachSystem (system:
|
||||
mkPkgs system nixpkgs [
|
||||
commonNixpkgsConfig = {
|
||||
config.allowUnfree = true;
|
||||
config.allowAliases = true;
|
||||
overlays = [
|
||||
self.overlays.default
|
||||
inputs.cachyos-kernel.overlays.pinned
|
||||
inputs.niri.overlays.niri
|
||||
inputs.nix-vscode-extensions.overlays.default
|
||||
]
|
||||
);
|
||||
] ++ (lib.attrValues self.overlays);
|
||||
};
|
||||
|
||||
pkgsFor = eachSystem (system: import nixpkgs ({ inherit system; } // commonNixpkgsConfig));
|
||||
in {
|
||||
lib = lib.my;
|
||||
|
||||
|
|
@ -82,6 +78,6 @@
|
|||
|
||||
nixosModules = mapModulesRec ./modules import;
|
||||
|
||||
nixosConfigurations = mapHosts ./hosts { inherit pkgsFor; };
|
||||
nixosConfigurations = mapHosts ./hosts { inherit commonNixpkgsConfig; };
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
in rec {
|
||||
mkHost = path: {
|
||||
system,
|
||||
pkgsFor,
|
||||
commonNixpkgsConfig,
|
||||
...
|
||||
}:
|
||||
nixosSystem {
|
||||
|
|
@ -21,8 +21,7 @@ in rec {
|
|||
|
||||
modules = [
|
||||
{
|
||||
nixpkgs.pkgs = pkgsFor.${system};
|
||||
nixpkgs.hostPlatform = lib.mkDefault system;
|
||||
nixpkgs = commonNixpkgsConfig // { hostPlatform = lib.mkDefault system; };
|
||||
networking.hostName =
|
||||
mkDefault (removeSuffix ".nix" (baseNameOf path));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,10 +10,15 @@ in {
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# opencl
|
||||
hardware.amdgpu.opencl.enable = true;
|
||||
nixpkgs.config.rocmSupport = true;
|
||||
|
||||
# oc
|
||||
hardware.amdgpu.overdrive.enable = cfg.overclock;
|
||||
services.lact.enable = cfg.overclock;
|
||||
|
||||
# top
|
||||
environment.systemPackages = with pkgs; [ amdgpu_top ];
|
||||
|
||||
# radv > amdvlk
|
||||
|
|
|
|||
|
|
@ -13,12 +13,14 @@ in {
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# top
|
||||
environment.systemPackages = with pkgs; [ intel-gpu-tools ];
|
||||
hardware.intel-gpu-tools.enable = true;
|
||||
|
||||
boot.kernelParams = [
|
||||
# enable gpu virtualization
|
||||
"i915.enable_gvt=1"
|
||||
# explicitly enable power saving options (framebuffer compression)
|
||||
] ++ optional cfg.powersave "i915.enable_fbc=1";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue