alpha
Login
or
Join now
lass.pds.lassul.us
/
superconfig
Star
0
Fork
1
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
1
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
1
Pipelines
qtile: refactor some stuff
author
lassulus
date
1 year ago
(Jun 3, 2025, 5:41 AM CEST)
commit
f205d44e
f205d44e761b275f74c270c1a2dd10276aac1598
parent
ab76cf42
ab76cf42f023495148bebce9fa074e64c759b705
+117
-73
2 changed files
Expand all
Collapse all
Unified
Split
2configs
desktops
lib
wayland.nix
qtile
nixos.nix
+45
-9
2configs/desktops/lib/wayland.nix
View file
Reviewed
···
39
39
];
40
40
41
41
xdg.portal.enable = true;
42
42
-
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
43
43
-
xdg.portal.wlr.enable = true;
44
44
-
xdg.portal.config.common.default = "*"; # get old behavior back
42
42
+
xdg.portal.extraPortals = [
43
43
+
pkgs.xdg-desktop-portal-gtk
44
44
+
pkgs.xdg-desktop-portal-wlr
45
45
+
];
46
46
+
# xdg.portal.wlr.enable = true;
47
47
+
xdg.portal.config.common.default = "wlr";
45
48
fonts.enableDefaultPackages = true;
46
49
47
50
security.polkit.enable = true;
···
64
67
programs.wshowkeys.enable = true;
65
68
66
69
environment.systemPackages = with pkgs; [
67
67
-
(gamescope.overrideAttrs (old: {
68
68
-
patches = old.patches ++ [
69
69
-
./gamescope_libinput.patch
70
70
-
];
71
71
-
72
72
-
}))
70
70
+
# (gamescope.overrideAttrs (old: {
71
71
+
# patches = old.patches ++ [
72
72
+
# ./gamescope_libinput.patch
73
73
+
# ];
74
74
+
#
75
75
+
# }))
73
76
swaylock-effects # lockscreen
74
77
pavucontrol
75
78
swayidle
···
128
131
];
129
132
130
133
qt.platformTheme = "qt5ct";
134
134
+
135
135
+
security.pam.services.swaylock = { };
136
136
+
security.pam.services.swaylock.fprintAuth = true;
137
137
+
138
138
+
# from nixpkgs/nixos/modules/services/system/systemd-lock-handler.md
139
139
+
services.systemd-lock-handler.enable = true;
140
140
+
141
141
+
systemd.user.services.swaylock = {
142
142
+
description = "Screen locker for Wayland";
143
143
+
documentation = [ "man:swaylock(1)" ];
144
144
+
145
145
+
# If swaylock exits cleanly, unlock the session:
146
146
+
onSuccess = [ "unlock.target" ];
147
147
+
148
148
+
# When lock.target is stopped, stops this too:
149
149
+
partOf = [ "lock.target" ];
150
150
+
151
151
+
# Delay lock.target until this service is ready:
152
152
+
before = [ "lock.target" ];
153
153
+
wantedBy = [ "lock.target" ];
154
154
+
155
155
+
serviceConfig = {
156
156
+
# systemd will consider this service started when swaylock forks...
157
157
+
Type = "forking";
158
158
+
159
159
+
# ... and swaylock will fork only after it has locked the screen.
160
160
+
ExecStart = "${lib.getExe pkgs.swaylock} --image /var/lib/wallpaper/wallpaper -f";
161
161
+
162
162
+
# If swaylock crashes, always restart it immediately:
163
163
+
Restart = "on-failure";
164
164
+
RestartSec = 0;
165
165
+
};
166
166
+
};
131
167
}
+72
-64
2configs/desktops/qtile/nixos.nix
View file
Reviewed
···
1
1
{ pkgs, lib, ... }:
2
2
let
3
3
-
qtile = (pkgs.python3.pkgs.qtile.override {
4
4
-
pulsectl-asyncio = pkgs.python3.pkgs.pulsectl-asyncio.overrideAttrs (oldAttrs: {
5
5
-
postPatch = ''
6
6
-
substituteInPlace setup.cfg --replace "pulsectl >=23.5.0,<=24.11.0" "pulsectl >=23.5.0"
7
7
-
'';
8
8
-
});
9
9
-
extraPackages = [
10
10
-
pkgs.python3.pkgs.dbus-fast
11
11
-
];
12
12
-
}).overrideAttrs (oldAttrs: {
13
13
-
pname = "qtile-0.31.0";
14
14
-
version = "0.31.0";
15
15
-
src = pkgs.fetchFromGitHub {
16
16
-
owner = "qtile";
17
17
-
repo = "qtile";
18
18
-
tag = "v0.31.0";
19
19
-
hash = "sha256-EqrvBXigMjevPERTcz3EXSRaZP2xSEsOxjuiJ/5QOz0=";
20
20
-
};
21
21
-
});
3
3
+
# qtile =
4
4
+
# (pkgs.python3.pkgs.qtile.override {
5
5
+
# pulsectl-asyncio = pkgs.python3.pkgs.pulsectl-asyncio.overrideAttrs (_oldAttrs: {
6
6
+
# postPatch = ''
7
7
+
# substituteInPlace setup.cfg --replace "pulsectl >=23.5.0,<=24.11.0" "pulsectl >=23.5.0"
8
8
+
# '';
9
9
+
# });
10
10
+
# extraPackages = [
11
11
+
# pkgs.python3.pkgs.dbus-fast
12
12
+
# pkgs.python3.pkgs.dbus-next
13
13
+
# ];
14
14
+
# }).overrideAttrs
15
15
+
# (_oldAttrs: {
16
16
+
# pname = "qtile-0.31.0";
17
17
+
# version = "0.31.0";
18
18
+
# src = pkgs.fetchFromGitHub {
19
19
+
# owner = "qtile";
20
20
+
# repo = "qtile";
21
21
+
# tag = "v0.31.0";
22
22
+
# hash = "sha256-EqrvBXigMjevPERTcz3EXSRaZP2xSEsOxjuiJ/5QOz0=";
23
23
+
# };
24
24
+
# });
22
25
# qtile-extras = pkgs.python3.pkgs.qtile-extras.override {
23
26
# qtile = qtile;
24
27
# };
28
28
+
pyEnv = pkgs.python3.withPackages (p: [
29
29
+
p.qtile
30
30
+
# qtile-extras
31
31
+
p.iwlib
32
32
+
p.ipython
33
33
+
]);
25
34
in
26
35
{
27
36
imports = [
···
31
40
environment.sessionVariables.XDG_CURRENT_DESKTOP = "qtile";
32
41
services.greetd.enable = true;
33
42
34
34
-
security.pam.services.swaylock = {};
43
43
+
security.pam.services.swaylock = { };
35
44
security.pam.services.swaylock.fprintAuth = true;
36
45
37
46
# For greetd, we need a shell script into path, which lets us start qtile.service (after importing the environment of the login shell).
38
38
-
services.greetd.settings.default_session.command = "${pkgs.greetd.tuigreet}/bin/tuigreet --remember --cmd ${pkgs.writeScript "startqtile" ''
39
39
-
#! ${pkgs.bash}/bin/bash
47
47
+
services.greetd.settings.default_session.command =
48
48
+
"${pkgs.greetd.tuigreet}/bin/tuigreet --remember --cmd ${pkgs.writeScript "startqtile" ''
49
49
+
#! ${pkgs.bash}/bin/bash
40
50
41
41
-
# first import environment variables from the login manager
42
42
-
export XDG_DATA_DIRS=/run/current-system/sw/share/gsettings-schemas:$XDG_DATA_DIRS
43
43
-
systemctl --user unset-environment DISPLAY WAYLAND_DISPLAY
44
44
-
systemctl --user import-environment XDG_DATA_DIRS PATH
45
45
-
# then start the service
46
46
-
exec systemctl --user --wait start qtile.service
47
47
-
''}";
51
51
+
# first import environment variables from the login manager
52
52
+
export XDG_DATA_DIRS=/run/current-system/sw/share/gsettings-schemas:$XDG_DATA_DIRS
53
53
+
systemctl --user unset-environment DISPLAY WAYLAND_DISPLAY
54
54
+
systemctl --user import-environment XDG_DATA_DIRS PATH
55
55
+
# then start the service
56
56
+
exec systemctl --user --wait start qtile.service
57
57
+
''}";
48
58
49
59
systemd.user.targets.qtile-session = {
50
60
description = "Qtile compositor session";
···
55
65
};
56
66
57
67
environment.systemPackages = [
58
58
-
qtile
59
68
pkgs.copyq
60
69
pkgs.coreutils
70
70
+
(pkgs.writers.writeDashBin "qtile-debug-shell" { } ''
71
71
+
${pyEnv}/bin/ipython "$@"
72
72
+
'')
61
73
];
62
74
63
63
-
systemd.user.services.qtile =
64
64
-
let
65
65
-
pyEnv = pkgs.python3.withPackages (_p: [
66
66
-
qtile
67
67
-
# qtile-extras
68
68
-
pkgs.python3.pkgs.iwlib
69
69
-
]);
70
70
-
in
71
71
-
{
72
72
-
description = "Qtile - Wayland window manager";
73
73
-
documentation = [ "man:qtile(5)" ];
74
74
-
bindsTo = [ "graphical-session.target" ];
75
75
-
wants = [ "graphical-session-pre.target" ];
76
76
-
after = [ "graphical-session-pre.target" ];
77
77
-
# We explicitly unset PATH here, as we want it to be set by
78
78
-
# systemctl --user import-environment in startqtile
79
79
-
environment.PATH = lib.mkForce null;
80
80
-
environment.PYTHONPATH = lib.mkForce null;
81
81
-
environment.PYTHONTRACEMALLOC = "1";
82
82
-
serviceConfig = {
83
83
-
Type = "simple";
84
84
-
ExecStart = "${pyEnv}/bin/qtile start -b wayland -c /etc/qtile.py";
85
85
-
Restart = "on-failure";
86
86
-
RestartSec = 1;
87
87
-
TimeoutStopSec = 10;
88
88
-
};
89
89
-
};
90
90
-
91
91
-
environment.etc."qtile.py".source = ./qtile.py;
92
92
-
93
93
-
systemd.user.services.xwayland-satellite = {
94
94
-
wantedBy = [ "graphical-session.target" ];
75
75
+
systemd.user.services.qtile = {
76
76
+
description = "Qtile - Wayland window manager";
77
77
+
documentation = [ "man:qtile(5)" ];
78
78
+
bindsTo = [ "graphical-session.target" ];
79
79
+
wants = [ "graphical-session-pre.target" ];
80
80
+
after = [ "graphical-session-pre.target" ];
81
81
+
# We explicitly unset PATH here, as we want it to be set by
82
82
+
# systemctl --user import-environment in startqtile
83
83
+
environment.PATH = lib.mkForce null;
84
84
+
environment.PYTHONPATH = lib.mkForce null;
85
85
+
environment.PYTHONTRACEMALLOC = "1";
95
86
serviceConfig = {
96
96
-
RestartSec = 5;
97
97
-
ExecStart = "${pkgs.xwayland}/bin/xwayland-satellite";
87
87
+
Type = "simple";
88
88
+
ExecStart = "${pyEnv}/bin/qtile start -b wayland -c /etc/qtile.py";
89
89
+
Restart = "on-failure";
90
90
+
RestartSec = 1;
91
91
+
TimeoutStopSec = 10;
98
92
};
99
93
};
100
94
95
95
+
environment.etc."qtile.py".source = ./qtile.py;
96
96
+
97
97
+
programs.xwayland.enable = true;
98
98
+
# systemd.user.services.xwayland-satellite = {
99
99
+
# wantedBy = [ "graphical-session.target" ];
100
100
+
# after = [ "qtile.service" ];
101
101
+
# serviceConfig = {
102
102
+
# RestartSec = 5;
103
103
+
# ExecStart = "${pkgs.xwayland-satellite}/bin/xwayland-satellite";
104
104
+
# };
105
105
+
# };
106
106
+
101
107
systemd.user.services.copyq = {
102
108
wantedBy = [ "graphical-session.target" ];
109
109
+
after = [ "qtile.service" ];
103
110
serviceConfig = {
111
111
+
Restart = "always";
104
112
RestartSec = 5;
105
113
ExecStart = "${pkgs.copyq}/bin/copyq";
106
114
};