Skip to content

Commit

Permalink
feat(fish/functions): Add build function
Browse files Browse the repository at this point in the history
  • Loading branch information
PetarKirov committed Jan 29, 2024
1 parent 8ea379d commit 3fbe1f6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .config/fish/functions/build.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
function build -a cache -d "Build with Nix and push to Cachix"
argparse --min-args=1 h/help c/cache= -- $argv
or return
set -l cache "$_flag_cache"
if test -z "$cache"
set cache "$CACHIX_CACHE"
end
if set -ql _flag_help; or test -z "$cache"
echo "build [-h|--help] [-c|--cache] [FLAKE_REFs ...]"
return 0
end
echo "Building"
for attr in $argv
echo " * $attr"
end
echo "And pushing to cache: '$cache'"
nom build -L --json --no-link --keep-going \
$argv \
| jq -r '.[] | .outputs.out' \
| cachix push $cache
end
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ result

# Direnv
.direnv

# dotenv
.env

0 comments on commit 3fbe1f6

Please sign in to comment.