mirror of
https://github.com/Smaug123/nix-dotfiles
synced 2025-10-08 16:08:39 +00:00
18 lines
549 B
Nix
18 lines
549 B
Nix
{ pkgs ? import <nixpkgs> {} }:
|
|
|
|
# If this fails, `chmod -R a+rw /usr/local/opt/gmp/lib`
|
|
pkgs.runCommandLocal "gmp-symlink" {} ''
|
|
dest="/usr/local/opt/gmp/lib/libgmp.10.dylib"
|
|
existing=$(readlink "$dest")
|
|
if [ $? -eq 1 ]; then
|
|
ln -s ${pkgs.gmp}/lib/libgmp.10.dylib "$dest" && mkdir -p $out && touch $out/done.txt
|
|
else
|
|
if [[ "$existing" == /nix/store/* ]]; then
|
|
ln -fs ${pkgs.gmp}/lib/libgmp.10.dylib "$dest" && mkdir -p $out && touch $out/done.txt
|
|
else
|
|
echo "Existing symlink is $existing, refusing to overwrite"
|
|
exit 1
|
|
fi
|
|
fi
|
|
''
|