refactor(gpu)!: rename from gui

This commit is contained in:
514fpv 2024-01-27 22:14:03 +08:00
parent bd6d09034a
commit 978bc19f68
Signed by: koishi
SSH key fingerprint: SHA256:axz0uIzzY+5W19i7QOUuiw5LSqhKfCBKPf3L4xFRxLw
14 changed files with 24 additions and 24 deletions

View file

@ -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";
};
};

View file

@ -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;

View file

@ -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;

View file

@ -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; };

View file

@ -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;
};

View file

@ -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;

View file

@ -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 = [

View file

@ -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 {

View file

@ -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";

View file

@ -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;
}

View file

@ -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;
};

View file

@ -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;
};

View file

@ -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;
};

View file

@ -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 = {