aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/nixos/modules/services/x11/window-managers/herbstluftwm.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/modules/services/x11/window-managers/herbstluftwm.nix')
-rw-r--r--nixpkgs/nixos/modules/services/x11/window-managers/herbstluftwm.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/nixpkgs/nixos/modules/services/x11/window-managers/herbstluftwm.nix b/nixpkgs/nixos/modules/services/x11/window-managers/herbstluftwm.nix
new file mode 100644
index 00000000000..e3ea61cb9a6
--- /dev/null
+++ b/nixpkgs/nixos/modules/services/x11/window-managers/herbstluftwm.nix
@@ -0,0 +1,38 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+ cfg = config.services.xserver.windowManager.herbstluftwm;
+in
+
+{
+ options = {
+ 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 =
+ let configFileClause = optionalString
+ (cfg.configFile != null)
+ ''-c "${cfg.configFile}"''
+ ;
+ in "${pkgs.herbstluftwm}/bin/herbstluftwm ${configFileClause}";
+ };
+ environment.systemPackages = [ pkgs.herbstluftwm ];
+ };
+}