diff options
author | lassulus <lassulus@lassul.us> | 2018-11-28 23:08:20 +0100 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2018-12-15 14:50:20 +0100 |
commit | 3eefc0b90923c02adad9d841b34e22c14adfdc08 (patch) | |
tree | 6a98025b2f165dc0c7fed2f934ea99ac23ec5add /nixos/modules/services/x11/window-managers/xmonad.nix | |
parent | e814fba3168703eed6e2b67200299ea40beca418 (diff) |
xmonad service: add .config option
Diffstat (limited to 'nixos/modules/services/x11/window-managers/xmonad.nix')
-rw-r--r-- | nixos/modules/services/x11/window-managers/xmonad.nix | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/nixos/modules/services/x11/window-managers/xmonad.nix b/nixos/modules/services/x11/window-managers/xmonad.nix index 43de746ab1f16..a6055f26789ef 100644 --- a/nixos/modules/services/x11/window-managers/xmonad.nix +++ b/nixos/modules/services/x11/window-managers/xmonad.nix @@ -10,6 +10,14 @@ let optionals cfg.enableContribAndExtras [ self.xmonad-contrib self.xmonad-extras ]; }; + xmonadBin = pkgs.writers.writeHaskell "xmonad" { + ghc = cfg.haskellPackages.ghc; + libraries = [ cfg.haskellPackages.xmonad ] ++ + cfg.extraPackages cfg.haskellPackages ++ + optionals cfg.enableContribAndExtras + (with cfg.haskellPackages; [ xmonad-contrib xmonad-extras ]); + } cfg.config; + in { options = { @@ -48,13 +56,36 @@ in type = lib.types.bool; description = "Enable xmonad-{contrib,extras} in Xmonad."; }; + + config = mkOption { + default = null; + type = with lib.types; nullOr (either path string); + description = '' + Configuration from which XMonad gets compiled. If no value + is specified, the xmonad config from $HOME/.xmonad is taken. + If you use xmonad --recompile, $HOME/.xmonad will be taken as + the configuration, but on the next restart of display-manager + this config will be reapplied. + ''; + example = '' + import XMonad + + main = launch defaultConfig + { modMask = mod4Mask -- Use Super instead of Alt + , terminal = "urxvt" + } + ''; + }; }; }; config = mkIf cfg.enable { services.xserver.windowManager = { session = [{ name = "xmonad"; - start = '' + start = if (cfg.config != null) then '' + ${xmonadBin} + waitPID=$! + '' else '' ${xmonad}/bin/xmonad & waitPID=$! ''; |