mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-19 08:31:01 +03:00

After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.
Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.
A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.
This commit was automatically created and can be verified using
nix-build https://github.com/infinisil/treewide-nixpkgs-reformat-script/archive/a08b3a4d199c6124ac5b36a889d9099b4383463f.tar.gz \
--argstr baseRev 0128fbb0a5
result/bin/apply-formatting $NIXPKGS_PATH
83 lines
2.3 KiB
Nix
83 lines
2.3 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" {
|
|
example = "bspwm-unstable";
|
|
};
|
|
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" {
|
|
example = "sxhkd-unstable";
|
|
};
|
|
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 \"${cfg.sxhkd.configFile}\""
|
|
} &
|
|
${cfg.package}/bin/bspwm ${optionalString (cfg.configFile != null) "-c \"${cfg.configFile}\""} &
|
|
waitPID=$!
|
|
'';
|
|
};
|
|
environment.systemPackages = [ cfg.package ];
|
|
};
|
|
|
|
imports = [
|
|
(mkRemovedOptionModule [ "services" "xserver" "windowManager" "bspwm-unstable" "enable" ]
|
|
"Use services.xserver.windowManager.bspwm.enable and set services.xserver.windowManager.bspwm.package to pkgs.bspwm-unstable to use the unstable version of bspwm."
|
|
)
|
|
(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.")
|
|
];
|
|
}
|