summary refs log tree commit diff
path: root/nixos/modules/services/x11/window-managers/qtile.nix
blob: fc27566d49ee6d47cec2f0872a142cff508839f8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{ config, lib, pkgs, ... }:

with lib;

let
  cfg = config.services.xserver.windowManager.qtile;
in

{
  options.services.xserver.windowManager.qtile = {
    enable = mkEnableOption (lib.mdDoc "qtile");

    package = mkPackageOptionMD pkgs "qtile" { };
  };

  config = mkIf cfg.enable {
    services.xserver.windowManager.session = [{
      name = "qtile";
      start = ''
        ${cfg.package}/bin/qtile start &
        waitPID=$!
      '';
    }];

    environment.systemPackages = [
      # pkgs.qtile is currently a buildenv of qtile and its dependencies.
      # For userland commands, we want the underlying package so that
      # packages such as python don't bleed into userland and overwrite intended behavior.
      (cfg.package.unwrapped or cfg.package)
    ];
  };
}