Parameterise gpu config
This commit is contained in:
parent
9b22c91170
commit
76bd3a4bc8
|
@ -5,13 +5,13 @@
|
||||||
[
|
[
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../../modules/cpu/intel.nix
|
../../modules/cpu/intel.nix
|
||||||
../../modules/gpu/intel.nix
|
|
||||||
../../modules
|
../../modules
|
||||||
../../profiles/dev.nix
|
../../profiles/dev.nix
|
||||||
../../users/simon
|
../../users/simon
|
||||||
];
|
];
|
||||||
|
|
||||||
sbruder = {
|
sbruder = {
|
||||||
|
gpu.intel.enable = true;
|
||||||
gui.enable = true;
|
gui.enable = true;
|
||||||
libvirt.enable = true;
|
libvirt.enable = true;
|
||||||
restic.enable = true;
|
restic.enable = true;
|
||||||
|
|
|
@ -5,13 +5,13 @@
|
||||||
[
|
[
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../../modules/cpu/intel.nix
|
../../modules/cpu/intel.nix
|
||||||
../../modules/gpu/amd.nix
|
|
||||||
../../modules
|
../../modules
|
||||||
../../profiles/dev.nix
|
../../profiles/dev.nix
|
||||||
../../users/simon
|
../../users/simon
|
||||||
];
|
];
|
||||||
|
|
||||||
sbruder = {
|
sbruder = {
|
||||||
|
gpu.amd.enable = true;
|
||||||
gui.enable = true;
|
gui.enable = true;
|
||||||
libvirt.enable = true;
|
libvirt.enable = true;
|
||||||
restic.enable = true;
|
restic.enable = true;
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
./cups.nix
|
./cups.nix
|
||||||
./docker.nix
|
./docker.nix
|
||||||
./fonts.nix
|
./fonts.nix
|
||||||
|
./gpu
|
||||||
./grub.nix
|
./grub.nix
|
||||||
./libvirt.nix
|
./libvirt.nix
|
||||||
./locales.nix
|
./locales.nix
|
||||||
|
|
|
@ -1,26 +1,32 @@
|
||||||
{ pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.sbruder.gpu.amd;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
hardware.opengl.extraPackages = with pkgs; [
|
options.sbruder.gpu.amd.enable = lib.mkEnableOption "amd gpu configuration";
|
||||||
amdvlk
|
|
||||||
rocm-opencl-icd
|
|
||||||
];
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
config = lib.mkIf cfg.enable {
|
||||||
clinfo
|
hardware.opengl.extraPackages = with pkgs; [
|
||||||
radeontop
|
amdvlk
|
||||||
rocm-smi
|
rocm-opencl-icd
|
||||||
];
|
];
|
||||||
|
|
||||||
# force RGB otput for HDMI (otherwise the default is YCbCr)
|
environment.systemPackages = with pkgs; [
|
||||||
# see https://gitlab.freedesktop.org/drm/amd/-/issues/476
|
clinfo
|
||||||
#boot.kernelPatches = [
|
radeontop
|
||||||
# {
|
rocm-smi
|
||||||
# name = "force-rgb";
|
];
|
||||||
# patch = pkgs.fetchurl {
|
|
||||||
# url = "https://gitlab.freedesktop.org/drm/amd/uploads/99b3664a49ec759075bde5c454e1d7c2/0001-force-rgb.patch";
|
# force RGB otput for HDMI (otherwise the default is YCbCr)
|
||||||
# sha256 = "03dhnlxx9vlj1x8izh3c3j4r9s75q47nx8kf6mbdxqfy3cj96mjm";
|
# see https://gitlab.freedesktop.org/drm/amd/-/issues/476
|
||||||
# };
|
#boot.kernelPatches = [
|
||||||
# }
|
# {
|
||||||
#];
|
# name = "force-rgb";
|
||||||
|
# patch = pkgs.fetchurl {
|
||||||
|
# url = "https://gitlab.freedesktop.org/drm/amd/uploads/99b3664a49ec759075bde5c454e1d7c2/0001-force-rgb.patch";
|
||||||
|
# sha256 = "03dhnlxx9vlj1x8izh3c3j4r9s75q47nx8kf6mbdxqfy3cj96mjm";
|
||||||
|
# };
|
||||||
|
# }
|
||||||
|
#];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
7
modules/gpu/default.nix
Normal file
7
modules/gpu/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./amd.nix
|
||||||
|
./intel.nix
|
||||||
|
];
|
||||||
|
}
|
|
@ -1,8 +1,14 @@
|
||||||
{ pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.sbruder.gpu.intel;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
hardware.opengl.extraPackages = with pkgs; [
|
options.sbruder.gpu.intel.enable = lib.mkEnableOption "intel gpu configuration";
|
||||||
beignet
|
|
||||||
vaapiIntel
|
config = lib.mkIf cfg.enable {
|
||||||
];
|
hardware.opengl.extraPackages = with pkgs; [
|
||||||
|
beignet
|
||||||
|
vaapiIntel
|
||||||
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue