diff options
Diffstat (limited to 'scripts/nix_env')
-rw-r--r-- | scripts/nix_env | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/nix_env b/scripts/nix_env new file mode 100644 index 00000000..6326243b --- /dev/null +++ b/scripts/nix_env | |||
@@ -0,0 +1,17 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | if [ -z "$NIXOPS_DEPLOYMENT" ]; then | ||
4 | # This will automatically upgrade to latest version at each build | ||
5 | nixpkgs="https://nixos.org/channels/nixos-19.03/nixexprs.tar.xz" | ||
6 | else | ||
7 | nixpkgs="https://releases.nixos.org/nixos/19.03/nixos-19.03.172530.096e2f137b6/nixexprs.tar.xz" | ||
8 | fi | ||
9 | nixpkgsPrevious="$nixpkgs" | ||
10 | nixpkgsNext="$nixpkgs" | ||
11 | export NIX_PATH="nixpkgs=$nixpkgs:nixpkgsNext=$nixpkgsNext:nixpkgsPrevious=$nixpkgsPrevious" | ||
12 | |||
13 | nixops_custom () { | ||
14 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
15 | d=$(nix-build --no-out-link -E "with import <nixpkgs> { overlays = builtins.attrValues (import $(dirname $DIR)/overlays); }; nixops") | ||
16 | ${d}/bin/nixops "$@" | ||
17 | } | ||