From e6de7e3e3ed29c5eaa6ab856af06cfac4cd11751 Mon Sep 17 00:00:00 2001 From: Danila Danko Date: Mon, 29 Jan 2024 00:45:23 +0300 Subject: [PATCH] feat: read package version --- nix/build-spago-lock.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nix/build-spago-lock.nix b/nix/build-spago-lock.nix index 34306e1..d63b170 100644 --- a/nix/build-spago-lock.nix +++ b/nix/build-spago-lock.nix @@ -183,7 +183,11 @@ src = drv.out; - version = drv.version or defaultVersion; + version = drv.version or ( + if builtins.pathExists "${src}/spago.yaml" + then lib.attrByPath [ "package" "publish" "version" ] defaultVersion (fromYAML (builtins.readFile "${src}/spago.yaml")) + else defaultVersion + ); nativeBuildInputs = [purs jq];