🚀 add xmonad
This commit is contained in:
parent
e394a4b7fb
commit
daaf48fda3
3 changed files with 81 additions and 2 deletions
|
@ -1,12 +1,12 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let cfg = config.modules.desktop;
|
let cfg = config.modules.desktop;
|
||||||
in {
|
in {
|
||||||
imports = [ ./apps ./bspwm ./gtk.nix ];
|
imports = [ ./apps ./bspwm ./gtk.nix ./xmonad ];
|
||||||
|
|
||||||
options.modules.desktop = {
|
options.modules.desktop = {
|
||||||
name = lib.mkOption {
|
name = lib.mkOption {
|
||||||
default = "bspwm";
|
default = "bspwm";
|
||||||
type = lib.types.enum [ "bspwm" ];
|
type = lib.types.enum [ "bspwm" "xmonad" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
40
modules/desktop/xmonad/default.nix
Normal file
40
modules/desktop/xmonad/default.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
39
modules/desktop/xmonad/xmonad.hs
Normal file
39
modules/desktop/xmonad/xmonad.hs
Normal 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
|
Loading…
Reference in a new issue