Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

79 lines
2.0 KiB
Nix

{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.bspwm;
in
{
options = {
services.xserver.windowManager.bspwm = {
enable = mkEnableOption "bspwm";
package = mkPackageOption pkgs "bspwm" { };
configFile = mkOption {
type = with types; nullOr path;
example = literalExpression ''"''${pkgs.bspwm}/share/doc/bspwm/examples/bspwmrc"'';
default = null;
description = ''
Path to the bspwm configuration file.
If null, $HOME/.config/bspwm/bspwmrc will be used.
'';
};
sxhkd = {
package = mkPackageOption pkgs "sxhkd" { };
configFile = mkOption {
type = with types; nullOr path;
example = literalExpression ''"''${pkgs.bspwm}/share/doc/bspwm/examples/sxhkdrc"'';
default = null;
description = ''
Path to the sxhkd configuration file.
If null, $HOME/.config/sxhkd/sxhkdrc will be used.
'';
};
};
};
};
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "bspwm";
start = ''
export _JAVA_AWT_WM_NONREPARENTING=1
SXHKD_SHELL=/bin/sh ${cfg.sxhkd.package}/bin/sxhkd ${
optionalString (cfg.sxhkd.configFile != null) "-c ${escapeShellArg cfg.sxhkd.configFile}"
} &
${cfg.package}/bin/bspwm ${
optionalString (cfg.configFile != null) "-c ${escapeShellArg cfg.configFile}"
} &
waitPID=$!
'';
};
environment.systemPackages = [ cfg.package ];
};
imports = [
(mkRemovedOptionModule [
"services"
"xserver"
"windowManager"
"bspwm"
"startThroughSession"
] "bspwm package does not provide bspwm-session anymore.")
(mkRemovedOptionModule [
"services"
"xserver"
"windowManager"
"bspwm"
"sessionScript"
] "bspwm package does not provide bspwm-session anymore.")
];
}