I have a NixOS configuration using a Nix Flake. My configuration is split into different modules that add packages and settings.
Right now my configuration imports a file that includes all my packages, and another that configures Hyprland. I am on a HiDPI display so I am using environment variables tohttps://nixos.wiki/wiki/Nix_Cookbook#Wrapping_packages scale xwayland apps at 2x, but setting this globally causes some issues, so I am wrapping the packages.
The issue I’m running into is that if the apps that are wrapped are also included in my packages, the wrap will not work, as the standard package seems to be first in my path.
For example
(pkgs.symlinkJoin {
name = "discord-canary";
paths = [ pkgs.discord-canary];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/opt/DiscordCanary/DiscordCanary --set GDK_SCALE 2 --set XCURSOR_SIZE 64
'';
})
does not work if discord-canary is installed in another file.
I wanted to use overlays, as I assume that would make the declaration in the other file install the overlay. I tried this:
(self: super: {
discord-canary = pkgs.symlinkJoin {
name = "discord-canary";
paths = [ pkgs.discord-canary];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/opt/DiscordCanary/DiscordCanary --set GDK_SCALE 2 --set XCURSOR_SIZE 64
'';
};
})
However, because this refers to discord-canary in the package declaration, it gives an infinite recursion error.
Is there any way to declaratively wrap packages that are installed in another file?