diff options
author | Anders Papitto <anderspapitto@gmail.com> | 2017-02-19 16:58:18 -0800 |
---|---|---|
committer | Franz Pletz <fpletz@fnordicwalking.de> | 2017-02-21 05:46:13 +0100 |
commit | 3d963c3e8f8678fd3c86564389c80b70cbeb3fd5 (patch) | |
tree | 5eae6320217b988cdfb7f0b532d224713335dfdd /nixos/modules | |
parent | ae8c267320d9ba23fec44ef26c17f1559c14cddb (diff) |
herbstluftwm module: add configFile option
based on the equivalent for i3
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/services/x11/window-managers/herbstluftwm.nix | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/nixos/modules/services/x11/window-managers/herbstluftwm.nix b/nixos/modules/services/x11/window-managers/herbstluftwm.nix index 829935fa432b..e3ea61cb9a6b 100644 --- a/nixos/modules/services/x11/window-managers/herbstluftwm.nix +++ b/nixos/modules/services/x11/window-managers/herbstluftwm.nix @@ -8,15 +8,30 @@ in { options = { - services.xserver.windowManager.herbstluftwm.enable = mkEnableOption "herbstluftwm"; + services.xserver.windowManager.herbstluftwm = { + enable = mkEnableOption "herbstluftwm"; + + configFile = mkOption { + default = null; + type = with types; nullOr path; + description = '' + Path to the herbstluftwm configuration file. If left at the + default value, $XDG_CONFIG_HOME/herbstluftwm/autostart will + be used. + ''; + }; + }; }; config = mkIf cfg.enable { services.xserver.windowManager.session = singleton { name = "herbstluftwm"; - start = " - ${pkgs.herbstluftwm}/bin/herbstluftwm - "; + start = + let configFileClause = optionalString + (cfg.configFile != null) + ''-c "${cfg.configFile}"'' + ; + in "${pkgs.herbstluftwm}/bin/herbstluftwm ${configFileClause}"; }; environment.systemPackages = [ pkgs.herbstluftwm ]; }; |