From 28f5f4faa901ae71a0c0dabde3a3ad51e7dfdaf7 Mon Sep 17 00:00:00 2001 From: aaron Date: Sat, 19 Sep 2026 18:48:20 +0200 Subject: [PATCH] fix(siri): add venv to the siril installation --- modules/nixos/astro.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/nixos/astro.nix b/modules/nixos/astro.nix index e8218e0..a82dd1c 100644 --- a/modules/nixos/astro.nix +++ b/modules/nixos/astro.nix @@ -15,7 +15,15 @@ let # on PATH. nixpkgs only *propagates* python3 from the siril derivation (it # isn't on the runtime PATH), so without the --prefix PATH below the GUI # fails with "Python not found in system PATH" and never creates - # ~/.local/share/siril/venv. We add the same interpreter siril references. + # ~/.local/share/siril/venv. + # + # We deliberately do NOT put ${pkgs.python3}/bin on PATH directly: `venv` + # symlinks bin/python3 to whatever sys.executable was, so the venv would + # hard-link a /nix/store hash that gets garbage-collected after the next + # python bump, leaving a dangling symlink ("Error finding venv python + # path, unable to spawn python"). Instead we go through the stable + # /etc/siril/bin/python3 symlink (see environment.etc below), which NixOS + # re-points at the current python on every rebuild. # # The VeraLux PyQt6 wheel ships only the built-in Windows/Fusion styles, so # the global QT_STYLE_OVERRIDE=adwaita-dark (inherited from the session) is @@ -26,7 +34,7 @@ let # ignored again (harmless warning + Fusion fallback, no loss of function). postBuild = '' wrapProgram $out/bin/siril \ - --prefix PATH : ${lib.makeBinPath [ pkgs.python3 ]} \ + --prefix PATH : /etc/siril/bin \ --prefix QT_PLUGIN_PATH : ${pkgs.adwaita-qt6}/lib/qt-6/plugins \ --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath (with pkgs; [ stdenv.cc.cc.lib # libstdc++ / libgcc_s / libgomp (numpy etc.) @@ -62,6 +70,10 @@ in sirilWithPlugins ]; + # Stable, GC-safe interpreter path for Siril's venv (see sirilWithPlugins). + # Same python as siril itself propagates, so sirilpy's ABI matches. + environment.etc."siril/bin/python3".source = "${pkgs.python3}/bin/python3"; + # StarNet++ has no nixpkgs package. Download the StarNet v2 ORT CLI build # (starnet2_linux_*_ORT_x64_cli) from https://www.starnetastro.com/download/ # and unzip it to ~/.local/share/siril/starnet/. Then in Siril set -- 2.52.0