nixpkgs/nixos/modules/services/x11/window-managers/herbstluftwm.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1.2 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
2013-11-09 01:38:15 +00:00
with lib;
2013-11-09 01:38:15 +00:00
let
cfg = config.services.xserver.windowManager.herbstluftwm;
in
{
options = {
services.xserver.windowManager.herbstluftwm = {
enable = mkEnableOption "herbstluftwm";
package = mkOption {
type = types.package;
default = pkgs.herbstluftwm;
defaultText = literalExpression "pkgs.herbstluftwm";
description = ''
Herbstluftwm package to use.
'';
};
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";
start =
let configFileClause = optionalString
(cfg.configFile != null)
''-c "${cfg.configFile}"''
;
in "${cfg.package}/bin/herbstluftwm ${configFileClause}";
2013-11-09 01:38:15 +00:00
};
environment.systemPackages = [ cfg.package ];
2013-11-09 01:38:15 +00:00
};
}