504525a148
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
40 lines
1 KiB
Nix
40 lines
1 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.services.xserver.windowManager.herbstluftwm;
|
|
in
|
|
|
|
{
|
|
options = {
|
|
services.xserver.windowManager.herbstluftwm = {
|
|
enable = mkEnableOption (lib.mdDoc "herbstluftwm");
|
|
|
|
package = mkPackageOption pkgs "herbstluftwm" { };
|
|
|
|
configFile = mkOption {
|
|
default = null;
|
|
type = with types; nullOr path;
|
|
description = lib.mdDoc ''
|
|
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}"''
|
|
;
|
|
in "${cfg.package}/bin/herbstluftwm ${configFileClause} &";
|
|
};
|
|
environment.systemPackages = [ cfg.package ];
|
|
};
|
|
}
|