mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 23:03:40 +01:00
onlykey: parse the version from package.json
This commit is contained in:
parent
5a1a8df251
commit
7c27d012ae
1 changed files with 11 additions and 1 deletions
|
@ -9,8 +9,18 @@
|
|||
}:
|
||||
|
||||
let
|
||||
# parse the version from package.json
|
||||
version =
|
||||
let
|
||||
packageJson = builtins.fromJSON (builtins.readFile ./package.json);
|
||||
splits = builtins.split "^.*#v(.*)$" (builtins.getAttr "onlykey" (builtins.head packageJson));
|
||||
matches = builtins.elemAt splits 1;
|
||||
elem = builtins.head matches;
|
||||
in
|
||||
elem;
|
||||
|
||||
# this must be updated anytime this package is updated.
|
||||
onlykeyPkg = "onlykey-git://github.com/trustcrypto/OnlyKey-App.git#v5.3.3";
|
||||
onlykeyPkg = "onlykey-git://github.com/trustcrypto/OnlyKey-App.git#v${version}";
|
||||
|
||||
# define a shortcut to get to onlykey.
|
||||
onlykey = self."${onlykeyPkg}";
|
||||
|
|
Loading…
Reference in a new issue