🚀 add xmonad

nixos
Moritz Böhme 2022-03-30 10:54:54 +02:00
parent e394a4b7fb
commit daaf48fda3
No known key found for this signature in database
GPG Key ID: 213820E2795F5CF5
3 changed files with 81 additions and 2 deletions

View File

@ -1,12 +1,12 @@
{ config, lib, pkgs, ... }:
let cfg = config.modules.desktop;
in {
imports = [ ./apps ./bspwm ./gtk.nix ];
imports = [ ./apps ./bspwm ./gtk.nix ./xmonad ];
options.modules.desktop = {
name = lib.mkOption {
default = "bspwm";
type = lib.types.enum [ "bspwm" ];
type = lib.types.enum [ "bspwm" "xmonad" ];
};
};

View File

@ -0,0 +1,40 @@
{ config, lib, pkgs, ... }:
let cfg = config.modules.desktop;
in {
config = lib.mkIf (cfg.name == "xmonad") {
services = {
xserver = {
enable = true;
layout = "de";
displayManager = {
defaultSession = "none+xmonad";
autoLogin = {
enable = true;
user = "moritz";
};
lightdm.enable = true;
};
windowManager.xmonad.enable = true;
};
};
console.keyMap = "de";
home-manager.users.moritz = let
xmonadPackages = haskellPackages: [
haskellPackages.xmonad-contrib
haskellPackages.xmonad-extras
haskellPackages.xmonad
haskellPackages.xmobar
];
in {
xsession.windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
config = ./xmonad.hs;
# extraPackages = xmonadPackages;
};
programs.xmobar.enable = true;
};
};
}

View File

@ -0,0 +1,39 @@
import XMonad
( Choose,
Default (def),
Full,
KeyMask,
Mirror,
Tall,
X,
XConfig (modMask, terminal),
mod4Mask,
spawn,
xmonad,
)
import XMonad.Hooks.EwmhDesktops (ewmh)
import XMonad.Util.EZConfig (additionalKeysP)
myModMask :: KeyMask
myModMask = mod4Mask
myTerminal :: String
myTerminal = "kitty"
myKeys :: [(String, X ())]
myKeys =
[ ("M-d", spawn "rofi -show combi"),
("M-e", spawn "emacsclient -c -a emacs"),
("M-f", spawn "firefox")
]
myConfig :: (XConfig (Choose Tall (Choose (Mirror Tall) Full)))
myConfig =
def
{ modMask = myModMask,
terminal = myTerminal
}
`additionalKeysP` myKeys
main :: IO ()
main = xmonad $ ewmh $ ewmhFullscreen myConfig