$ sudo nix-channel --add https://github.com/Mic92/nix-ld/archive/main.tar.gz nix-ld
$ sudo nix-channel --update
/etc/nixos/configuration.nix
{
imports = [
<nix-ld/modules/nix-ld.nix>
];
}
install nix-index
the way you want:
packages=[
//...
nix-index
];
sudo nixos-rebuild switch
nix-index
ldd Wonderdraft_bin
to find out the missing libraries;
then add the library packages to the path:
/path/to/wonderdraft/shell.nix
with import <nixpkgs>{};
mkShell {
NIX_LD_LIBRARY_PATH = lib.makeLibraryPath [
stdenv.cc.cc
xorg.libX11
xorg.libXcursor
xorg.libXinerama
xorg.libXrandr
xorg.libXi
libpulseaudio
alsaLib
libGL
glibc
];
NIX_LD = builtins.readFile "${stdenv.cc}/nix-support/dynamic-linker";
shellHook = ''
./Wonderdraft.x86_64
'';
}
~/.local/share/applications/Wonderdraft.desktop
[Desktop Entry]
Version=1.1.4.2
Name=Wonderdraft
Comment=Wonderdraft is a powerful yet intuitive fantasy map creation tool.
Exec=nix-shell /path/to/wonderdraft/shell.nix --run ""
Path=/path/to/wonderdraft/Wonderdraft
Icon=/path/to/wonderdraft/Wonderdraft.png
Terminal=false
Type=Application
Categories=Graphics
reload drun (on i3: mod+shift+r
)
run wonderdraft :)