-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(fish/functions): Add
build
function
- Loading branch information
1 parent
8ea379d
commit 3fbe1f6
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,6 @@ result | |
|
||
# Direnv | ||
.direnv | ||
|
||
# dotenv | ||
.env |