2020-04-24 23:36:52 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.xserver.windowManager.herbstluftwm;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
services.xserver.windowManager.herbstluftwm = {
|
|
|
|
enable = mkEnableOption "herbstluftwm";
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.herbstluftwm;
|
2021-10-06 13:57:05 +00:00
|
|
|
defaultText = literalExpression "pkgs.herbstluftwm";
|
2021-02-13 14:23:35 +00:00
|
|
|
description = ''
|
|
|
|
Herbstluftwm package to use.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +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.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
services.xserver.windowManager.session = singleton {
|
|
|
|
name = "herbstluftwm";
|
|
|
|
start =
|
|
|
|
let configFileClause = optionalString
|
|
|
|
(cfg.configFile != null)
|
|
|
|
''-c "${cfg.configFile}"''
|
|
|
|
;
|
2021-02-13 14:23:35 +00:00
|
|
|
in "${cfg.package}/bin/herbstluftwm ${configFileClause}";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2021-02-13 14:23:35 +00:00
|
|
|
environment.systemPackages = [ cfg.package ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|