From 5a79eacaff96316e123fc98a700ee5fa84fc80c9 Mon Sep 17 00:00:00 2001 From: Frantisek Bohacek Date: Fri, 19 Jul 2024 19:05:54 +0200 Subject: [PATCH] feat: disable qtile --- .../profiles/desktop/qtile/launcher.nix | 2 +- .../profiles/desktop/qtile/services.nix | 28 +++++++++++++++++-- nixos/hosts/laptop-phobos/default.nix | 2 +- nixos/hosts/laptop-phobos/home.nix | 2 +- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/home/modules/profiles/desktop/qtile/launcher.nix b/home/modules/profiles/desktop/qtile/launcher.nix index ad05f35..369f79b 100644 --- a/home/modules/profiles/desktop/qtile/launcher.nix +++ b/home/modules/profiles/desktop/qtile/launcher.nix @@ -11,7 +11,7 @@ let }; in { - config = lib.mkIf config.profiles.desktop.qtile.enable { + config = lib.mkIf (config.profiles.desktop.qtile.enable || config.profiles.desktop.dwl.enable) { home.packages = [ pkgs.rofi-power-menu ]; diff --git a/home/modules/profiles/desktop/qtile/services.nix b/home/modules/profiles/desktop/qtile/services.nix index 009c688..76de4e5 100644 --- a/home/modules/profiles/desktop/qtile/services.nix +++ b/home/modules/profiles/desktop/qtile/services.nix @@ -8,8 +8,30 @@ let mpris-ctl = inputs.self.packages.${pkgs.system}.mpris-ctl; sequence-detector = inputs.self.packages.${pkgs.system}.sequence-detector; + + getDunstDbusServicePath = pkg: "${pkg}/share/dbus-1/services/org.knopwob.dunst.service"; + dunst = pkgs.symlinkJoin { + name = "dunst-wrapped"; + paths = [ pkgs.dunst ]; + postBuild = '' + mv $out/bin/dunst $out/bin/.dunst + echo "#!${pkgs.runtimeShell}" > "$out/bin/dunst" + echo "Dunst wrapper..." + echo "WAYLAND_DISPLAY, DISPLAY" + echo "${lib.getExe' pkgs.coreutils "printenv"} WAYLAND_DISPLAY DISPLAY" >> "$out/bin/dunst" + echo "exec $out/bin/.dunst \"$@\"" >> $out/bin/dunst + chmod +x $out/bin/dunst + + dbusServicePath="${getDunstDbusServicePath "$out"}" + dbusRealServicePath=$(readlink "$dbusServicePath") + rm "$dbusServicePath" + cp "$dbusRealServicePath" "$dbusServicePath" + substituteInPlace "$dbusServicePath" \ + --replace-fail "${pkgs.dunst}" "$out" + ''; + }; in { - config = lib.mkIf config.profiles.desktop.qtile.enable { + config = lib.mkIf (config.profiles.desktop.qtile.enable || config.profiles.desktop.dwl.enable) { home.packages = lib.mkMerge [ (lib.mkIf config.services.dunst.enable [ pkgs.libnotify ]) @@ -161,6 +183,9 @@ in { }; }; + xdg.dataFile."dbus-1/services/org.knopwob.dunst.service".source = lib.mkForce (getDunstDbusServicePath dunst); + services.dunst.package = dunst; + systemd.user.services = { mpris-ctld = { Unit = { @@ -198,7 +223,6 @@ in { Install.WantedBy = lib.mkForce [ "xorg-wm-services.target" ]; }; - xdg.dataFile."dbus-1/services/org.knopwob.dunst.service".source = "${pkgs.dunst}/share/dbus-1/services/org.knopwob.dunst.service"; dunst = lib.mkIf config.services.dunst.enable { Unit = { PartOf = lib.mkForce [ "wm-services.target" ]; diff --git a/nixos/hosts/laptop-phobos/default.nix b/nixos/hosts/laptop-phobos/default.nix index 75752fa..9976021 100644 --- a/nixos/hosts/laptop-phobos/default.nix +++ b/nixos/hosts/laptop-phobos/default.nix @@ -25,7 +25,7 @@ nixos-config.isLaptop = true; profiles.virtualisation.enable = true; - profiles.desktop.qtile.enable = true; + # profiles.desktop.qtile.enable = true; profiles.vpn.enable = true; profiles.sync.enable = true; profiles.development = { diff --git a/nixos/hosts/laptop-phobos/home.nix b/nixos/hosts/laptop-phobos/home.nix index dd1fb44..b5cca2a 100644 --- a/nixos/hosts/laptop-phobos/home.nix +++ b/nixos/hosts/laptop-phobos/home.nix @@ -11,7 +11,7 @@ let ]; in { profiles.development.enable = true; - profiles.desktop.qtile.enable = true; + # profiles.desktop.qtile.enable = true; profiles.desktop.dwl.enable = true; profiles.matrix.enable = true; -- 2.48.1