Paths within a --expr expression are relative to the script file, while relative paths in NIX_PATH are relative to the caller's CWD. We want the Nixpkgs import to be relative to update-pinned.sh itself, so that it does not matter where it's executed from. See https://github.com/NixOS/nixpkgs/issues/425551
10 lines
237 B
Bash
Executable File
10 lines
237 B
Bash
Executable File
#!/usr/bin/env nix-shell
|
|
#!nix-shell -i bash -E 'with import ../. {}; mkShell { packages = [ npins ]; }'
|
|
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
|
|
|
npins --lock-file pinned.json upgrade
|
|
npins --lock-file pinned.json update
|