aboutsummaryrefslogtreecommitdiff
path: root/scripts/nix_env
blob: 7bc14dd3d2236deadf76b224ec072b43314f9a6c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

if [ -z "$NIXOPS_DEPLOYMENT" ]; then
  # This will automatically upgrade to latest version at each build
  nixpkgs="https://nixos.org/channels/nixos-19.03/nixexprs.tar.xz"
else
  nixpkgs="https://releases.nixos.org/nixos/19.03/nixos-19.03.172731.3efdf45dbd1/nixexprs.tar.xz"
fi
nixpkgsPrevious="$nixpkgs"
nixpkgsNext="$nixpkgs"
export NIX_PATH="nixpkgs=$nixpkgs:nixpkgsNext=$nixpkgsNext:nixpkgsPrevious=$nixpkgsPrevious"

nixops_custom () {
  _DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
  d=$(nix-build --no-out-link -E "with import <nixpkgs> { overlays = builtins.attrValues (import $(dirname $_DIR)/overlays); }; nixops")
  ${d}/bin/nixops "$@"
}