diff --git a/build.conf.nix b/build.conf.nix index 0d2cd34..3b969ce 100644 --- a/build.conf.nix +++ b/build.conf.nix @@ -1,3 +1,6 @@ +with builtins; { - use-kde = true; + wm = "kde"; + + is-x11 = wm: elem wm ["kde" "xmonad"]; } diff --git a/configuration.nix b/configuration.nix index 1d67c3f..b324a36 100644 --- a/configuration.nix +++ b/configuration.nix @@ -4,7 +4,8 @@ { config, pkgs, ... }: let - use-kde = (import ./build.conf.nix).use-kde; + conf = import ./build.conf.nix; + x11 = conf.is-x11 conf.wm; in { nix = { @@ -57,11 +58,11 @@ in }; # Enable the X11 windowing system. - services.xserver.enable = use-kde; + services.xserver.enable = x11; # Enable the KDE Plasma Desktop Environment. - services.xserver.displayManager.sddm.enable = use-kde; - services.xserver.desktopManager.plasma5.enable = use-kde; + services.xserver.displayManager.sddm.enable = conf.wm == "kde"; + services.xserver.desktopManager.plasma5.enable = conf.wm == "kde"; # Configure keymap in X11 services.xserver = { diff --git a/home.nix b/home.nix index 1dc0225..288c8cd 100644 --- a/home.nix +++ b/home.nix @@ -1,6 +1,7 @@ { config, pkgs, ... }: let - use-kde = (import ./build.conf.nix).use-kde; + conf = import ./build.conf.nix; + wm = conf.wm; in { /* The home.stateVersion option does not have a default and must be set */ @@ -128,22 +129,21 @@ in extraConfig = import ./kitty.conf.nix; }; - # xsession.windowManager.xmonad = if use-kde then { - # enable = true; - # config = pkgs.writeText "xmonad.hs" '' - # import XMonad - # main = xmonad defaultConfig - # { terminal = "kitty" - # , modMask = mod4Mask - # , borderWidth = 3 - # } - # ''; - # } else {}; + xsession.windowManager.xmonad = if wm == "xmonad" then { + enable = true; + config = pkgs.writeText "xmonad.hs" '' + import XMonad + main = xmonad defaultConfig + { terminal = "kitty" + , modMask = mod4Mask + , borderWidth = 3 + } + ''; + } else {}; - wayland.windowManager.hyprland = if use-kde - then {} - else { + wayland.windowManager.hyprland = if wm == "hyprland" + then { enable = true; enableNvidiaPatches = true; - }; + } else {}; }