Skip to content

Commit

Permalink
omnixrc: Allow user to run omnix
Browse files Browse the repository at this point in the history
This will allow us to `nix run nixpkgs#omnix` in future.
  • Loading branch information
srid committed Dec 4, 2024
1 parent 0e3dc8c commit d25eab3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions omnixrc
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
}

0 comments on commit d25eab3

Please sign in to comment.