This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

qtile: refactor some stuff

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