2014-04-14 14:26:48 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
2013-11-09 01:38:15 +00:00
|
|
|
|
2014-04-14 14:26:48 +00:00
|
|
|
with lib;
|
2013-11-09 01:38:15 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.xserver.windowManager.herbstluftwm;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
2017-02-20 00:58:18 +00:00
|
|
|
services.xserver.windowManager.herbstluftwm = {
|
|
|
|
enable = mkEnableOption "herbstluftwm";
|
|
|
|
|
2021-01-30 13:13:39 +00:00
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.herbstluftwm;
|
2021-10-03 16:06:03 +00:00
|
|
|
defaultText = literalExpression "pkgs.herbstluftwm";
|
2021-01-30 13:13:39 +00:00
|
|
|
description = ''
|
|
|
|
Herbstluftwm package to use.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2017-02-20 00:58:18 +00:00
|
|
|
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.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2013-11-09 01:38:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
services.xserver.windowManager.session = singleton {
|
|
|
|
name = "herbstluftwm";
|
2017-02-20 00:58:18 +00:00
|
|
|
start =
|
|
|
|
let configFileClause = optionalString
|
|
|
|
(cfg.configFile != null)
|
|
|
|
''-c "${cfg.configFile}"''
|
|
|
|
;
|
2021-01-30 13:13:39 +00:00
|
|
|
in "${cfg.package}/bin/herbstluftwm ${configFileClause}";
|
2013-11-09 01:38:15 +00:00
|
|
|
};
|
2021-01-30 13:13:39 +00:00
|
|
|
environment.systemPackages = [ cfg.package ];
|
2013-11-09 01:38:15 +00:00
|
|
|
};
|
|
|
|
}
|