nixos/qtile: add finalPackage option

This exposes the resulting Qtile bundle in case the user wants to start
Qtile session different than with a login manager
This commit is contained in:
Acid Bong 2024-04-26 19:43:07 +03:00
parent 637f958ce9
commit abdeca343a
No known key found for this signature in database

View File

@ -4,7 +4,6 @@ with lib;
let
cfg = config.services.xserver.windowManager.qtile;
pyEnv = pkgs.python3.withPackages (p: [ (cfg.package.unwrapped or cfg.package) ] ++ (cfg.extraPackages p));
in
{
@ -48,13 +47,24 @@ in
];
'';
};
finalPackage = mkOption {
type = types.package;
visible = false;
readOnly = true;
description = "The resulting Qtile package, bundled with extra packages";
};
};
config = mkIf cfg.enable {
services.xserver.windowManager.qtile.finalPackage = pkgs.python3.withPackages (p:
[ (cfg.package.unwrapped or cfg.package) ] ++ (cfg.extraPackages p)
);
services.xserver.windowManager.session = [{
name = "qtile";
start = ''
${pyEnv}/bin/qtile start -b ${cfg.backend} \
${cfg.finalPackage}/bin/qtile start -b ${cfg.backend} \
${optionalString (cfg.configFile != null)
"--config \"${cfg.configFile}\""} &
waitPID=$!