Last active
January 6, 2025 05:05
-
-
Save Lillecarl/31bcb36e28211a189a5b0c2850145122 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env fish | |
function padd | |
for path in $(nix build nixpkgs#$argv[1] --print-out-paths --no-link) | |
set bin "$path/bin" | |
if test -d $bin | |
echo "Added $bin to PATH" | |
set --prepend --global PATH $bin | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
padd() { | |
# Use nix to build and get the output paths | |
for path in $(nix build nixpkgs#$1 --print-out-paths --no-link); do | |
bin="$path/bin" | |
# Check if the directory exists | |
if [ -d "$bin" ]; then | |
echo "Added $bin to PATH" | |
# Prepend the bin directory to PATH | |
PATH="$bin:$PATH" | |
fi | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment