this post was submitted on 27 Nov 2025
6 points (87.5% liked)

Nix / NixOS

2556 readers
1 users here now

Main links

Videos

founded 2 years ago
MODERATORS
 

I've been trying to run native linux games with lutris but can't get it to work. As far as ik, i can either use steam-app in my termianl, which works, or I can use nix-ld which i did setup and also works when running the game's executable from the terminal

I've setup nix-ld like so:

  programs.nix-ld = {
      enable = true;

      libraries = [(pkgs.runCommand "steamrun-lib" {}
  "mkdir $out; ln -s ${pkgs.steam-run.fhsenv}/usr/lib64 $out/lib")];
};

But for some reasons, when running the game's executable in lutris, it just fails instantly, and I'm kinda out of ideas, if anyone knows what to do that'd be real helpful please

Edit: Ok well apparently it just solved itself ??? I realized i could install lutis using programs.lutris.enable = true; instead of just putting it in home.packages, and apparently it fixed the issue. Idk why or how but ig if u use home manager, insall lutris like so

top 16 comments
sorted by: hot top controversial new old
[–] priapus@piefed.social 3 points 1 month ago* (last edited 1 month ago) (1 children)

How are you adding the game to lutris? Are you running it through nix-ld/steam-run inside lutris? Can you share an example of a game you're trying to run?

Edit: I hadn't run a native game through Lutris in a while so I grabbed a random one to make sure it hasn't just suddenly stopped working. I downloaded a couple from GOG and each is working as expected, so this sounds like it's most likely a configuration issue, not the Lutris package itself. Make sure you have "Disable Lutris runtime" checked off and "Prefer system libraries" checked on.

[–] claymorwan@lemmy.blahaj.zone 1 points 1 month ago (1 children)

Nope im not running them inside lutris, just thought if i had nix-ld enabled it'd work but apparently not

I did check, "Disable Lutris runtime" is checked off and "Prefer system libraries" is checked on, still doesn't work and dies with an exit code 134

[–] priapus@piefed.social 2 points 1 month ago (1 children)

Could you share the logs from Lutris?

[–] claymorwan@lemmy.blahaj.zone 1 points 4 weeks ago

Ok well i was abt to get the logs and just realized that the one game i choosed to try is literally the only one who doesn't wanna work in lutris so far. I've tried a few more native linux games with lutris and they all work, ig lutris just hates this first game in particular, which oddly enoug works with steam-run.

I suppose if i add the libraries from steam-run to lutris' fhs environment it'll work maybe Alsothe lutris logs does't say anythingi particular, just that the game closed too fast

[–] hallettj@leminal.space 3 points 1 month ago (1 children)

My understanding is that the NixOS Lutris package runs with a virtual FHS that is built with a selection of libraries for running Wine. I think that might mean it doesn't hook up libraries that are configured with nix-ld. If the game runs with steam-app, but not with Lutris, then it sounds like there's a library missing from the Lutris FHS.

You can override to fix that. Looking at the game logs could give you information about which libraries are missing. Or you could add in everything that steam-app uses, the way you configured nix-ld.

There's a configuration snippet that might point you in the right direction in this thread: https://discourse.nixos.org/t/nix-overlay-to-change-fhs-environment/54139/2

[–] claymorwan@lemmy.blahaj.zone 2 points 1 month ago (2 children)

I did notice lutris having its own FHS when upgrading, but aw man this looks pretty dam complicated, I'm like a week old to NixOS I have no idea how imma do this lmao, i did attempt the following

failed attemps

home.packages = with pkgs; [
 lutris.overrideAttrs (finalAttrs: previousAttrs: {
      multiPkgs = self ++ [(pkgs.runCommand "steamrun-lib" {}
  "mkdir $out; ln -s ${pkgs.steam-run.fhsenv}/usr/lib64 $out/lib")];
    })
];

and

home.packages = with pkgs; [
 lutris.override {
      buildFHSEnv = self.buildFHSEnv.override {
        multiPkgs = self ++ [(pkgs.runCommand "steamrun-lib" {}
  "mkdir $out; ln -s ${pkgs.steam-run.fhsenv}/usr/lib64 $out/lib")];
      };
    }
];
which obviously didn't work, so yea im kinda lost I'm also really surprised that lutris' FHS just does not have anything to run native linux game by default
[–] Oinks@lemmy.blahaj.zone 2 points 1 month ago* (last edited 1 month ago) (1 children)

Untested but I think you want this expression:

home.packages = with pkgs; [
  (lutris.overrideAttrs (_: prevAttrs: {
    multiPkgs = prevAttrs.multiPkgs ++ [
      (pkgs.runCommand "steamrun-lib" { } ''
        mkdir "$out"
        ln -s "${pkgs.steam-run.fhsenv}"/usr/lib64 "$out"/lib
      '')
    ];
  }))
];

Note the extra parenthesis and use of prevAttrs to get the original multiPkgs to append to.

[–] claymorwan@lemmy.blahaj.zone 2 points 4 weeks ago (1 children)

returns this error

error: attribute 'multiPkgs' missing
        at /nix/store/j9lcrp816krraglnjk6r8iacl6jvww87-source/nixos/modules/home/packages.nix:24:19:
            23|     (lutris.overrideAttrs (_: prevAttrs: {
            24|       multiPkgs = prevAttrs.multiPkgs ++ [
              |                   ^
            25|         (pkgs.runCommand "steamrun-lib" { } ''

if i were to guess maybe cuz multiPkgs is defined in fhsenv.nix in not in default.nix, could be wring tho im pretty new to nix packaging

[–] Oinks@lemmy.blahaj.zone 1 points 4 weeks ago* (last edited 4 weeks ago)

No, you are getting the correct Lutris derivation, but it seems like you can't override buildFHSEnv in this way (unlike a regular derivation) which is unfortunate. Looking at it again the package takes an extraLibraries parameter (but it's a function taking a pkgs argument and producing a list, not a bare list). In principle this should work:

home.packages = with pkgs; [
  (lutris.override {
    extraLibraries = pkgs: [ # shadows the other pkgs!
      (pkgs.runCommand "steamrun-lib" { } ''
        mkdir "$out"
        ln -s "${pkgs.steam-run.fhsenv}"/usr/lib64 "$out"/lib
      '')
    ];
  })
];

But it actually fails because both steam-run and lutris provide /usr/lib64/ld-linux.so.2 leading to a name collision. So unfortunately it seems the idea of just adding the steam-run env to Lutris doesn't quite work...

You could instead try something like this:

home.packages = with pkgs; [
  (lutris.override {
    extraLibraries = pkgs: with pkgs; [
      glibc
      libxcrypt
      libGL
      # ... other libs in steam-run.fhs but not in the lutris FHS env
    ];
  })
];

Which library the problem game actually needs is anyone's guess. That information might show up somewhere in the logs, or maybe ldd could tell you... but the signal to noise ratio probably won't be very good.

[–] priapus@piefed.social 2 points 1 month ago* (last edited 1 month ago) (1 children)

The Lutris FHS env does have many libraries used by Linux games. If you look at the package definition you'll see it has many more than the steam-run env. Trying to use steam-run inside Lutris is unlikely to resolve these issues. Do you have the Lutris runtime enabled?

[–] claymorwan@lemmy.blahaj.zone 1 points 1 month ago (1 children)

Do you have the Lutris runtime enabled?

Like so ?

If yes, then sadly it don't work

[–] priapus@piefed.social 2 points 1 month ago* (last edited 1 month ago) (1 children)

You should enable prefer system libraries as well

[–] claymorwan@lemmy.blahaj.zone 1 points 1 month ago

tried that too, didn't work either sadly

[–] Oinks@lemmy.blahaj.zone 1 points 1 month ago (1 children)

I don't use Lutris but there's an issue on Nixpkgs describing it as "utterly broken". So I would recommend just not using Nixpkgs Lutris. The Flatpak will probably work.

[–] priapus@piefed.social 1 points 1 month ago

That issue gives basically zero info on what's happening, theres a million reasons a game could be failing to install. Ive been using Lutris on NixOS for years and have rarely had issues.

[–] ArseAssassin@sopuli.xyz 1 points 4 weeks ago

I did muck around trying to get Lutris working for a while, but ended up using Heroic without much hassle.