generalize build.conf.nix
This commit is contained in:
parent
223c8256db
commit
9a12bf7784
3 changed files with 25 additions and 21 deletions
|
@ -1,3 +1,6 @@
|
|||
with builtins;
|
||||
{
|
||||
use-kde = true;
|
||||
wm = "kde";
|
||||
|
||||
is-x11 = wm: elem wm ["kde" "xmonad"];
|
||||
}
|
||||
|
|
|
@ -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 = {
|
||||
|
|
32
home.nix
32
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 {};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue