From 978bc19f68e997dddb09427b4cff627c09dcaee4 Mon Sep 17 00:00:00 2001 From: 514fpv Date: Sat, 27 Jan 2024 22:14:03 +0800 Subject: [PATCH] refactor(gpu)!: rename from gui --- global/{gui => gpu}/default.nix | 8 ++++---- global/{gui => gpu}/greetd.nix | 2 +- global/{gui => gpu}/plymouth.nix | 4 ++-- global/io/default.nix | 2 +- global/oci/default.nix | 2 +- home/chrome/nixos.nix | 2 +- home/gui/nixos.nix | 2 +- home/sway/nixos.nix | 4 ++-- home/util/nixos.nix | 2 +- home/virt-manager/nixos.nix | 2 +- spec/chireiden/default.nix | 4 ++-- spec/eientei/default.nix | 6 +++--- spec/koumakyou/default.nix | 4 ++-- spec/yume/default.nix | 4 ++-- 14 files changed, 24 insertions(+), 24 deletions(-) rename global/{gui => gpu}/default.nix (95%) rename global/{gui => gpu}/greetd.nix (95%) rename global/{gui => gpu}/plymouth.nix (84%) diff --git a/global/gui/default.nix b/global/gpu/default.nix similarity index 95% rename from global/gui/default.nix rename to global/gpu/default.nix index 8a7e88f4..24c84b9e 100644 --- a/global/gui/default.nix +++ b/global/gpu/default.nix @@ -2,7 +2,7 @@ , lib , config , ... }: with lib; let - cfg = config.global.gui; + cfg = config.global.gpu; intel = cfg.type == "intel" || (cfg.type == "prime" && config.hardware.nvidia.prime.intelBusId != ""); amdgpu = cfg.type == "amdgpu" || (cfg.type == "prime" && config.hardware.nvidia.prime.amdgpuBusId != ""); @@ -13,7 +13,7 @@ in { ./greetd.nix ]; - options.global.gui = { + options.global.gpu = { enable = mkEnableOption "various setup required for GUI and support software"; session = mkEnableOption "software required for a graphical session" // { default = true; }; type = mkOption { @@ -77,14 +77,14 @@ in { specialisation.integratedGraphics = mkIf (cfg.type == "prime") { configuration = { - global.gui.type = mkForce (if intel then "intel" else if amdgpu then "amdgpu" else "prime"); + global.gpu.type = mkForce (if intel then "intel" else if amdgpu then "amdgpu" else "prime"); boot.blacklistedKernelModules = [ "nouveau" ]; }; }; specialisation.withArc = mkIf (cfg.arc != null) { configuration = { - global.gui.arc = mkForce null; + global.gpu.arc = mkForce null; powerManagement.cpuFreqGovernor = mkForce "performance"; }; }; diff --git a/global/gui/greetd.nix b/global/gpu/greetd.nix similarity index 95% rename from global/gui/greetd.nix rename to global/gpu/greetd.nix index 7a208862..507e9a36 100644 --- a/global/gui/greetd.nix +++ b/global/gpu/greetd.nix @@ -2,7 +2,7 @@ , lib , config , ... }: with lib; let - cfg = config.global.gui; + cfg = config.global.gpu; in mkIf (cfg.enable && cfg.session) { programs.regreet = { enable = true; diff --git a/global/gui/plymouth.nix b/global/gpu/plymouth.nix similarity index 84% rename from global/gui/plymouth.nix rename to global/gpu/plymouth.nix index a588206c..2d7f7404 100644 --- a/global/gui/plymouth.nix +++ b/global/gpu/plymouth.nix @@ -2,10 +2,10 @@ , lib , config , ... }: with lib; let - cfg = config.global.gui; + cfg = config.global.gpu; in mkIf cfg.enable { boot = { - loader.timeout = lib.mkDefault 0; + loader.timeout = mkDefault 0; consoleLogLevel = 0; initrd.verbose = false; initrd.systemd.enable = true; diff --git a/global/io/default.nix b/global/io/default.nix index 13345ac2..b6c690a5 100644 --- a/global/io/default.nix +++ b/global/io/default.nix @@ -3,7 +3,7 @@ , config , ... }: with lib; let cfg = config.global.io; - gui = with config.global.gui; enable && session; + gui = with config.global.gpu; enable && session; in { options.global.io = { betaflight = mkEnableOption "betaflight udev rules" // { default = true; }; diff --git a/global/oci/default.nix b/global/oci/default.nix index 4827c71a..a31bfbdc 100644 --- a/global/oci/default.nix +++ b/global/oci/default.nix @@ -11,7 +11,7 @@ in { config = mkIf cfg.enable { virtualisation.podman = { enable = true; - enableNvidia = with config.global.gui; mkDefault (type == "prime" || type == "nvidia"); + enableNvidia = with config.global.gpu; mkDefault type == "prime" || type == "nvidia"; dockerCompat = true; }; diff --git a/home/chrome/nixos.nix b/home/chrome/nixos.nix index a432134b..cdb23871 100644 --- a/home/chrome/nixos.nix +++ b/home/chrome/nixos.nix @@ -2,7 +2,7 @@ , lib , config , ... }: with lib; let - gui = with config.global.gui; ( enable && session ); + gui = with config.global.gpu; enable && session; in { users.home.persist.directories = mkIf gui [ ".config/google-chrome" ]; security.chromiumSuidSandbox.enable = mkIf gui true; diff --git a/home/gui/nixos.nix b/home/gui/nixos.nix index 469ab38c..605e5acb 100644 --- a/home/gui/nixos.nix +++ b/home/gui/nixos.nix @@ -2,7 +2,7 @@ , lib , config , ... }: with lib; let - gui = with config.global.gui; ( enable && session ); + gui = with config.global.gpu; enable && session; in { config = { users.homeModules = [ diff --git a/home/sway/nixos.nix b/home/sway/nixos.nix index 6e09b3af..3817720f 100644 --- a/home/sway/nixos.nix +++ b/home/sway/nixos.nix @@ -2,8 +2,8 @@ , lib , config , ... }: with lib; let - gui = with config.global.gui; ( enable && session ); - nvidia = with config.global.gui; ( type == "nvidia" || type == "prime" ); + gui = with config.global.gpu; enable && session; + nvidia = with config.global.gpu; type == "nvidia" || type == "prime"; in mkIf gui { services.xserver.displayManager.sessionPackages = [ (pkgs.writeTextFile { diff --git a/home/util/nixos.nix b/home/util/nixos.nix index f8943085..9ff31114 100644 --- a/home/util/nixos.nix +++ b/home/util/nixos.nix @@ -3,7 +3,7 @@ , config , ... }: with lib; let cfg = config.home.util; - gui = with config.global.gui; ( enable && session ); + gui = with config.global.gpu; enable && session; in { options.home.util = { minimal = mkEnableOption "minimal system environment with less packages"; diff --git a/home/virt-manager/nixos.nix b/home/virt-manager/nixos.nix index ab11e6f5..fc865a12 100644 --- a/home/virt-manager/nixos.nix +++ b/home/virt-manager/nixos.nix @@ -2,7 +2,7 @@ , lib , config , ... }: with lib; let - gui = with config.global.gui; ( enable && session ); + gui = with config.global.gpu; enable && session; in mkIf gui { programs.virt-manager.enable = true; } diff --git a/spec/chireiden/default.nix b/spec/chireiden/default.nix index 2791079c..0e3a9dde 100644 --- a/spec/chireiden/default.nix +++ b/spec/chireiden/default.nix @@ -12,8 +12,8 @@ fs.cryptsetup.uuids.nix = "3905f87f-7b11-49ef-8ddf-f4202c555ffd"; fs.cryptsetup.uuids.persist = "b2322f01-1c44-433f-a995-4ddce5845cf9"; boot.lanzaboote = true; - gui.enable = true; - gui.type = "prime"; + gpu.enable = true; + gpu.type = "prime"; android.enable = true; }; diff --git a/spec/eientei/default.nix b/spec/eientei/default.nix index a35ee350..64fb3dbc 100644 --- a/spec/eientei/default.nix +++ b/spec/eientei/default.nix @@ -4,9 +4,9 @@ fs.esp.uuid = "FC6D-75D8"; fs.type = "zfs"; boot.lanzaboote = true; - gui.enable = true; - gui.type = "intel"; - gui.arc = "8086:5691"; + gpu.enable = true; + gpu.type = "intel"; + gpu.arc = "8086:5691"; android.enable = true; }; diff --git a/spec/koumakyou/default.nix b/spec/koumakyou/default.nix index 0c3cf9d0..05bbe757 100644 --- a/spec/koumakyou/default.nix +++ b/spec/koumakyou/default.nix @@ -14,8 +14,8 @@ fs.cryptsetup.uuids.nix = "84baa53a-c76d-4716-813a-196f5a53e44d"; fs.cryptsetup.uuids.persist = "e31f8b1c-6504-4b43-93dd-997ad17ebf5e"; boot.lanzaboote = true; - gui.enable = true; - gui.type = "prime"; + gpu.enable = true; + gpu.type = "prime"; asusd.enable = true; oci.enable = true; }; diff --git a/spec/yume/default.nix b/spec/yume/default.nix index c2084658..6e5d0d1f 100644 --- a/spec/yume/default.nix +++ b/spec/yume/default.nix @@ -8,8 +8,8 @@ fs.esp.uuid = "6CEB-765A"; fs.type = "xfs"; fs.store = "b80e8bbe-d1ff-4d2e-ae25-9e9048d67355"; - gui.enable = true; - gui.type = "nvidia"; + gpu.enable = true; + gpu.type = "nvidia"; }; home = {