Skip to content

Instantly share code, notes, and snippets.

@shiryel
Last active May 3, 2022 23:59
Show Gist options
  • Save shiryel/7ca246c9bf1c31a9c8091460a667aae3 to your computer and use it in GitHub Desktop.
Save shiryel/7ca246c9bf1c31a9c8091460a667aae3 to your computer and use it in GitHub Desktop.
How to solve all NixOS library problems

How to solve all nixos problems in 2 steps

(my new war crime)

STEP 1

Note: make sure to create the /lib dir before

# legacy way:
#gcc_path=$(nix eval nixpkgs.gcc-unwrapped.lib.outPath | tr -d '"')

# with flakes:
gcc_path=$(nix eval --raw .#h_pkgs.gcc-unwrapped.lib.outPath | tr -d '"')

gcc_libs=($(ls "${gcc_path}/lib/"))

for l in ${gcc_libs[*]}; do sudo ln -vs "$gcc_path/lib/$l" "/keep/lib/$l"; done

STEP 2

export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/keep/lib"

you are welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment