nixpkgs/nixos/modules/services/x11/window-managers/qtile.nix
stuebinm 6afb255d97 nixos: remove all uses of lib.mdDoc
these changes were generated with nixq 0.0.2, by running

  nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix

two mentions of the mdDoc function remain in nixos/, both of which
are inside of comments.

Since lib.mdDoc is already defined as just id, this commit is a no-op as
far as Nix (and the built manual) is concerned.
2024-04-13 10:07:35 -07:00

72 lines
2.0 KiB
Nix

{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.services.xserver.windowManager.qtile;
pyEnv = pkgs.python3.withPackages (p: [ (cfg.package.unwrapped or cfg.package) ] ++ (cfg.extraPackages p));
in
{
options.services.xserver.windowManager.qtile = {
enable = mkEnableOption "qtile";
package = mkPackageOption pkgs "qtile-unwrapped" { };
configFile = mkOption {
type = with types; nullOr path;
default = null;
example = literalExpression "./your_config.py";
description = ''
Path to the qtile configuration file.
If null, $XDG_CONFIG_HOME/qtile/config.py will be used.
'';
};
backend = mkOption {
type = types.enum [ "x11" "wayland" ];
default = "x11";
description = ''
Backend to use in qtile: `x11` or `wayland`.
'';
};
extraPackages = mkOption {
type = types.functionTo (types.listOf types.package);
default = _: [];
defaultText = literalExpression ''
python3Packages: with python3Packages; [];
'';
description = ''
Extra Python packages available to Qtile.
An example would be to include `python3Packages.qtile-extras`
for additional unofficial widgets.
'';
example = literalExpression ''
python3Packages: with python3Packages; [
qtile-extras
];
'';
};
};
config = mkIf cfg.enable {
services.xserver.windowManager.session = [{
name = "qtile";
start = ''
${pyEnv}/bin/qtile start -b ${cfg.backend} \
${optionalString (cfg.configFile != null)
"--config \"${cfg.configFile}\""} &
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)
];
};
}