···245245 lib.optional (cfg.settings.admin-server-port != null && cfg.settings.server-host != "127.0.0.1")
246246 "The PostgREST admin server is potentially listening on a public host. This may expose sensitive information via the `/config` endpoint.";
247247248248+ # Since we're using DynamicUser, we can't add the e.g. nginx user to
249249+ # a postgrest group, so the unix socket must be world-readable to make it useful.
250250+ services.postgrest.settings.service-unix-socket-mode = "666";
251251+248252 systemd.services.postgrest = {
249253 description = "PostgREST";
250254
···11+{
22+ lib,
33+ stdenv,
44+ fetchurl,
55+ gtk2-x11,
66+ pkg-config,
77+ python3,
88+ gfortran,
99+ cfitsio,
1010+ getopt,
1111+ perl,
1212+ groff,
1313+ which,
1414+ darwin,
1515+ ncurses,
1616+ makeWrapper,
1717+}:
1818+1919+let
2020+ python3Env = python3.withPackages (
2121+ ps: with ps; [
2222+ numpy
2323+ setuptools
2424+ ]
2525+ );
2626+in
2727+2828+stdenv.mkDerivation (finalAttrs: {
2929+ version = "4.4-01";
3030+ pname = "imager";
3131+3232+ src = fetchurl {
3333+ # The recommended download link is on Nextcloud instance that
3434+ # requires to accept some general terms of use. Use a mirror at
3535+ # univ-grenoble-alpes.fr instead.
3636+ url = "https://cloud.univ-grenoble-alpes.fr/s/J6yEqA6yZ8tX9da/download?path=%2F&files=imager-dec24.tar.gz";
3737+ hash = "sha256-Pq92IsGY4heekm5zNGngnp6J6YiCHYAyuMT2RsD1/9o=";
3838+ };
3939+4040+ nativeBuildInputs = [
4141+ pkg-config
4242+ groff
4343+ perl
4444+ getopt
4545+ gfortran
4646+ which
4747+ makeWrapper
4848+ ];
4949+5050+ buildInputs = [
5151+ gtk2-x11
5252+ cfitsio
5353+ python3Env
5454+ ncurses
5555+ ];
5656+5757+ patches = [
5858+ # Update the Python link flag script from Gildas upstream
5959+ # version. This patch will be included in the the IMAGER release.
6060+ ./python-ldflags.patch
6161+ # Use Clang as the default compiler on Darwin.
6262+ ./clang.patch
6363+ # Replace hardcoded cpp with GAG_CPP (see below).
6464+ ./cpp-darwin.patch
6565+ ];
6666+6767+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument";
6868+6969+ # Workaround for https://github.com/NixOS/nixpkgs/issues/304528
7070+ env.GAG_CPP = if stdenv.hostPlatform.isDarwin then "${gfortran.outPath}/bin/cpp" else "cpp";
7171+7272+ postPatch = ''
7373+ substituteInPlace utilities/main/gag-makedepend.pl --replace-fail '/usr/bin/perl' ${lib.getExe perl}
7474+ '';
7575+7676+ configurePhase = ''
7777+ source admin/gildas-env.sh -c gfortran -o openmp
7878+ echo "gag_doc: $out/share/doc/" >> kernel/etc/gag.dico.lcl
7979+ '';
8080+8181+ postInstall = ''
8282+ cp -a ../gildas-exe/* $out
8383+ mv $out/$GAG_EXEC_SYSTEM $out/libexec
8484+ makeWrapper $out/libexec/bin/imager $out/bin/imager \
8585+ --set GAG_ROOT_DIR $out \
8686+ --set GAG_PATH $out/etc \
8787+ --set GAG_EXEC_SYSTEM libexec \
8888+ --set GAG_GAG \$HOME/.gag \
8989+ --set PYTHONHOME ${python3Env} \
9090+ --prefix PYTHONPATH : $out/libexec/python \
9191+ --set LD_LIBRARY_PATH $out/libexec/lib/
9292+ '';
9393+9494+ meta = {
9595+ description = "Interferometric imaging package";
9696+ longDescription = ''
9797+ IMAGER is an interferometric imaging package in the GILDAS software,
9898+ tailored for usage simplicity and efficiency for multi-spectral data sets.
9999+100100+ IMAGER was developed and optimized to handle large data files.
101101+ Therefore, IMAGER works mostly on internal buffers and avoids as much as possible
102102+ saving data to intermediate files.
103103+ File saving is done ultimately once the data analysis process is complete,
104104+ which offers an optimum use of the disk bandwidth.
105105+ '';
106106+ homepage = "https://imager.oasu.u-bordeaux.fr";
107107+ license = lib.licenses.free;
108108+ maintainers = [ lib.maintainers.smaret ];
109109+ platforms = lib.platforms.linux ++ lib.platforms.darwin;
110110+ };
111111+112112+})
+104
pkgs/by-name/im/imager/python-ldflags.patch
···11+diff --git a/admin/python-config-ldflags.py b/admin/python-config-ldflags.py
22+index 0854698..f397a7c 100644
33+--- a/admin/python-config-ldflags.py
44++++ b/admin/python-config-ldflags.py
55+@@ -1,38 +1,70 @@
66+-#!/usr/bin/env python
77++# This scripts retrieves the proper options to be used to link against
88++# the libpython, in a machine-independant way. It invokes the official
99++# script python-config (which thankfully deals with all the details).
1010+1111+-# DUPLICATE of "python-config --ldflags", fixed for the library location
1212++import sys
1313++newerpython = (sys.version_info[0] == 3 and sys.version_info[1] > 7)
1414+1515+-# This utility is known to work with:
1616+-# python2.6 (system install) under SL6.4
1717+-# python2.7 (custom install) under SL6.4
1818+-# python3.4 (custom install) under SL6.4
1919+-# python2.7 (system install) under Fedora20
2020+-# python2.7 (Apple install) under MacOSX
2121+-# python2.7 (MacPorts install) under MacOSX
2222+-# python3.4 (MacPorts install) under MacOSX
2323++if newerpython:
2424++ # From now on avoid duplicating python-config, which evolves on its own.
2525++ # Invoke 'python-config --ldflags --embed'. The embed option (under
2626++ # Python 3) adds the libpython itself, whose name is highly
2727++ # unpredictible under the variety of machines and configurations we
2828++ # support
2929++ import subprocess
3030++ output = subprocess.check_output(['python-config', '--ldflags','--embed'])
3131++ output = output.decode('utf-8')
3232++ #print(output)
3333+3434+-import sys
3535+-import sysconfig
3636++ args = output.split()
3737+3838+-pyver = sysconfig.get_config_var('VERSION')
3939+-getvar = sysconfig.get_config_var
4040++ output = ''
4141++ for arg in args:
4242++ # Discard /usr/lib* path which causes troubles on the link command
4343++ # line, as it basically overrides all other custom paths coming after
4444++ # it. No need to put these paths on command line, they are found
4545++ # implicitly by the linker.
4646++ if arg not in ['-L/usr/lib','-L/usr/lib32','-L/usr/lib64']:
4747++ output += arg+' '
4848++
4949++ print(output)
5050+5151+-libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
5252+-if (hasattr(sys,'abiflags')):
5353+- libs.append('-lpython' + pyver + sys.abiflags)
5454+ else:
5555+- libs.append('-lpython' + pyver)
5656++ # DUPLICATE of "python-config --ldflags", fixed for the library location
5757++ # This proved to work gracefully up to Python 3.5 (exact limit unclear)
5858++
5959++ # This utility is known to work with:
6060++ # python2.6 (system install) under SL6.4
6161++ # python2.7 (custom install) under SL6.4
6262++ # python3.4 (custom install) under SL6.4
6363++ # python3.7 (custom install) under Debian12
6464++ # python2.7 (system install) under Fedora20
6565++ # python2.7 (Apple install) under MacOSX
6666++ # python2.7 (MacPorts install) under MacOSX
6767++ # python3.4 (MacPorts install) under MacOSX
6868++
6969++ import sys
7070++ import sysconfig
7171++
7272++ pyver = sysconfig.get_config_var('VERSION')
7373++ getvar = sysconfig.get_config_var
7474++
7575++ libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
7676++ if (hasattr(sys,'abiflags')):
7777++ libs.append('-lpython' + pyver + sys.abiflags)
7878++ else:
7979++ libs.append('-lpython' + pyver)
8080+8181+-# Add the library path, except /usr/lib* which causes troubles
8282+-# on the link command line, as it basically overrides all other
8383+-# custom paths coming after it. No need to put these paths on
8484+-# command line, they are found implicitly by the linker.
8585+-ldpath = getvar('LIBDIR')
8686+-if ldpath not in ['/usr/lib','/usr/lib32','/usr/lib64']:
8787+- libs.insert(0, '-L' + getvar('LIBDIR'))
8888++ # Add the library path, except /usr/lib* which causes troubles
8989++ # on the link command line, as it basically overrides all other
9090++ # custom paths coming after it. No need to put these paths on
9191++ # command line, they are found implicitly by the linker.
9292++ ldpath = getvar('LIBDIR')
9393++ if ldpath not in ['/usr/lib','/usr/lib32','/usr/lib64']:
9494++ libs.insert(0, '-L' + getvar('LIBDIR'))
9595+9696+-# Framework (specific for Mac)
9797+-if not getvar('PYTHONFRAMEWORK'):
9898+- libs.extend(getvar('LINKFORSHARED').split())
9999++ # Framework (specific for Mac)
100100++ if not getvar('PYTHONFRAMEWORK'):
101101++ libs.extend(getvar('LINKFORSHARED').split())
102102+103103+-print(' '.join(libs))
104104++ print(' '.join(libs))
···743743 svn_all_fast_export = svn-all-fast-export;
744744 topGit = top-git;
745745 }; # Added 2021-01-14
746746-746746+ givaro_3 = throw "'givaro_3' has been removed as it is end-of-life. Consider using the up-to-date 'givaro' instead"; # Added 2025-05-07
747747+ givaro_3_7 = throw "'givaro_3_7' has been removed as it is end-of-life. Consider using the up-to-date 'givaro' instead"; # Added 2025-05-07
747748 gkraken = throw "'gkraken' has been deprecated by upstream. Consider using the replacement 'coolercontrol' instead."; # Added 2024-11-22
748749 glew-egl = lib.warnOnInstantiate "'glew-egl' is now provided by 'glew' directly" glew; # Added 2024-08-11
749750 glfw-wayland = glfw; # Added 2024-04-19
···834835 hardinfo = throw "'hardinfo' has been removed as it was abandoned upstream. Consider using 'hardinfo2' instead."; # added 2025-04-17
835836 hasura-graphql-engine = throw "hasura-graphql-engine has been removed because was broken and its packaging severly out of date"; # Added 2025-02-14
836837 haven-cli = throw "'haven-cli' has been removed due to the official announcement of the project closure. Read more at https://havenprotocol.org/2024/12/12/project-closure-announcement"; # Added 2025-02-25
838838+ hawknl = throw "'hawknl' has been removed as it was unmaintained and the upstream unavailable"; # Added 2025-05-07
837839 HentaiAtHome = hentai-at-home; # Added 2024-06-12
838840 hll2390dw-cups = throw "The hll2390dw-cups package was dropped since it was unmaintained."; # Added 2024-06-21
839841 hoarder = throw "'hoarder' has been renamed to 'karakeep'"; # Added 2025-04-21
···12151217 mq-cli = throw "'mq-cli' has been removed due to lack of upstream maintenance"; # Added 2025-01-25
12161218 mrkd = throw "'mrkd' has been removed as it is unmaintained since 2021"; # Added 2024-12-21
12171219 msp430NewlibCross = msp430Newlib; # Added 2024-09-06
12201220+ mumps_par = lib.warnOnInstantiate "mumps_par has been renamed to mumps-mpi" mumps-mpi; # Added 2025-05-07
12181221 mupdf_1_17 = throw "'mupdf_1_17' has been removed due to being outdated and insecure. Consider using 'mupdf' instead."; # Added 2024-08-22
12191222 music-player = throw "'music-player' has been removed due to lack of maintenance upstream. Consider using 'fum' or 'termusic' instead."; # Added 2025-05-02
12201223 mustache-tcl = tclPackages.mustache-tcl; # Added 2024-10-02