-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This will allow us to `nix run nixpkgs#omnix` in future.
- Loading branch information
Showing
1 changed file
with
6 additions
and
6 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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
# -*- mode: sh -*- | ||
# shellcheck shell=bash | ||
|
||
|
||
use_omnix() { | ||
: "${OMNIX_BIN:="nix --accept-flake-config --option builders '' -j0 run github:juspay/omnix --"}" | ||
echo "Invoking omnix using: ${OMNIX_BIN}" | ||
|
||
# Fetch omnix only through binary cache | ||
# Hence `-j0`, as well as `--option builders ''` for when there are remote builders. | ||
nix \ | ||
--accept-flake-config \ | ||
--option builders '' \ | ||
-j0 \ | ||
run github:juspay/omnix -- develop --stage=pre-shell $* || exit 1 | ||
${OMNIX_BIN} develop --stage=pre-shell $* || exit 1 | ||
|
||
use flake ${*:-.} --accept-flake-config | ||
|
||
if [[ ! -z "${NIX_DIRENV_DID_FALLBACK:-}" ]]; then | ||
# Nix shell failed; move on! | ||
exit | ||
else | ||
nix --accept-flake-config run github:juspay/omnix -- develop --stage=post-shell $* | ||
${OMNIX_BIN} develop --stage=post-shell $* | ||
fi | ||
} |