Soundfonts not included in current-system

Hello,
I wanted to install some soundfonts to my system, but I ran into a problem with them not showing up in my current system at all.
The soundfonts were added to config.environment.systemPackages

environment.systemPackages = with pkgs; [
    # other stuff...
    #soundfonts
    soundfont-ydp-grand
    soundfont-fluid
    soundfont-arachno
    soundfont-generaluser
  ];

What I would expect is the soundfont files being linked into /run/current-system/sw/share/soundfonts but this directory does not exist for my system. The derivations are however build
in the nix store.

When I query the referrers of the soundfont with

nix-store --query --referers /nix/store/vsxpm1vv12nb62xagmny0yd13in1xqxa-Fluid-3

I get references from lutris in my home manager profile, but not in my system profile.
Querying config.environment.systemPackages with nix eval/repl does show the derivations included.

So the packages are downloaded into the store but for some reason do not end up in the system derivation.

Does anybody know what could be the reason for this?

I think you need to tell NixOS that you want these things under /run/current-system/sw. Try adding this to your system configuration:

environment.pathsToLink = [ "/share/soundfonts" ];

This should make NixOS link all output paths that have a /share/soundfonts file to current-system.

1 Like

Yes that was it, thank you!