Skip to content

Commit

Permalink
herbstluftwm module: add configFile option
Browse files Browse the repository at this point in the history
based on the equivalent for i3
  • Loading branch information
anderspapitto authored and fpletz committed Feb 21, 2017
1 parent ae8c267 commit 3d963c3
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions nixos/modules/services/x11/window-managers/herbstluftwm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
};
Expand Down

0 comments on commit 3d963c3

Please sign in to comment.