Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Mako onChange hook causes warnings #6245

Open
2 tasks done
kleifgch opened this issue Dec 30, 2024 · 0 comments
Open
2 tasks done

bug: Mako onChange hook causes warnings #6245

kleifgch opened this issue Dec 30, 2024 · 0 comments
Assignees
Labels
bug triage Issues or feature request that have not been triaged yet

Comments

@kleifgch
Copy link

kleifgch commented Dec 30, 2024

Are you following the right branch?

  • My Nixpkgs and Home Manager versions are in sync

Is there an existing issue for this?

  • I have searched the existing issues

Issue description

I am currently using an impermanence-setup for my home directory,
which means that the onChange hook is executed on every boot during the activation via the systemd service.
At this point, the session bus does apparently not yet exist but makoctl tries to use it leading to:

busctl: Failed to set bus address: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined (consider using --machine=<user>@.host --user to connect to bus of other user)

My current workaround is

xdg.configFile."mako/config".onChange = let
  dbus-send = "${pkgs.dbus}/bin/dbus-send";
  makoctl = "${config.services.mako.package}/bin/makoctl";
  grep = "${pkgs.gnugrep}/bin/grep";
in lib.mkForce ''
  if [[ -v DBUS_SESSION_BUS_ADDRESS ]]; then
    if ${dbus-send} --print-reply --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.GetServerInformation | ${grep} -q "mako"; then
      ${makoctl} reload
    fi
  fi
'';

but i am not sure if this is the best solution compared to e.g. checking that an instance of mako is running by using pgrep.

PS: As far as i understand, this is a similar root cause to #3172

Maintainer CC

@onny

System information

- system: `"x86_64-linux"`
 - host os: `Linux 6.6.63, NixOS, 25.05 (Warbler), 25.05.20241207.22c3f2c`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.24.10`
 - channels(root): `""`
 - nixpkgs: `/nix/store/avxvalb7xf8x4avmrbcvn1vr5yy46kxs-source`
@kleifgch kleifgch added bug triage Issues or feature request that have not been triaged yet labels Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage Issues or feature request that have not been triaged yet
Projects
None yet
Development

No branches or pull requests

4 participants