From 7da089daa3fcee341c454472f0dfc4fc7dee4749 Mon Sep 17 00:00:00 2001 From: John Ogle Date: Sat, 14 Dec 2024 15:38:46 -0800 Subject: [PATCH] [desktop] Add a waylandOnly option --- machines/nix-book/configuration.nix | 5 ++++- roles/desktop/default.nix | 13 +++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/machines/nix-book/configuration.nix b/machines/nix-book/configuration.nix index e7ad777..8f09572 100644 --- a/machines/nix-book/configuration.nix +++ b/machines/nix-book/configuration.nix @@ -12,7 +12,10 @@ roles = { audio.enable = true; bluetooth.enable = true; - desktop.enable = true; + desktop = { + enable = true; + waylandOnly = true; + }; nfs-mounts.enable = true; printing.enable = true; spotifyd.enable = true; diff --git a/roles/desktop/default.nix b/roles/desktop/default.nix index 12bab06..a5a05d4 100644 --- a/roles/desktop/default.nix +++ b/roles/desktop/default.nix @@ -15,13 +15,11 @@ let ]; x11BasePackages = with pkgs; [ - + customPackages.modrinthNvidia ]; x11OnlyPackages = with pkgs; [ emacs - - customPackages.modrinthNvidia ]; waylandBasePackages = with pkgs; [ @@ -42,6 +40,10 @@ in type = types.bool; default = false; }; + waylandOnly = mkOption { + type = types.bool; + default = false; + }; }; config = mkIf cfg.enable @@ -131,11 +133,10 @@ in environment.systemPackages = with pkgs; mkMerge [ basePackages - x11BasePackages + (mkIf (!cfg.waylandOnly) x11BasePackages) (mkIf cfg.x11Only x11OnlyPackages) - # TODO: Do we need a "wayland only" mode? (mkIf (!cfg.x11Only) waylandBasePackages) - (mkIf (!cfg.x11Only) waylandOnlyPackages) + (mkIf (cfg.waylandOnly) waylandOnlyPackages) ]; };