[desktop] Add a waylandOnly option

This commit is contained in:
2024-12-14 15:38:46 -08:00
parent 8134d7cb33
commit 7da089daa3
2 changed files with 11 additions and 7 deletions

View File

@@ -12,7 +12,10 @@
roles = { roles = {
audio.enable = true; audio.enable = true;
bluetooth.enable = true; bluetooth.enable = true;
desktop.enable = true; desktop = {
enable = true;
waylandOnly = true;
};
nfs-mounts.enable = true; nfs-mounts.enable = true;
printing.enable = true; printing.enable = true;
spotifyd.enable = true; spotifyd.enable = true;

View File

@@ -15,13 +15,11 @@ let
]; ];
x11BasePackages = with pkgs; [ x11BasePackages = with pkgs; [
customPackages.modrinthNvidia
]; ];
x11OnlyPackages = with pkgs; [ x11OnlyPackages = with pkgs; [
emacs emacs
customPackages.modrinthNvidia
]; ];
waylandBasePackages = with pkgs; [ waylandBasePackages = with pkgs; [
@@ -42,6 +40,10 @@ in
type = types.bool; type = types.bool;
default = false; default = false;
}; };
waylandOnly = mkOption {
type = types.bool;
default = false;
};
}; };
config = mkIf cfg.enable config = mkIf cfg.enable
@@ -131,11 +133,10 @@ in
environment.systemPackages = with pkgs; mkMerge [ environment.systemPackages = with pkgs; mkMerge [
basePackages basePackages
x11BasePackages (mkIf (!cfg.waylandOnly) x11BasePackages)
(mkIf cfg.x11Only x11OnlyPackages) (mkIf cfg.x11Only x11OnlyPackages)
# TODO: Do we need a "wayland only" mode?
(mkIf (!cfg.x11Only) waylandBasePackages) (mkIf (!cfg.x11Only) waylandBasePackages)
(mkIf (!cfg.x11Only) waylandOnlyPackages) (mkIf (cfg.waylandOnly) waylandOnlyPackages)
]; ];
}; };