outfoxxed/hy3

"undefined variable 'hy3'" when following Manual (Nix) instructions without home-manager

bobdanek opened this issue · 4 comments

I'm on NixOS unstable (24.05), running Hyprland v0.34.0, but not using either home-manager nor flakes. If I add the following to my configuration.nix it throws error: undefined variable 'hy3' when I rebuild:

wayland.windowManager.hyprland = {
  # ...
  extraConfig = ''
    plugin = ${hy3.packages.x86_64-linux.hy3}/lib/libhy3.so
  '';
};

I have hyprlandPlugins.hy3 in my environment.systemPackages = with pkgs; []. I also tried just hy3 for the package name and get the same error.

It's entirely possible I'm doing something wrong or missing some step. But I'm really trying to avoid flakes and home-manager at the moment.

Try either of:

wayland.windowManager.hyprland = {
  # Qualify `pkgs.hyprlandPlugins.hy3`.
  extraConfig = ''
    plugin = ${pkgs.hyprlandPlugins.hy3}/lib/libhy3.so
  '';
};

or

# Use `pkgs` scope.
wayland.windowManager.hyprland = with pkgs.hyprlandPlugins; {
  extraConfig = ''
    plugin = ${hy3}/lib/libhy3.so
  '';
};

Does that solve it?

Thanks for the quick reply! Unfortunately no, I'm now getting The option wayland' does not exist.` with either of those

wayland.windowManager is options inside of Home Manager, so that might be the reason.

If you're not using Home Manager at all, you'll need to create your own plugin = ... line in your configuration file.

Since the path isn't easy to guess without having Nix setting things up for you, this might end up being pretty annoying for you.

One way to work around that might be to generate an environment variable and then use that somehow.

environment.sessionVariables.HY3_SO_PATH = "${pkgs.hyprlandPlugins.hy3}/lib/libhy3.so"

I don't think this might be be right place for you to ask for Nix support, sadly. Maybe you should invest in the Nix Discourse or find a IRC/Discord server to ask Nix questions in? I think they would be better equipped to help you.

AFAIK this repo is only really set up to help users that use either Flakes and/or Home Manager.

That's entirely fair. Thanks for the help! (And feel free to close this issue)