diff options
author | Steve Purcell <steve@sanityinc.com> | 2019-10-06 17:05:51 +1300 |
---|---|---|
committer | Steve Purcell <steve@sanityinc.com> | 2019-10-07 10:04:36 +1300 |
commit | 4f6e746994362197fc8fe28357ac0e98de340e7f (patch) | |
tree | 8640c6165d628a3e5cc3e1e82d92079a2edc0c10 | |
parent | 4d45f6d86630eb44f93c580bef7d788c1ac5acda (diff) |
Support installing git version of ledger via nix
-rw-r--r-- | tools/default.nix | 11 | ||||
-rwxr-xr-x | tools/install-ledger.sh | 5 |
2 files changed, 14 insertions, 2 deletions
diff --git a/tools/default.nix b/tools/default.nix new file mode 100644 index 0000000..dd94e50 --- /dev/null +++ b/tools/default.nix @@ -0,0 +1,11 @@ +{ pkgs ? import <nixpkgs> {} }: + +let ledgerFromGit = builtins.fetchGit { + url = git://github.com/ledger/ledger; + }; +in +{ + stable = pkgs.ledger; + + snapshot = pkgs.callPackage ledgerFromGit {}; +} diff --git a/tools/install-ledger.sh b/tools/install-ledger.sh index a437047..cc6bab3 100755 --- a/tools/install-ledger.sh +++ b/tools/install-ledger.sh @@ -4,13 +4,14 @@ set -eu -o pipefail set -o xtrace VERSION=$1 +THISDIR=$(cd "$(dirname "$0")" && pwd) case "$VERSION" in stable) - nix-env -iA ledger -f '<nixpkgs>' + nix-env -iA stable -f $THISDIR/default.nix ;; snapshot) - echo "$0: snapshot version of ledger currently unsupported" + nix-env -iA snapshot -f $THISDIR/default.nix ;; *) echo "$0: Unknown branch: $VERSION" |