How to refer to a package bin installed from flake?

I’m writing a systemd service and to point to the bin of the daemon to run but it was installed via a flake so ${pkgs.lan-mouse} won’t to it (it pulls the one from nixpkgs).

How to I do the equivalent for the flake version of lan-mouse? (and the home-manager module systemd = true; option doesn’t work because I’m not using sway nor hyprland)

Looks like ${inputs.lan-mouse.packages.x86_64-linux.default} did the trick

Slightly more generic is:

{ pkgs, ... }: {

  # Wherver the binary is used
  ${inputs.lan-mouse.packages.${pkgs.stdenv.hostPlatform.system}.default}
}
2 Likes