herbstluftwm module: add configFile option

based on the equivalent for i3
This commit is contained in:
Anders Papitto 2017-02-19 16:58:18 -08:00 committed by Franz Pletz
parent ae8c267320
commit 3d963c3e8f

View file

@ -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 ];
};