From 4f0024c4f99b0db652ee6a0f8e56c4862ac47517 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 18 Jan 2025 11:00:30 -0500 Subject: [PATCH] Move some graphics bits into the graphics role. --- nix/configuration/configuration.nix | 3 -- nix/configuration/roles/graphics/default.nix | 33 +++++++++++++++++++- nix/configuration/roles/media/default.nix | 20 ------------ 3 files changed, 32 insertions(+), 24 deletions(-) diff --git a/nix/configuration/configuration.nix b/nix/configuration/configuration.nix index b3e7331..44cf3c4 100644 --- a/nix/configuration/configuration.nix +++ b/nix/configuration/configuration.nix @@ -136,9 +136,6 @@ file usbutils # for lsusb pciutils # for lspci - mesa-demos # for glxgears TODO move to better role - vulkan-tools # for vkcube TODO move to better role - xorg.xeyes # to test which windows are using x11 TODO move to better role ripgrep strace ltrace diff --git a/nix/configuration/roles/graphics/default.nix b/nix/configuration/roles/graphics/default.nix index 05a9d55..94a7c1b 100644 --- a/nix/configuration/roles/graphics/default.nix +++ b/nix/configuration/roles/graphics/default.nix @@ -8,5 +8,36 @@ { imports = [ ]; - hardware.graphics.enable = true; + options.me.graphicsCardType = lib.mkOption { + type = lib.types.nullOr ( + lib.types.enum [ + "amd" + "intel" + "nvidia" + ] + ); + default = null; + example = "amd"; + description = "What graphics card type is in the computer."; + }; + + options.me.graphical = lib.mkOption { + type = lib.types.bool; + default = false; + example = true; + description = "Whether we want to install graphical programs."; + }; + + config = ( + lib.mkMerge [ + (lib.mkIf config.me.graphical { + environment.systemPackages = with pkgs; [ + mesa-demos # for glxgears + vulkan-tools # for vkcube + xorg.xeyes # to test which windows are using x11 + ]; + hardware.graphics.enable = true; + }) + ] + ); } diff --git a/nix/configuration/roles/media/default.nix b/nix/configuration/roles/media/default.nix index ed00375..177d68f 100644 --- a/nix/configuration/roles/media/default.nix +++ b/nix/configuration/roles/media/default.nix @@ -21,26 +21,6 @@ in { imports = [ ]; - options.me.graphicsCardType = lib.mkOption { - type = lib.types.nullOr ( - lib.types.enum [ - "amd" - "intel" - "nvidia" - ] - ); - default = null; - example = "amd"; - description = "What graphics card type is in the computer."; - }; - - options.me.graphical = lib.mkOption { - type = lib.types.bool; - default = false; - example = true; - description = "Whether we want to install graphical programs."; - }; - config = ( lib.mkMerge [ {