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];