41 lines
1.5 KiB
Nix
41 lines
1.5 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
# Siril's Python plugins (sirilpy) run in a venv that pip-installs foreign
|
|
# manylinux wheels (numpy, GraXpert deps, ...). Those .so files need
|
|
# libstdc++ at runtime. nix-ld does NOT cover this: it only handles the
|
|
# initial exec of a foreign binary, but here a *native* nixpkgs python
|
|
# dlopen()s the foreign wheel. So we put the libs on LD_LIBRARY_PATH, which
|
|
# the python subprocess inherits from the Siril process.
|
|
sirilWithPlugins = pkgs.symlinkJoin {
|
|
name = "siril-with-plugins";
|
|
paths = [ pkgs.siril ];
|
|
nativeBuildInputs = [ pkgs.makeWrapper ];
|
|
postBuild = ''
|
|
wrapProgram $out/bin/siril \
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ pkgs.stdenv.cc.cc.lib pkgs.zlib ]}
|
|
'';
|
|
};
|
|
in
|
|
{
|
|
# install stellarium for target finding and siril for stacking
|
|
environment.systemPackages = with pkgs; [
|
|
stellarium
|
|
sirilWithPlugins
|
|
];
|
|
|
|
# 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
|
|
# Preferences -> Miscellaneous -> StarNet executable
|
|
# to the extracted ./starnet2 binary.
|
|
#
|
|
# The binary is a generic dynamically-linked ELF, so NixOS needs nix-ld to
|
|
# run it. Its own opencv/onnxruntime libs are found via the bundled ./lib.
|
|
programs.nix-ld.enable = true;
|
|
programs.nix-ld.libraries = with pkgs; [
|
|
stdenv.cc.cc.lib # libstdc++ / libgcc_s
|
|
zlib
|
|
];
|
|
}
|