diff --git a/pkgs/odysseus/derivation.nix b/pkgs/odysseus/derivation.nix index c14d3e3..70c2061 100644 --- a/pkgs/odysseus/derivation.nix +++ b/pkgs/odysseus/derivation.nix @@ -96,9 +96,10 @@ let ps: (map (n: ps.${n}) reqNames) ++ extraDefault ps ++ extraFromExtras ps ++ extraPythonPackages ps ); - # Single source of truth for the version: src/constants.py's APP_VERSION - # (the value the app serves at /version), parsed at eval time. - version = import ./version.nix { inherit src; }; + # Hardcoded version - update this to match APP_VERSION in src/constants.py + # when updating the package. Using import from src breaks NUR eval with + # restrict-eval because the source store path isn't available at eval time. + version = "2026.8.18"; in stdenv.mkDerivation { pname = "odysseus"; diff --git a/pkgs/odysseus/version.nix b/pkgs/odysseus/version.nix index 1de55b0..f00d79a 100644 --- a/pkgs/odysseus/version.nix +++ b/pkgs/odysseus/version.nix @@ -3,29 +3,18 @@ # The single source of truth for the version is APP_VERSION in # src/constants.py (the value the app serves at /version). This parses it so # the Nix package version can't drift from the app's reported version. -# -# Falls back to hardcoded version if source is not available (e.g., NUR eval -# with restrict-eval, or when the source hasn't been fetched yet). { src }: let - # Hardcoded fallback version - update this when the package updates - fallbackVersion = "2026.8.18"; - - versionFromSourceResult = builtins.tryEval ( - let - constantsContent = builtins.readFile (src + "/src/constants.py"); - versionLine = builtins.head ( - builtins.filter (line: builtins.match "APP_VERSION[[:space:]]*=.*" line != null) ( - builtins.filter (line: line != "") ( - builtins.filter (l: builtins.typeOf l == "string") (builtins.split "\n" constantsContent) - ) - ) - ); - in - builtins.head ( - builtins.match ''APP_VERSION[[:space:]]*=[[:space:]]*"([^"]+)".*'' versionLine + constantsContent = builtins.readFile (src + "/src/constants.py"); + versionLine = builtins.head ( + builtins.filter (line: builtins.match "APP_VERSION[[:space:]]*=.*" line != null) ( + builtins.filter (line: line != "") ( + builtins.filter (l: builtins.typeOf l == "string") (builtins.split "\n" constantsContent) + ) ) ); + version = builtins.head ( + builtins.match ''APP_VERSION[[:space:]]*=[[:space:]]*"([^"]+)".*'' versionLine + ); in -# Use version from source if available, otherwise fall back to hardcoded -if versionFromSourceResult.success then versionFromSourceResult.value else fallbackVersion +version