Merge pull request #316239 from arjan-s/qtile-sessions
qtile: install proper session .desktop files for both xorg and wayland
This commit is contained in:
commit
7938d40a60
@ -7,6 +7,10 @@ let
|
||||
in
|
||||
|
||||
{
|
||||
imports = [
|
||||
(mkRemovedOptionModule [ "services" "xserver" "windowManager" "qtile" "backend" ] "The qtile package now provides separate display sessions for both X11 and Wayland.")
|
||||
];
|
||||
|
||||
options.services.xserver.windowManager.qtile = {
|
||||
enable = mkEnableOption "qtile";
|
||||
|
||||
@ -22,14 +26,6 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
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 = _: [];
|
||||
@ -57,25 +53,14 @@ in
|
||||
};
|
||||
|
||||
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.qtile.finalPackage = pkgs.python3.pkgs.qtile.override { extraPackages = cfg.extraPackages pkgs.python3.pkgs; };
|
||||
displayManager.sessionPackages = [ cfg.finalPackage ];
|
||||
};
|
||||
|
||||
services.xserver.windowManager.session = [{
|
||||
name = "qtile";
|
||||
start = ''
|
||||
${cfg.finalPackage}/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)
|
||||
];
|
||||
environment = {
|
||||
etc."xdg/qtile/config.py" = mkIf (cfg.configFile != null) { source = cfg.configFile; };
|
||||
systemPackages = [ cfg.finalPackage ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import ./make-test-python.nix ({ lib, ...} : {
|
||||
test-support.displayManager.auto.user = "alice";
|
||||
|
||||
services.xserver.windowManager.qtile.enable = true;
|
||||
services.displayManager.defaultSession = lib.mkForce "none+qtile";
|
||||
services.displayManager.defaultSession = lib.mkForce "qtile";
|
||||
|
||||
environment.systemPackages = [ pkgs.kitty ];
|
||||
};
|
||||
|
@ -30,6 +30,7 @@
|
||||
xcffib,
|
||||
xkbcommon,
|
||||
nixosTests,
|
||||
extraPackages ? [ ],
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
@ -66,7 +67,7 @@ buildPythonPackage rec {
|
||||
pkg-config
|
||||
];
|
||||
|
||||
dependencies = [
|
||||
dependencies = extraPackages ++ [
|
||||
(cairocffi.override { withXcffib = true; })
|
||||
dbus-next
|
||||
iwlib
|
||||
@ -97,6 +98,11 @@ buildPythonPackage rec {
|
||||
providedSessions = [ "qtile" ];
|
||||
};
|
||||
|
||||
postInstall = ''
|
||||
install resources/qtile.desktop -Dt $out/share/xsessions
|
||||
install resources/qtile-wayland.desktop -Dt $out/share/wayland-sessions
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "http://www.qtile.org/";
|
||||
license = licenses.mit;
|
||||
|
@ -1,8 +0,0 @@
|
||||
{ python3 }:
|
||||
|
||||
(python3.withPackages (_: [ python3.pkgs.qtile ])).overrideAttrs (_: {
|
||||
# restore some qtile attrs, beautify name
|
||||
inherit (python3.pkgs.qtile) pname version meta;
|
||||
name = with python3.pkgs.qtile; "${pname}-${version}";
|
||||
passthru.unwrapped = python3.pkgs.qtile;
|
||||
})
|
@ -35074,8 +35074,6 @@ with pkgs;
|
||||
|
||||
qpdfview = libsForQt5.callPackage ../applications/office/qpdfview { };
|
||||
|
||||
qtile = callPackage ../development/python-modules/qtile/wrapper.nix { };
|
||||
|
||||
vimgolf = callPackage ../games/vimgolf { };
|
||||
|
||||
vimpc = callPackage ../applications/audio/vimpc { };
|
||||
|
Loading…
Reference in New Issue
Block a user