1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-29 12:35:10 +03:00
nixpkgs/nixos/modules/services/x11/window-managers/dwm.nix

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

64 lines
1.2 KiB
Nix
Raw Normal View History

2015-12-02 17:27:52 -05:00
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.dwm;
2024-05-30 13:40:49 +02:00
in
{
2015-12-02 17:27:52 -05:00
###### interface
options = {
2022-10-16 19:01:23 +02:00
services.xserver.windowManager.dwm = {
enable = mkEnableOption "dwm";
2023-11-14 15:54:21 +01:00
extraSessionCommands = mkOption {
2024-05-30 13:40:49 +02:00
default = "";
type = types.lines;
2023-11-14 15:54:21 +01:00
description = ''
Shell commands executed just before dwm is started.
'';
};
package = mkPackageOption pkgs "dwm" {
example = ''
2022-10-16 19:01:23 +02:00
pkgs.dwm.overrideAttrs (oldAttrs: rec {
patches = [
(super.fetchpatch {
url = "https://dwm.suckless.org/patches/steam/dwm-steam-6.2.diff";
2023-08-17 21:14:35 +03:00
sha256 = "sha256-f3lffBjz7+0Khyn9c9orzReoLTqBb/9gVGshYARGdVc=";
2022-10-16 19:01:23 +02:00
})
];
})
'';
};
};
2015-12-02 17:27:52 -05:00
};
###### implementation
config = mkIf cfg.enable {
2024-05-30 13:40:49 +02:00
services.xserver.windowManager.session = singleton {
name = "dwm";
start = ''
${cfg.extraSessionCommands}
2023-11-14 15:54:21 +01:00
2024-05-30 13:40:49 +02:00
export _JAVA_AWT_WM_NONREPARENTING=1
dwm &
waitPID=$!
'';
};
2015-12-02 17:27:52 -05:00
2022-10-16 19:01:23 +02:00
environment.systemPackages = [ cfg.package ];
2015-12-02 17:27:52 -05:00
};
}