Nix-ld: Difference between revisions
TobiasBora (talk | contribs) |
TobiasBora (talk | contribs) →Nix-ld: Add a few important libraries. |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
== Nix-ld == | == Nix-ld == | ||
Nix-ld is a module that is really practical to enable to have a more "traditional" experience in NixOS by recreating the loaders like <code>/lib/ld-linux.so.2</code>, needed to run any executable that is not patched by nix. It is not needed when installing regular packages "the nix way", but it is really handy to quickly test a binary not packaged for nix, or when developing, for instance in javascript/nodejs, since these languages often pre-download many binaries. | [https://github.com/nix-community/nix-ld Nix-ld] is a module that is really practical to enable to have a more "traditional" experience in NixOS by recreating the loaders like <code>/lib/ld-linux.so.2</code>, needed to run any executable that is not patched by nix. It is not needed when installing regular packages "the nix way", but it is really handy to quickly test a binary not packaged for nix, or when developing, for instance in [[JavaScript|javascript]]/[[node.js|nodejs]], since these languages often pre-download many binaries (of course, a proper packaging is of course better, but potentially too tedious when quickly prototyping). | ||
To enable it, you just need to put in your <code>/etc/nixos/configuration.nix</code> the following:<syntaxhighlight lang="nixos">programs.nix-ld = { | To enable it, you just need to put in your <code>/etc/nixos/configuration.nix</code> the following:<syntaxhighlight lang="nixos">programs.nix-ld = { | ||
Line 14: | Line 14: | ||
}; | }; | ||
## Uncomment if you used steamrun's libraries | ## Uncomment if you used steamrun's libraries | ||
# nixpkgs.config.allowUnfree = true;</syntaxhighlight>By default, nix-ld comes with only a few libraries, and you need to manually add | # nixpkgs.config.allowUnfree = true;</syntaxhighlight>By default, nix-ld comes with only a few libraries, and you need to manually add your own. A simple (but a bit tedious) approach to know which library to add is to run the program, and check for errors like:<syntaxhighlight lang="bash"> | ||
$ ./blender | $ ./blender | ||
./blender: error while loading shared libraries: libxkbcommon.so.0: cannot open shared object file: No such file or directory | ./blender: error while loading shared libraries: libxkbcommon.so.0: cannot open shared object file: No such file or directory | ||
Line 166: | Line 166: | ||
# for blender | # for blender | ||
libxkbcommon | libxkbcommon | ||
libxcrypt-legacy # For natron | |||
libGLU # For natron | |||
# Appimages need fuse, e.g. https://musescore.org/fr/download/musescore-x86_64.AppImage | |||
fuse | |||
e2fsprogs | |||
]; | ]; | ||
}; | }; |