UE compile failures on latest nix

Hello, Im a artist that works in both film and games. I need UE5 to work. ive moved over to nix as ive seen some awesome things, and i really love the way its immutable and can shift from hardware to hardware.

My issue is that, i cannot get UE5 to compile. when i get to the run the “./Setup.sh” im presented with errors from bash. Specifically “bash: ./Setup.sh: cannot executte required file not found”

I have mono installed "the version that was availble to nix-env -i mono
then i install clang again with nix-env -i clang
then i pulled the repo and ran the Setup.sh

i cannot get past this issue. Im looking forward to working with this os, its very promising and this so far is the only issue i have come across beside a few hardware issues (mostly solved)

If any one could help me get ue5 compiled and running i would be extremely greatful. Thank you in advanced

Is Setup.sh starting with #!/bin/bash ?

1 Like

Installing development dependencies using nix-env is not supported. Use nix-shell instead. See also I installed a library but my compiler is not finding it. Why?

As for the Setup.sh error, NixOS intentionally does not have /bin/bash (recently discussed in Shebang locations) so you will need to replace this line with #!/usr/bin/env bash.

1 Like

thank you i will try these tonight and see how i go with it. Thank you fo r the links, they will be helpful. If i run into any issues i dont understand ill update the same thread in case any one else has the same issues later on.

I’d love to know if you managed to get UE5 to compile.

I’ve got it to at least link appropriately. Here’s what I did, not sure if using steam-run is all I needed to do, but I did all three of the following in this thread

https://www.reddit.com/r/NixOS/comments/17kwkgv/switched_from_nobara_to_nixos_my_opinion_so_far/

Unreal Engine and Godot Engine needed nix-ld setup + envfhs (not sure if the name is right) Or sometimes steam-run is good enough, but I am used to running them without other stuff, so added the required libraries in nix-ld

So I blindly copied from here:

This configuration.nix setup:


  programs.nix-ld.enable = true;
  programs.nix-ld.libraries = with pkgs; [
    stdenv.cc.cc
    bash
    zlib
    fuse3
    icu
    zlib
    nss
    openssl
    curl
    expat
    envfs
  ];

  environment.systemPackages = with pkgs; [
    nix-ld
    git
    envfs
  ];

At this point, running ./Setup.sh still wasn’t working, I then tried steam-run ./Setup.sh and it worked. The write up in the blog post mostly explains how Nix links things differently, and how steam-run can be used to get around binary linking issues. I think nix-ld can help turn that into a configuration. I suspect steam-run is all I needed to do, but it’s running now at least

2 Likes