Merge staging-next into staging

Changed files
+5079 -778
doc
languages-frameworks
maintainers
nixos
doc
manual
release-notes
modules
services
monitoring
prometheus
tests
pkgs
applications
by-name
ar
at
atproto-goat
au
auto-patchelf
aw
awscli2
bi
bitbake-language-server
ct
fa
fu
fulcio
he
hebbot
hexyl
mu
mullvad-browser
or
orbiton
pd
po
positron-bin
si
simple64-netplay-server
sy
syncstorage-rs
development
interpreters
python-modules
automower-ble
aw-client
ftfy
go2rtc-client
jupyterlab-git
pyexploitdb
sagemaker-core
sphinx-lv2-theme
thinqconnect
walrus
webrtc-models
tools
build-managers
gradle
servers
home-assistant
custom-lovelace-modules
mushroom
monitoring
nagios-plugins
openbsd_snmp3_check
prometheus
teleport
web-apps
x11
tools
misc
hexyl
panoply
package-management
nix
patches
2_18
2_19
2_20
2_21
2_22
2_23
2_24
git
security
top-level
+1 -1
doc/languages-frameworks/cuda.section.md
···
In the scenario you are unable to run the resulting binary: this is arguably the most complicated as it could be any combination of the previous reasons. This type of failure typically occurs when a library attempts to load or open a library it depends on that it does not declare in its `DT_NEEDED` section. As a first step, ensure that dependencies are patched with [`autoAddDriverRunpath`](https://search.nixos.org/packages?channel=unstable&type=packages&query=autoAddDriverRunpath). Failing that, try running the application with [`nixGL`](https://github.com/guibou/nixGL) or a similar wrapper tool. If that works, it likely means that the application is attempting to load a library that is not in the `RPATH` or `RUNPATH` of the binary.
-
## Running Docker or Podman containers with CUDA support {#running-docker-or-podman-containers-with-cuda-support}
It is possible to run Docker or Podman containers with CUDA support. The recommended mechanism to perform this task is to use the [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/index.html).
···
In the scenario you are unable to run the resulting binary: this is arguably the most complicated as it could be any combination of the previous reasons. This type of failure typically occurs when a library attempts to load or open a library it depends on that it does not declare in its `DT_NEEDED` section. As a first step, ensure that dependencies are patched with [`autoAddDriverRunpath`](https://search.nixos.org/packages?channel=unstable&type=packages&query=autoAddDriverRunpath). Failing that, try running the application with [`nixGL`](https://github.com/guibou/nixGL) or a similar wrapper tool. If that works, it likely means that the application is attempting to load a library that is not in the `RPATH` or `RUNPATH` of the binary.
+
## Running Docker or Podman containers with CUDA support {#cuda-docker-podman}
It is possible to run Docker or Podman containers with CUDA support. The recommended mechanism to perform this task is to use the [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/index.html).
+12
maintainers/maintainer-list.nix
···
githubId = 535135;
name = "Brennon Loveless";
};
bluescreen303 = {
email = "mathijs@bluescreen303.nl";
github = "bluescreen303";
···
github = "dsferruzza";
githubId = 1931963;
name = "David Sferruzza";
};
dstengele = {
name = "Dennis Stengele";
···
githubId = 535135;
name = "Brennon Loveless";
};
+
bloxx12 = {
+
email = "charlie@charlieroot.dev";
+
github = "bloxx12";
+
githubId = 75451918;
+
name = "Charlie Root";
+
};
bluescreen303 = {
email = "mathijs@bluescreen303.nl";
github = "bluescreen303";
···
github = "dsferruzza";
githubId = 1931963;
name = "David Sferruzza";
+
};
+
dsluijk = {
+
name = "Dany Sluijk";
+
email = "nix@dany.dev";
+
github = "dsluijk";
+
githubId = 8537327;
};
dstengele = {
name = "Dennis Stengele";
+14
nixos/doc/manual/release-notes/rl-2411.section.md
···
This change requires granting access to the repositories to this user or
setting the appropriate one through `services.cgit.some-instance.user`.
- `nvimpager` was updated to version 0.13.0, which changes the order of user and
nvimpager settings: user commands in `-c` and `--cmd` now override the
respective default settings because they are executed later.
···
- The `services.prometheus.exporters.minio` option has been removed, as it's upstream implementation was broken and unmaintained.
Minio now has built-in [Prometheus metrics exposure](https://min.io/docs/minio/linux/operations/monitoring/collect-minio-metrics-using-prometheus.html), which can be used instead.
- The `services.patroni.raft` option has been removed, as Raft has been [deprecated by upstream since 3.0.0](https://github.com/patroni/patroni/blob/master/docs/releases.rst#version-300)
- `services.roundcube.maxAttachmentSize` will multiply the value set with `1.37` to offset overhead introduced by the base64 encoding applied to attachments.
···
This change requires granting access to the repositories to this user or
setting the appropriate one through `services.cgit.some-instance.user`.
+
- `gradle_6` was removed due to being [unsupported upstream as of 10 Feb 2023](https://endoflife.date/gradle).
+
Additionally, it had numerous security vulnerabilities that were only patched
+
in later versions, such as [CVE-2021-29429](https://nvd.nist.gov/vuln/detail/CVE-2021-32751),
+
[CVE-2021-29427](https://nvd.nist.gov/vuln/detail/CVE-2021-29427), [CVE-2021-29428](https://nvd.nist.gov/vuln/detail/CVE-2021-29428), and [CVE-2021-32751](https://nvd.nist.gov/vuln/detail/CVE-2021-32751).
+
- `nvimpager` was updated to version 0.13.0, which changes the order of user and
nvimpager settings: user commands in `-c` and `--cmd` now override the
respective default settings because they are executed later.
···
- The `services.prometheus.exporters.minio` option has been removed, as it's upstream implementation was broken and unmaintained.
Minio now has built-in [Prometheus metrics exposure](https://min.io/docs/minio/linux/operations/monitoring/collect-minio-metrics-using-prometheus.html), which can be used instead.
+
- The `services.prometheus.exporters.tor` option has been removed, as its upstream implementation was broken and unmaintained.
+
- The `services.patroni.raft` option has been removed, as Raft has been [deprecated by upstream since 3.0.0](https://github.com/patroni/patroni/blob/master/docs/releases.rst#version-300)
+
+
- The `jd-cli` package was removed due to an inactive upstream and a dependency on the shut down
+
JCenter JAR repository.
+
Java decompilers already packaged in Nixpkgs include `bytecode-viewer` (GUI), `cfr` (CLI), and `procyon` (CLI).
+
+
- The `jd-gui` package was removed due to an inactive upstream and a dependency on the end-of-life Gradle 6.
+
Java decompilers already packaged in Nixpkgs include `bytecode-viewer` (GUI), `cfr` (CLI), and `procyon` (CLI).
- `services.roundcube.maxAttachmentSize` will multiply the value set with `1.37` to offset overhead introduced by the base64 encoding applied to attachments.
+3 -1
nixos/modules/services/monitoring/prometheus/exporters.nix
···
"statsd"
"surfboard"
"systemd"
-
"tor"
"unbound"
"unifi"
"unpoller"
···
(lib.mkRemovedOptionModule [ "minio" ] ''
The Minio exporter has been removed, as it was broken and unmaintained.
See the 24.11 release notes for more information.
'')
];
};
···
"statsd"
"surfboard"
"systemd"
"unbound"
"unifi"
"unpoller"
···
(lib.mkRemovedOptionModule [ "minio" ] ''
The Minio exporter has been removed, as it was broken and unmaintained.
See the 24.11 release notes for more information.
+
'')
+
(lib.mkRemovedOptionModule [ "tor" ] ''
+
The Tor exporter has been removed, as it was broken and unmaintained.
'')
];
};
-43
nixos/modules/services/monitoring/prometheus/exporters/tor.nix
···
-
{ config, lib, pkgs, options, ... }:
-
-
let
-
cfg = config.services.prometheus.exporters.tor;
-
inherit (lib) mkOption types concatStringsSep;
-
in
-
{
-
port = 9130;
-
extraOpts = {
-
torControlAddress = mkOption {
-
type = types.str;
-
default = "127.0.0.1";
-
description = ''
-
Tor control IP address or hostname.
-
'';
-
};
-
-
torControlPort = mkOption {
-
type = types.port;
-
default = 9051;
-
description = ''
-
Tor control port.
-
'';
-
};
-
};
-
serviceOpts = {
-
serviceConfig = {
-
ExecStart = ''
-
${pkgs.prometheus-tor-exporter}/bin/prometheus-tor-exporter \
-
-b ${cfg.listenAddress} \
-
-p ${toString cfg.port} \
-
-a ${cfg.torControlAddress} \
-
-c ${toString cfg.torControlPort} \
-
${concatStringsSep " \\\n " cfg.extraFlags}
-
'';
-
};
-
-
# CPython requires a process to either have $HOME defined or run as a UID
-
# defined in /etc/passwd. The latter is false with DynamicUser, so define a
-
# dummy $HOME. https://bugs.python.org/issue10496
-
environment = { HOME = "/var/empty"; };
-
};
-
}
···
-19
nixos/tests/prometheus-exporters.nix
···
'';
};
-
tor = {
-
exporterConfig = {
-
enable = true;
-
};
-
metricProvider = {
-
# Note: this does not connect the test environment to the Tor network.
-
# Client, relay, bridge or exit connectivity are disabled by default.
-
services.tor.enable = true;
-
services.tor.settings.ControlPort = 9051;
-
};
-
exporterTest = ''
-
wait_for_unit("tor.service")
-
wait_for_open_port(9051)
-
wait_for_unit("prometheus-tor-exporter.service")
-
wait_for_open_port(9130)
-
succeed("curl -sSf localhost:9130/metrics | grep 'tor_version{.\\+} 1'")
-
'';
-
};
-
unpoller = {
nodeName = "unpoller";
exporterConfig.enable = true;
···
'';
};
unpoller = {
nodeName = "unpoller";
exporterConfig.enable = true;
+3 -3
pkgs/applications/audio/spotify-player/default.nix
···
rustPlatform.buildRustPackage rec {
pname = "spotify-player";
-
version = "0.19.1";
src = fetchFromGitHub {
owner = "aome510";
repo = pname;
rev = "refs/tags/v${version}";
-
hash = "sha256-R8F7s8FPnCe+shNUN/u0qcxFy3IbyfVo2xZ5/E/qwaw=";
};
-
cargoHash = "sha256-7vximGisIIXBrwHXSWQjO08OraaweG7ZT6v+gVdYGVc=";
nativeBuildInputs = [
pkg-config
···
rustPlatform.buildRustPackage rec {
pname = "spotify-player";
+
version = "0.20.0";
src = fetchFromGitHub {
owner = "aome510";
repo = pname;
rev = "refs/tags/v${version}";
+
hash = "sha256-heycCm2Nwyo+DegMKeXZ+dF+ZqiFT/6P08/28buJc6I=";
};
+
cargoHash = "sha256-U3a/6uF7vOV3QnxqPnooBdvjyyIPLnQXiXtTwKeHAxA=";
nativeBuildInputs = [
pkg-config
+8 -8
pkgs/applications/editors/vscode/vscode.nix
···
archive_fmt = if stdenv.hostPlatform.isDarwin then "zip" else "tar.gz";
sha256 = {
-
x86_64-linux = "0w452wnzyb4wmr2qqq55dhfb1jd0zqmwf65fbmxdz7jn1jimjjrn";
-
x86_64-darwin = "1b333snvrw8khryhi5scfhhkg43m3b6ds3nvs24nbvx8k7h69hmm";
-
aarch64-linux = "12p5cdva14s9sfgyrzg3nylpmgdnmfavwx3xxxmblzq1gcal2g6i";
-
aarch64-darwin = "1l59fcdvynkl5kyz9bn31mld6pi89nynk1zw645rczjm940pac7p";
-
armv7l-linux = "07ylija6chg6jc2zcavdr9yw1laniigw57f2gilyjynv1cgjm76r";
}.${system} or throwSystem;
in
callPackage ./generic.nix rec {
# Please backport all compatible updates to the stable release.
# This is important for the extension ecosystem.
-
version = "1.94.2";
pname = "vscode" + lib.optionalString isInsiders "-insiders";
# This is used for VS Code - Remote SSH test
-
rev = "384ff7382de624fb94dbaf6da11977bba1ecd427";
executableName = "code" + lib.optionalString isInsiders "-insiders";
longName = "Visual Studio Code" + lib.optionalString isInsiders " - Insiders";
···
src = fetchurl {
name = "vscode-server-${rev}.tar.gz";
url = "https://update.code.visualstudio.com/commit:${rev}/server-linux-x64/stable";
-
sha256 = "1mj9fg76b9x9r6ql21hbckpni179vfa9j8fiah9rd6ih7sb72048";
};
stdenv = stdenvNoCC;
};
···
archive_fmt = if stdenv.hostPlatform.isDarwin then "zip" else "tar.gz";
sha256 = {
+
x86_64-linux = "12cfks56pz1fljv4zrh4q2k6vai2rpdyw5lbap9y8wa9f5pz0m55";
+
x86_64-darwin = "0zxmlpilh83grcv6jk2avlxiy2w0a1vbwmv0fjzy6nvdma91j7lj";
+
aarch64-linux = "1gx5xg54mmkiglwmv8fjppqb8bj0fqn9yg0r5q9kzdhh9702dxsg";
+
aarch64-darwin = "13wnraa13msz7rxzwk232rwrnbmwx0dpq13aq68zjz80clsf4jgp";
+
armv7l-linux = "06kngg0scrk8sz3j874iffyci70ng8j8l1v83k572vw847956850";
}.${system} or throwSystem;
in
callPackage ./generic.nix rec {
# Please backport all compatible updates to the stable release.
# This is important for the extension ecosystem.
+
version = "1.95.0";
pname = "vscode" + lib.optionalString isInsiders "-insiders";
# This is used for VS Code - Remote SSH test
+
rev = "912bb683695358a54ae0c670461738984cbb5b95";
executableName = "code" + lib.optionalString isInsiders "-insiders";
longName = "Visual Studio Code" + lib.optionalString isInsiders " - Insiders";
···
src = fetchurl {
name = "vscode-server-${rev}.tar.gz";
url = "https://update.code.visualstudio.com/commit:${rev}/server-linux-x64/stable";
+
sha256 = "1chk0xwsiw6pm6ihjlp9695n0l1wfipwv4h04v5dmm9dcwlarp1m";
};
stdenv = stdenvNoCC;
};
+5 -2
pkgs/applications/graphics/ImageMagick/default.nix
···
, openjpegSupport ? !stdenv.hostPlatform.isMinGW, openjpeg
, libwebpSupport ? !stdenv.hostPlatform.isMinGW, libwebp
, libheifSupport ? true, libheif
, potrace
, coreutils
, curl
···
(lib.withFeature libjxlSupport "jxl")
(lib.withFeatureAs ghostscriptSupport "gs-font-dir" "${ghostscript.fonts}/share/fonts")
(lib.withFeature ghostscriptSupport "gslib")
] ++ lib.optionals stdenv.hostPlatform.isMinGW [
# due to libxml2 being without DLLs ATM
"--enable-static" "--disable-shared"
···
++ lib.optional lcms2Support lcms2
++ lib.optional libX11Support libX11
++ lib.optional libXtSupport libXt
-
++ lib.optional libwebpSupport libwebp;
postInstall = ''
(cd "$dev/include" && ln -s ImageMagick* ImageMagick)
···
description = "Software suite to create, edit, compose, or convert bitmap images";
pkgConfigModules = [ "ImageMagick" "MagickWand" ];
platforms = platforms.linux ++ platforms.darwin;
-
maintainers = with maintainers; [ dotlambda rhendric ];
license = licenses.asl20;
mainProgram = "magick";
};
···
, openjpegSupport ? !stdenv.hostPlatform.isMinGW, openjpeg
, libwebpSupport ? !stdenv.hostPlatform.isMinGW, libwebp
, libheifSupport ? true, libheif
+
, fftwSupport ? true, fftw
, potrace
, coreutils
, curl
···
(lib.withFeature libjxlSupport "jxl")
(lib.withFeatureAs ghostscriptSupport "gs-font-dir" "${ghostscript.fonts}/share/fonts")
(lib.withFeature ghostscriptSupport "gslib")
+
(lib.withFeature fftwSupport "fftw")
] ++ lib.optionals stdenv.hostPlatform.isMinGW [
# due to libxml2 being without DLLs ATM
"--enable-static" "--disable-shared"
···
++ lib.optional lcms2Support lcms2
++ lib.optional libX11Support libX11
++ lib.optional libXtSupport libXt
+
++ lib.optional libwebpSupport libwebp
+
++ lib.optional fftwSupport fftw;
postInstall = ''
(cd "$dev/include" && ln -s ImageMagick* ImageMagick)
···
description = "Software suite to create, edit, compose, or convert bitmap images";
pkgConfigModules = [ "ImageMagick" "MagickWand" ];
platforms = platforms.linux ++ platforms.darwin;
+
maintainers = with maintainers; [ dotlambda rhendric bloxx12 ];
license = licenses.asl20;
mainProgram = "magick";
};
pkgs/applications/misc/bambu-studio/0002-fix-build-for-gcc-13.diff pkgs/applications/misc/bambu-studio/patches/0002-fix-build-for-gcc-13.diff
+39 -25
pkgs/applications/misc/bambu-studio/default.nix
···
glib,
glib-networking,
gmp,
-
gstreamer,
-
gst-plugins-base,
-
gst-plugins-bad,
-
gst-plugins-good,
gtest,
gtk3,
hicolor-icon-theme,
···
nlopt,
opencascade-occt_7_6,
openvdb,
pcre,
systemd,
tbb_2021_11,
···
withSystemd ? stdenv.hostPlatform.isLinux,
}:
let
-
opencascade-occt = opencascade-occt_7_6;
-
wxGTK31' = wxGTK31.overrideAttrs (old: {
-
configureFlags = old.configureFlags ++ [
-
# Disable noisy debug dialogs
-
"--enable-debug=no"
-
];
-
});
-
openvdb_tbb_2021_8 = openvdb.overrideAttrs (old: {
buildInputs = [
openexr
boost179
···
in
stdenv.mkDerivation rec {
pname = "bambu-studio";
-
version = "01.09.00.70";
src = fetchFromGitHub {
owner = "bambulab";
repo = "BambuStudio";
rev = "v${version}";
-
hash = "sha256-RBctBhKo7mjxsP7OJhGfoU1eIiGVuMiAqwwSU+gsMds=";
};
nativeBuildInputs = [
···
glib
glib-networking
gmp
-
gstreamer
-
gst-plugins-base
-
gst-plugins-bad
-
gst-plugins-good
gtk3
hicolor-icon-theme
ilmbase
···
mesa.osmesa
mpfr
nlopt
-
opencascade-occt
-
openvdb_tbb_2021_8
pcre
tbb_2021_11
webkitgtk_4_0
-
wxGTK31'
xorg.libX11
] ++ lib.optionals withSystemd [ systemd ] ++ checkInputs;
patches = [
# Fix for webkitgtk linking
-
./0001-not-for-upstream-CMakeLists-Link-against-webkit2gtk-.patch
# Fix build with cgal-5.6.1+
-
./meshboolean-const.patch
];
doCheck = true;
···
# Disable compiler warnings that clutter the build log.
# It seems to be a known issue for Eigen:
# http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1221
-
NIX_CFLAGS_COMPILE = "-Wno-ignored-attributes";
# prusa-slicer uses dlopen on `libudev.so` at runtime
NIX_LDFLAGS = lib.optionalString withSystemd "-ludev";
···
meta = with lib; {
description = "PC Software for BambuLab's 3D printers";
homepage = "https://github.com/bambulab/BambuStudio";
license = licenses.agpl3Plus;
-
maintainers = with maintainers; [ zhaofengli ];
mainProgram = "bambu-studio";
platforms = platforms.linux;
};
···
glib,
glib-networking,
gmp,
+
gst_all_1,
gtest,
gtk3,
hicolor-icon-theme,
···
nlopt,
opencascade-occt_7_6,
openvdb,
+
opencv,
pcre,
systemd,
tbb_2021_11,
···
withSystemd ? stdenv.hostPlatform.isLinux,
}:
let
+
wxGTK' =
+
(wxGTK31.override {
+
withCurl = true;
+
withPrivateFonts = true;
+
withWebKit = true;
+
}).overrideAttrs
+
(old: {
+
configureFlags = old.configureFlags ++ [
+
# Disable noisy debug dialogs
+
"--enable-debug=no"
+
];
+
});
+
+
openvdb' = openvdb.overrideAttrs (old: {
buildInputs = [
openexr
boost179
···
in
stdenv.mkDerivation rec {
pname = "bambu-studio";
+
version = "01.09.07.52";
src = fetchFromGitHub {
owner = "bambulab";
repo = "BambuStudio";
rev = "v${version}";
+
hash = "sha256-fhH4N29P/ysdHHbZt+FnBl3+QtTNhbVE3j4ZnFJyJH0=";
};
nativeBuildInputs = [
···
glib
glib-networking
gmp
+
gst_all_1.gstreamer
+
gst_all_1.gst-plugins-base
+
gst_all_1.gst-plugins-bad
+
gst_all_1.gst-plugins-good
gtk3
hicolor-icon-theme
ilmbase
···
mesa.osmesa
mpfr
nlopt
+
opencascade-occt_7_6
+
openvdb'
pcre
tbb_2021_11
webkitgtk_4_0
+
wxGTK'
xorg.libX11
+
opencv
] ++ lib.optionals withSystemd [ systemd ] ++ checkInputs;
patches = [
# Fix for webkitgtk linking
+
./patches/0001-not-for-upstream-CMakeLists-Link-against-webkit2gtk-.patch
# Fix build with cgal-5.6.1+
+
./patches/meshboolean-const.patch
+
# Fix an issue with
+
./patches/dont-link-opencv-world-bambu.patch
];
doCheck = true;
···
# Disable compiler warnings that clutter the build log.
# It seems to be a known issue for Eigen:
# http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1221
+
NIX_CFLAGS_COMPILE = toString [
+
"-Wno-ignored-attributes"
+
"-I${opencv.out}/include/opencv4"
+
];
# prusa-slicer uses dlopen on `libudev.so` at runtime
NIX_LDFLAGS = lib.optionalString withSystemd "-ludev";
···
meta = with lib; {
description = "PC Software for BambuLab's 3D printers";
homepage = "https://github.com/bambulab/BambuStudio";
+
changelog = "https://github.com/bambulab/BambuStudio/releases/tag/v${version}";
license = licenses.agpl3Plus;
+
maintainers = with maintainers; [
+
zhaofengli
+
dsluijk
+
];
mainProgram = "bambu-studio";
platforms = platforms.linux;
};
pkgs/applications/misc/bambu-studio/meshboolean-const.patch pkgs/applications/misc/bambu-studio/patches/meshboolean-const.patch
+9 -15
pkgs/applications/misc/bambu-studio/orca-slicer.nix
···
lib,
fetchFromGitHub,
bambu-studio,
-
opencv,
}:
bambu-studio.overrideAttrs (
finalAttrs: previousAttrs: {
···
hash = "sha256-7fusdSYpZb4sYl5L/+81PzMd42Nsejj+kCZsq0f7eIk=";
};
-
patches =
-
previousAttrs.patches
-
++ [
-
# FIXME: only required for 2.1.1, can be removed in the next version
-
./0002-fix-build-for-gcc-13.diff
-
-
./dont-link-opencv-world.patch
-
];
-
-
buildInputs =
-
previousAttrs.buildInputs
-
++ [
-
opencv
-
];
preFixup = ''
gappsWrapperArgs+=(
···
lib,
fetchFromGitHub,
bambu-studio,
}:
bambu-studio.overrideAttrs (
finalAttrs: previousAttrs: {
···
hash = "sha256-7fusdSYpZb4sYl5L/+81PzMd42Nsejj+kCZsq0f7eIk=";
};
+
patches =[
+
# FIXME: only required for 2.1.1, can be removed in the next version
+
./patches/0002-fix-build-for-gcc-13.diff
+
# Fix for webkitgtk linking
+
./patches/0001-not-for-upstream-CMakeLists-Link-against-webkit2gtk-.patch
+
# Fix build with cgal-5.6.1+
+
./patches/meshboolean-const.patch
+
./patches/dont-link-opencv-world-orca.patch
+
];
preFixup = ''
gappsWrapperArgs+=(
+13 -8
pkgs/applications/misc/bb/default.nix
···
-
{ stdenv, lib, fetchurl, darwin, aalib, ncurses, xorg, libmikmod }:
stdenv.mkDerivation rec {
pname = "bb";
···
sha256 = "1i411glxh7g4pfg4gw826lpwngi89yrbmxac8jmnsfvrfb48hgbr";
};
buildInputs = [
aalib ncurses libmikmod
xorg.libXau xorg.libXdmcp xorg.libX11
-
] ++ lib.optional stdenv.hostPlatform.isDarwin darwin.apple_sdk.frameworks.CoreAudio;
-
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
-
sed -i -e '/^#include <malloc.h>$/d' *.c
'';
-
-
# error: 'regparm' is not valid on this platform
-
env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64)
-
"-D__STRICT_ANSI__";
meta = with lib; {
homepage = "http://aa-project.sourceforge.net/bb";
···
+
{ stdenv, lib, fetchurl, autoreconfHook, aalib, ncurses, xorg, libmikmod }:
stdenv.mkDerivation rec {
pname = "bb";
···
sha256 = "1i411glxh7g4pfg4gw826lpwngi89yrbmxac8jmnsfvrfb48hgbr";
};
+
patches = [
+
# add / update include files to get function prototypes
+
./included-files-updates.diff
+
];
+
+
nativeBuildInputs = [ autoreconfHook ];
+
buildInputs = [
aalib ncurses libmikmod
xorg.libXau xorg.libXdmcp xorg.libX11
+
];
+
# regparm attribute is not supported by clang
+
postPatch = lib.optionalString stdenv.cc.isClang ''
+
substituteInPlace config.h \
+
--replace-fail "__attribute__ ((regparm(n)))" ""
'';
meta = with lib; {
homepage = "http://aa-project.sourceforge.net/bb";
+145
pkgs/applications/misc/bb/included-files-updates.diff
···
···
+
diff --git a/bb.c b/bb.c
+
index 95850ef..6a7cc78 100644
+
--- a/bb.c
+
+++ b/bb.c
+
@@ -23,6 +23,7 @@
+
+
#include <string.h>
+
#include <stdlib.h>
+
+#include <time.h>
+
#include <ctype.h>
+
#include <aalib.h>
+
#include "bb.h"
+
diff --git a/credits.c b/credits.c
+
index 8514579..b304d8c 100644
+
--- a/credits.c
+
+++ b/credits.c
+
@@ -24,7 +24,6 @@
+
#include <math.h>
+
#include <limits.h>
+
#include <string.h>
+
-#include <malloc.h>
+
#include <stdlib.h>
+
#include "bb.h"
+
#define STAR 1
+
diff --git a/credits2.c b/credits2.c
+
index 65d2431..9dcdf2d 100644
+
--- a/credits2.c
+
+++ b/credits2.c
+
@@ -25,7 +25,6 @@
+
#include <math.h>
+
#include <ctype.h>
+
#include <string.h>
+
-#include <malloc.h>
+
#include <stdlib.h>
+
#include "bb.h"
+
#define STATE (TIME-starttime)
+
diff --git a/main.c b/main.c
+
index ae852a7..c0648b4 100644
+
--- a/main.c
+
+++ b/main.c
+
@@ -21,6 +21,8 @@
+
* 675 Mass Ave, Cambridge, MA 02139, USA.
+
*/
+
+
+#include <ctype.h>
+
+#include <string.h>
+
#include <unistd.h>
+
#include "timers.h"
+
#include "bb.h"
+
diff --git a/messager.c b/messager.c
+
index 95cc410..5164577 100644
+
--- a/messager.c
+
+++ b/messager.c
+
@@ -22,7 +22,7 @@
+
*/
+
+
#include <string.h>
+
-#include <malloc.h>
+
+#include <stdlib.h>
+
#include "bb.h"
+
+
static int cursor_x, cursor_y;
+
diff --git a/scene5.c b/scene5.c
+
index 8d3c798..4a79258 100644
+
--- a/scene5.c
+
+++ b/scene5.c
+
@@ -22,7 +22,7 @@
+
*/
+
+
#include <string.h>
+
-#include <malloc.h>
+
+#include <stdlib.h>
+
#include <math.h>
+
#include "bb.h"
+
#include "tex.h"
+
diff --git a/scene8.c b/scene8.c
+
index 2bcba1e..72ea231 100644
+
--- a/scene8.c
+
+++ b/scene8.c
+
@@ -22,7 +22,7 @@
+
*/
+
+
#include <math.h>
+
-#include <malloc.h>
+
+#include <stdlib.h>
+
#include "bb.h"
+
#define STATE1 (TIME-starttime1)
+
#define STATE (time-starttime)
+
diff --git a/textform.c b/textform.c
+
index 859d367..eb9d1cb 100644
+
--- a/textform.c
+
+++ b/textform.c
+
@@ -1,6 +1,6 @@
+
#include <stdio.h>
+
#include <string.h>
+
-#include <malloc.h>
+
+#include <stdlib.h>
+
#include <aalib.h>
+
#include "bb.h"
+
#define MAXLINES 10000
+
diff --git a/timers.c b/timers.c
+
index ac822f7..6342c1b 100644
+
--- a/timers.c
+
+++ b/timers.c
+
@@ -45,12 +45,9 @@
+
#include <time.h>
+
#endif
+
/*HAVE_TIME_H*/
+
-#include <malloc.h>
+
+#include <stdlib.h>
+
#include <stdio.h>
+
#include <unistd.h>
+
-#ifndef _MAC
+
-#include <malloc.h>
+
-#endif
+
#ifdef __BEOS__
+
#include <OS.h>
+
#endif
+
diff --git a/uncompfn.c b/uncompfn.c
+
index d8eaaea..bc707f8 100644
+
--- a/uncompfn.c
+
+++ b/uncompfn.c
+
@@ -21,7 +21,7 @@
+
* 675 Mass Ave, Cambridge, MA 02139, USA.
+
*/
+
+
-#include <malloc.h>
+
+#include <stdlib.h>
+
#include <aalib.h>
+
#include "bb.h"
+
+
diff --git a/zoom.c b/zoom.c
+
index 7450095..4b37b2d 100644
+
--- a/zoom.c
+
+++ b/zoom.c
+
@@ -31,9 +31,6 @@
+
#else
+
#include <stdlib.h>
+
#include <stdio.h>
+
-#ifndef _MAC
+
-#include <malloc.h>
+
-#endif
+
#ifdef __DJGPP__
+
#include "aconfig.dos"
+
#else
+7 -2
pkgs/applications/misc/gallery-dl/default.nix
···
buildPythonApplication rec {
pname = "gallery-dl";
-
version = "1.27.6";
format = "setuptools";
src = fetchPypi {
inherit version;
pname = "gallery_dl";
-
hash = "sha256-bxh15aZIupTaHnYM65MAYuYtKx0z2OIQl3WKEU1gO4Q=";
};
propagatedBuildInputs = [
···
];
nativeCheckInputs = [ pytestCheckHook ];
pytestFlagsArray = [
# requires network access
···
buildPythonApplication rec {
pname = "gallery-dl";
+
version = "1.27.7";
format = "setuptools";
src = fetchPypi {
inherit version;
pname = "gallery_dl";
+
hash = "sha256-9YcxD7AH4U2dOhAiUnknwwGFy9pplFFQ7Rn4cOvDdEc=";
};
propagatedBuildInputs = [
···
];
nativeCheckInputs = [ pytestCheckHook ];
+
+
disabledTests = [
+
# requires network access
+
"test_init"
+
];
pytestFlagsArray = [
# requires network access
+2 -2
pkgs/applications/misc/gremlin-console/default.nix
···
stdenv.mkDerivation rec {
pname = "gremlin-console";
-
version = "3.7.2";
src = fetchzip {
url = "https://downloads.apache.org/tinkerpop/${version}/apache-tinkerpop-gremlin-console-${version}-bin.zip";
-
sha256 = "sha256-lIrqMvI/sYGu36X3jNptoIz7mPVomk8YCIR/6y8mpEc=";
};
nativeBuildInputs = [ makeWrapper ];
···
stdenv.mkDerivation rec {
pname = "gremlin-console";
+
version = "3.7.3";
src = fetchzip {
url = "https://downloads.apache.org/tinkerpop/${version}/apache-tinkerpop-gremlin-console-${version}-bin.zip";
+
sha256 = "sha256-27S1ukq9rHncFuPBZmwIP/bKuPYm3AxdBK3PliYTGEQ=";
};
nativeBuildInputs = [ makeWrapper ];
+6 -6
pkgs/applications/video/qctools/default.nix
···
-
{ lib, stdenv, fetchurl, qmake, wrapQtAppsHook, ffmpeg, qtmultimedia, qwt }:
stdenv.mkDerivation rec {
pname = "qctools";
···
nativeBuildInputs = [ qmake wrapQtAppsHook ];
-
buildInputs = [ ffmpeg qtmultimedia qwt ];
installPhase = ''
runHook preInstall
···
runHook postInstall
'';
-
meta = with lib; {
description = "Audiovisual analytics and filtering of video files";
homepage = "https://mediaarea.net/QCTools";
-
license = licenses.gpl3Only;
-
maintainers = with maintainers; [ orivej ];
-
platforms = platforms.linux;
};
}
···
+
{ lib, stdenv, fetchurl, qmake, wrapQtAppsHook, ffmpeg_6, qtmultimedia, qwt }:
stdenv.mkDerivation rec {
pname = "qctools";
···
nativeBuildInputs = [ qmake wrapQtAppsHook ];
+
buildInputs = [ ffmpeg_6 qtmultimedia qwt ];
installPhase = ''
runHook preInstall
···
runHook postInstall
'';
+
meta = {
description = "Audiovisual analytics and filtering of video files";
homepage = "https://mediaarea.net/QCTools";
+
license = lib.licenses.gpl3Only;
+
maintainers = with lib.maintainers; [ orivej ];
+
platforms = lib.platforms.linux;
};
}
+28
pkgs/by-name/ar/armitage/gradle-8.patch
···
···
+
Upstream PR: https://github.com/r00t0v3rr1d3/armitage/pull/1
+
diff --git a/armitage/build.gradle b/armitage/build.gradle
+
index 43a5d08..50ae084 100644
+
--- a/armitage/build.gradle
+
+++ b/armitage/build.gradle
+
@@ -19,7 +19,7 @@ jar {
+
from {
+
configurations.compileClasspath.filter { it.exists() }.collect { it.isDirectory() ? it : zipTree(it) }
+
}
+
- archiveName 'armitage.jar'
+
+ archiveFileName.set 'armitage.jar'
+
}
+
+
dependencies {
+
diff --git a/cortana/build.gradle b/cortana/build.gradle
+
index c7d08bb..aa54635 100644
+
--- a/cortana/build.gradle
+
+++ b/cortana/build.gradle
+
@@ -19,7 +19,8 @@ jar {
+
from {
+
configurations.compileClasspath.filter { it.exists() }.collect { it.isDirectory() ? it : zipTree(it) }
+
}
+
- archiveName 'cortana.jar'
+
+ duplicatesStrategy DuplicatesStrategy.INCLUDE
+
+ archiveFileName.set 'cortana.jar'
+
}
+
+
dependencies {
+3 -3
pkgs/by-name/ar/armitage/package.nix
···
, fetchurl
, fetchFromGitHub
, jdk11
-
, gradle_6
, metasploit
, makeWrapper
, makeDesktopItem
···
let
pname = "armitage";
version = "unstable-2022-12-05";
-
-
gradle = gradle_6;
src = fetchFromGitHub {
owner = "r00t0v3rr1d3";
···
url = "https://gitlab.com/kalilinux/packages/armitage/-/raw/042beb7494a10227761ecb3ddabf4019bbb78681/debian/patches/fix-meterpreter.patch";
hash = "sha256-p4fs5xFdC2apW0U8x8u9S4p5gq3Eiv+0E4CGccQZYKY=";
})
];
in
···
, fetchurl
, fetchFromGitHub
, jdk11
+
, gradle
, metasploit
, makeWrapper
, makeDesktopItem
···
let
pname = "armitage";
version = "unstable-2022-12-05";
src = fetchFromGitHub {
owner = "r00t0v3rr1d3";
···
url = "https://gitlab.com/kalilinux/packages/armitage/-/raw/042beb7494a10227761ecb3ddabf4019bbb78681/debian/patches/fix-meterpreter.patch";
hash = "sha256-p4fs5xFdC2apW0U8x8u9S4p5gq3Eiv+0E4CGccQZYKY=";
})
+
# Update for Gradle 8 (https://github.com/r00t0v3rr1d3/armitage/pull/1)
+
./gradle-8.patch
];
in
+3 -3
pkgs/by-name/at/atproto-goat/package.nix
···
buildGoModule rec {
pname = "atproto-goat";
-
version = "0-unstable-2024-10-08";
src = fetchFromGitHub {
owner = "bluesky-social";
repo = "indigo";
-
rev = "06bacb465af714feb77609566aba15ab1ed41e24";
-
hash = "sha256-wWsE3sAGZQmOBVqTgy4RjoU8zmtuvyQIj9DjwSbtmKw=";
};
postPatch = ''
···
buildGoModule rec {
pname = "atproto-goat";
+
version = "0-unstable-2024-10-29";
src = fetchFromGitHub {
owner = "bluesky-social";
repo = "indigo";
+
rev = "983ce4a481a32a3eb2944c4c76e885d0f6006f83";
+
hash = "sha256-Jo3pI4uRyKh3yV03ijOcg+Uyu75Spmy/VS116MVgleU=";
};
postPatch = ''
pkgs/by-name/au/auto-patchelf/auto-patchelf.py pkgs/by-name/au/auto-patchelf/src/auto-patchelf.py
+1 -6
pkgs/by-name/au/auto-patchelf/package.nix
···
version = "0-unstable-2024-08-14";
pyproject = false;
-
src = lib.fileset.toSource {
-
root = ./.;
-
fileset = lib.fileset.unions [
-
./auto-patchelf.py
-
];
-
};
dependencies = with python3Packages; [
pyelftools
···
version = "0-unstable-2024-08-14";
pyproject = false;
+
src = ./src;
dependencies = with python3Packages; [
pyelftools
+4 -6
pkgs/by-name/aw/awscli2/package.nix
···
in
py.pkgs.buildPythonApplication rec {
pname = "awscli2";
-
version = "2.17.64"; # N.B: if you change this, check if overrides are still up-to-date
pyproject = true;
src = fetchFromGitHub {
owner = "aws";
repo = "aws-cli";
rev = "refs/tags/${version}";
-
hash = "sha256-Hq86KhAIATSz3dF1zO6aSdZQAfLs4EcRqWglAOJUVGk=";
};
-
patches = [ ];
-
postPatch = ''
substituteInPlace pyproject.toml \
-
--replace-fail 'awscrt>=0.19.18,<=0.21.2' 'awscrt>=0.19.18' \
-
--replace-fail 'cryptography>=40.0.0,<40.0.2' 'cryptography>=43.0.0' \
--replace-fail 'distro>=1.5.0,<1.9.0' 'distro>=1.5.0' \
--replace-fail 'docutils>=0.10,<0.20' 'docutils>=0.10' \
--replace-fail 'prompt-toolkit>=3.0.24,<3.0.39' 'prompt-toolkit>=3.0.24'
···
in
py.pkgs.buildPythonApplication rec {
pname = "awscli2";
+
version = "2.18.15"; # N.B: if you change this, check if overrides are still up-to-date
pyproject = true;
src = fetchFromGitHub {
owner = "aws";
repo = "aws-cli";
rev = "refs/tags/${version}";
+
hash = "sha256-dm4Z3WsFq5GQN6gvi5OS9J96PqhGx8Qz2OsHwUBrsAs=";
};
postPatch = ''
substituteInPlace pyproject.toml \
+
--replace-fail 'awscrt>=0.19.18,<=0.22.0' 'awscrt>=0.22.0' \
+
--replace-fail 'cryptography>=40.0.0,<43.0.2' 'cryptography>=43.0.0' \
--replace-fail 'distro>=1.5.0,<1.9.0' 'distro>=1.5.0' \
--replace-fail 'docutils>=0.10,<0.20' 'docutils>=0.10' \
--replace-fail 'prompt-toolkit>=3.0.24,<3.0.39' 'prompt-toolkit>=3.0.24'
+2 -2
pkgs/by-name/bi/bitbake-language-server/package.nix
···
python3.pkgs.buildPythonApplication rec {
pname = "bitbake-language-server";
-
version = "0.0.14";
format = "pyproject";
src = fetchFromGitHub {
owner = "Freed-Wu";
repo = pname;
rev = version;
-
hash = "sha256-aGj9lW420A+iTQWSCdIITAJj3p89VUkPvdhQ/0M6uXo=";
};
nativeBuildInputs = with python3.pkgs; [
···
python3.pkgs.buildPythonApplication rec {
pname = "bitbake-language-server";
+
version = "0.0.15";
format = "pyproject";
src = fetchFromGitHub {
owner = "Freed-Wu";
repo = pname;
rev = version;
+
hash = "sha256-NLDQ2P5peweugkoNYskpCyCEgBwVFA7RTs8+NvH8fj8=";
};
nativeBuildInputs = with python3.pkgs; [
+59
pkgs/by-name/ct/ctune/cmake_disable_git_clone.patch
···
···
+
diff --git a/CMakeLists.txt b/CMakeLists.txt
+
index 1a30d61..bea8d7c 100644
+
--- a/CMakeLists.txt
+
+++ b/CMakeLists.txt
+
@@ -50,13 +50,6 @@ include(FetchContent)
+
+
set(CMAKE_VERBOSE_MAKEFILE ON)
+
+
-#========================================== PRE-CHECKS ============================================#
+
-include(FindGit)
+
-find_package(Git)
+
-
+
-if (NOT Git_FOUND)
+
- message(FATAL_ERROR "Required package 'Git' not found on system.")
+
-endif ()
+
+
#======================================== LIB IMPORTS =============================================#
+
# ======= #
+
@@ -68,28 +61,9 @@ include_directories(${OPENSSL_INCLUDE_DIR})
+
# ============== #
+
# JSON-C library #
+
# ============== #
+
-set(JSONC_DOWNLOAD_PATH "${TEMP_DIR_PATH}/libjsonc")
+
-set(JSONC_INSTALL_PATH "${CMAKE_EXTERNAL_OUTPUT_DIRECTORY}")
+
-
+
-add_custom_target(make-jsonc-install-dir ALL
+
- COMMAND ${CMAKE_COMMAND} -E make_directory ${JSONC_INSTALL_PATH}
+
-)
+
-
+
-ExternalProject_Add(libjsonc
+
- PREFIX "${JSONC_DOWNLOAD_PATH}"
+
- SOURCE_DIR "${JSONC_DOWNLOAD_PATH}/src/libjsonc-build"
+
- GIT_REPOSITORY "https://github.com/json-c/json-c.git"
+
- CMAKE_ARGS "-DBUILD_STATIC_LIBS=ON"
+
- "-DBUILD_SHARED_LIBS=OFF"
+
- "-DCMAKE_INSTALL_PREFIX:PATH=${JSONC_INSTALL_PATH}"
+
- "-DHAVE_ARC4RANDOM=OFF"
+
- "-DCMAKE_BUILD_TYPE=release"
+
-)
+
-
+
-set(JSONC_LIBRARIES
+
- ${CMAKE_EXTERNAL_OUTPUT_DIRECTORY}/lib/libjson-c.a
+
- bsd
+
-)
+
+find_package(PkgConfig REQUIRED)
+
+pkg_check_modules(JSONC REQUIRED json-c)
+
+include_directories(${JSONC_INCLUDE_DIRS})
+
+
# ============ #
+
# Curl library #
+
@@ -408,7 +382,7 @@ add_subdirectory(docs)
+
#endforeach()
+
+
add_executable(ctune ${SOURCE_FILES})
+
-add_dependencies(ctune ctune_logger libjsonc)
+
+add_dependencies(ctune ctune_logger)
+
include_directories(${CMAKE_EXTERNAL_OUTPUT_DIRECTORY}/include)
+
+
add_dependencies(ctune ${CTUNE_PLUGIN_LIST_AUDIO_PLAYER})
+66
pkgs/by-name/ct/ctune/package.nix
···
···
+
{
+
stdenv,
+
lib,
+
fetchFromGitHub,
+
openssl,
+
curl,
+
ffmpeg,
+
vlc,
+
SDL2,
+
lame,
+
json_c,
+
cmake,
+
pkg-config,
+
ncurses,
+
libuuid,
+
pandoc,
+
}:
+
stdenv.mkDerivation (finalAttrs: {
+
pname = "ctune";
+
version = "1.3.2";
+
+
src = fetchFromGitHub {
+
owner = "An7ar35";
+
repo = "ctune";
+
rev = "refs/tags/v${finalAttrs.version}";
+
hash = "sha256-fy7Wb4R6HDa+cLxI5YWq67gxw1XS/iDDN4M3Rn7GYeI=";
+
};
+
+
nativeBuildInputs = [
+
cmake
+
pkg-config
+
pandoc
+
];
+
+
buildInputs = [
+
openssl
+
curl
+
ffmpeg
+
vlc
+
SDL2
+
lame
+
json_c
+
ncurses
+
libuuid
+
];
+
+
strictDeps = true;
+
+
cmakeFlags = [
+
# Avoid a wrong nested install path location
+
# Set to "$out" instead of "$out/$out"
+
"-DCMAKE_INSTALL_PREFIX=''"
+
];
+
+
patches = [ ./cmake_disable_git_clone.patch ];
+
+
meta = {
+
description = "A nice terminal nCurses (tui) internet radio player for Linux, browse and search from api.radio-browser.info";
+
homepage = " https://github.com/An7ar35/ctune";
+
changelog = "https://github.com/An7ar35/ctune/blob/master/CHANGELOG.md";
+
license = lib.licenses.agpl3Plus;
+
maintainers = with lib.maintainers; [ theobori ];
+
mainProgram = "ctune";
+
platforms = lib.platforms.linux;
+
};
+
})
+1 -1
pkgs/by-name/fa/facter/Gemfile.lock
···
GEM
remote: https://rubygems.org/
specs:
-
facter (4.8.0)
hocon (~> 1.3)
thor (>= 1.0.1, < 1.3)
hocon (1.4.0)
···
GEM
remote: https://rubygems.org/
specs:
+
facter (4.10.0)
hocon (~> 1.3)
thor (>= 1.0.1, < 1.3)
hocon (1.4.0)
+2 -2
pkgs/by-name/fa/facter/gemset.nix
···
platforms = [];
source = {
remotes = ["https://rubygems.org"];
-
sha256 = "1130mzk90pi0y9fnraqqak7gcfg61dhx92axwnhchbpw09akfl09";
type = "gem";
};
-
version = "4.8.0";
};
hocon = {
groups = ["default"];
···
platforms = [];
source = {
remotes = ["https://rubygems.org"];
+
sha256 = "17d561xf4s5016fm9jkfkkafn6660g04fz1yp5xfvkb0j4xj32mp";
type = "gem";
};
+
version = "4.10.0";
};
hocon = {
groups = ["default"];
+41
pkgs/by-name/he/hexyl/package.nix
···
···
+
{
+
lib,
+
rustPlatform,
+
fetchFromGitHub,
+
}:
+
+
rustPlatform.buildRustPackage rec {
+
pname = "hexyl";
+
version = "0.15.0";
+
+
src = fetchFromGitHub {
+
owner = "sharkdp";
+
repo = "hexyl";
+
rev = "refs/tags/v${version}";
+
hash = "sha256-v/mB0W/AyoJSoK00pqxpfMGZR/4DkkTCnPU6eorl/GI=";
+
};
+
+
cargoHash = "sha256-QaOp7dCXfkIpxAJ+J+Pt9op3uj+LYoYvR78BmHBgnqE=";
+
+
meta = {
+
description = "Command-line hex viewer";
+
longDescription = ''
+
`hexyl` is a simple hex viewer for the terminal. It uses a colored
+
output to distinguish different categories of bytes (NULL bytes,
+
printable ASCII characters, ASCII whitespace characters, other ASCII
+
characters and non-ASCII).
+
'';
+
homepage = "https://github.com/sharkdp/hexyl";
+
changelog = "https://github.com/sharkdp/hexyl/blob/v${version}/CHANGELOG.md";
+
license = with lib.licenses; [
+
asl20
+
mit
+
];
+
maintainers = with lib.maintainers; [
+
dywedir
+
figsoda
+
SuperSandro2000
+
];
+
mainProgram = "hexyl";
+
};
+
}
pkgs/by-name/ma/matrix-hebbot/package.nix pkgs/by-name/he/hebbot/package.nix
+2 -2
pkgs/by-name/mu/mullvad-browser/package.nix
···
++ lib.optionals mediaSupport [ ffmpeg ]
);
-
version = "13.5.7";
sources = {
x86_64-linux = fetchurl {
···
"https://tor.eff.org/dist/mullvadbrowser/${version}/mullvad-browser-linux-x86_64-${version}.tar.xz"
"https://tor.calyxinstitute.org/dist/mullvadbrowser/${version}/mullvad-browser-linux-x86_64-${version}.tar.xz"
];
-
hash = "sha256-Te6Cw3fUs4XGz07lL54bKUU9HYC5soaKFlbWGujd/oU=";
};
};
···
++ lib.optionals mediaSupport [ ffmpeg ]
);
+
version = "13.5.9";
sources = {
x86_64-linux = fetchurl {
···
"https://tor.eff.org/dist/mullvadbrowser/${version}/mullvad-browser-linux-x86_64-${version}.tar.xz"
"https://tor.calyxinstitute.org/dist/mullvadbrowser/${version}/mullvad-browser-linux-x86_64-${version}.tar.xz"
];
+
hash = "sha256-hyFYI42IfFY0vqkqInkLQAWSY8flsmWGN8CaXBwXbGA=";
};
};
+6 -11
pkgs/by-name/or/orbiton/package.nix
···
buildGoModule rec {
pname = "orbiton";
-
version = "2.65.12";
src = fetchFromGitHub {
owner = "xyproto";
repo = "orbiton";
rev = "v${version}";
-
hash = "sha256-1KVw2dj//6vwUUj1jVWe2J/9F6J8BQsvCAEbJZnW26c=";
};
vendorHash = null;
-
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
-
substituteInPlace Makefile \
-
--replace "-Wl,--as-needed" ""
-
-
# Requires impure pbcopy and pbpaste
-
substituteInPlace v2/pbcopy_test.go \
-
--replace TestPBcopy SkipTestPBcopy
-
'';
-
nativeBuildInputs = [ installShellFiles makeWrapper pkg-config ];
buildInputs = lib.optional withGui vte;
preBuild = "cd v2";
postInstall = ''
cd ..
···
buildGoModule rec {
pname = "orbiton";
+
version = "2.67.1";
src = fetchFromGitHub {
owner = "xyproto";
repo = "orbiton";
rev = "v${version}";
+
hash = "sha256-/5USD588kr3uB/Zs1ASKVgxH4kAWZCNBrZL7qqx49gU=";
};
vendorHash = null;
nativeBuildInputs = [ installShellFiles makeWrapper pkg-config ];
buildInputs = lib.optional withGui vte;
preBuild = "cd v2";
+
+
checkFlags = [
+
"-skip=TestPBcopy" # Requires impure pbcopy and pbpaste
+
];
postInstall = ''
cd ..
+1 -1
pkgs/by-name/pd/pdk/Gemfile
···
source 'https://rubygems.org'
-
gem 'pdk', '3.2.0'
···
source 'https://rubygems.org'
+
gem 'pdk', '3.3.0'
+17 -11
pkgs/by-name/pd/pdk/Gemfile.lock
···
GEM
remote: https://rubygems.org/
specs:
-
addressable (2.8.6)
-
public_suffix (>= 2.0.2, < 6.0)
-
childprocess (4.1.0)
-
cri (2.15.11)
deep_merge (1.2.2)
diff-lcs (1.5.1)
ffi (1.17.0)
hitimes (2.0.0)
-
json-schema (4.3.0)
addressable (>= 2.8)
json_pure (2.6.3)
-
minitar (0.9)
pastel (0.8.0)
tty-color (~> 0.5)
pathspec (1.1.3)
-
pdk (3.2.0)
bundler (>= 2.1.0, < 3.0.0)
-
childprocess (~> 4.1.0)
cri (~> 2.15.11)
deep_merge (~> 1.2.2)
diff-lcs (>= 1.5.0)
···
json_pure (~> 2.6.3)
minitar (~> 0.8)
pathspec (~> 1.1)
tty-prompt (~> 0.23)
tty-spinner (~> 0.9)
tty-which (~> 0.5)
-
public_suffix (5.0.5)
tty-color (0.6.0)
tty-cursor (0.7.1)
tty-prompt (0.23.1)
···
ruby
DEPENDENCIES
-
pdk (= 3.2.0)
BUNDLED WITH
-
2.5.9
···
GEM
remote: https://rubygems.org/
specs:
+
addressable (2.8.7)
+
public_suffix (>= 2.0.2, < 7.0)
+
childprocess (5.1.0)
+
logger (~> 1.5)
+
cri (2.15.12)
deep_merge (1.2.2)
diff-lcs (1.5.1)
ffi (1.17.0)
hitimes (2.0.0)
+
json-schema (4.3.1)
addressable (>= 2.8)
json_pure (2.6.3)
+
logger (1.6.1)
+
minitar (0.12.1)
pastel (0.8.0)
tty-color (~> 0.5)
pathspec (1.1.3)
+
pdk (3.3.0)
bundler (>= 2.1.0, < 3.0.0)
+
childprocess (~> 5.0)
cri (~> 2.15.11)
deep_merge (~> 1.2.2)
diff-lcs (>= 1.5.0)
···
json_pure (~> 2.6.3)
minitar (~> 0.8)
pathspec (~> 1.1)
+
puppet-modulebuilder (~> 1.0)
tty-prompt (~> 0.23)
tty-spinner (~> 0.9)
tty-which (~> 0.5)
+
public_suffix (6.0.1)
+
puppet-modulebuilder (1.1.0)
+
minitar (~> 0.9)
+
pathspec (>= 0.2.1, < 3.0.0)
tty-color (0.6.0)
tty-cursor (0.7.1)
tty-prompt (0.23.1)
···
ruby
DEPENDENCIES
+
pdk (= 3.3.0)
BUNDLED WITH
+
2.5.16
+37 -15
pkgs/by-name/pd/pdk/gemset.nix
···
platforms = [];
source = {
remotes = ["https://rubygems.org"];
-
sha256 = "0irbdwkkjwzajq1ip6ba46q49sxnrl2cw7ddkdhsfhb6aprnm3vr";
type = "gem";
};
-
version = "2.8.6";
};
childprocess = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
-
sha256 = "1lvcp8bsd35g57f7wz4jigcw2sryzzwrpcgjwwf3chmjrjcww5in";
type = "gem";
};
-
version = "4.1.0";
};
cri = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
-
sha256 = "1bhsgnjav94mz5vf3305gxz1g34gm9kxvnrn1dkz530r8bpj0hr5";
type = "gem";
};
-
version = "2.15.11";
};
deep_merge = {
groups = ["default"];
···
platforms = [];
source = {
remotes = ["https://rubygems.org"];
-
sha256 = "1ljqbpjc5aa8a2cgq8f64iwbx7rr9dqvpk7v8n5jpslyz6mvyddc";
type = "gem";
};
-
version = "4.3.0";
};
json_pure = {
groups = ["default"];
···
};
version = "2.6.3";
};
minitar = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
-
sha256 = "126mq86x67d1p63acrfka4zx0cx2r0vc93884jggxnrmmnzbxh13";
type = "gem";
};
-
version = "0.9";
};
pastel = {
dependencies = ["tty-color"];
···
version = "1.1.3";
};
pdk = {
-
dependencies = ["childprocess" "cri" "deep_merge" "diff-lcs" "ffi" "hitimes" "json-schema" "json_pure" "minitar" "pathspec" "tty-prompt" "tty-spinner" "tty-which"];
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
-
sha256 = "1avc2dgcdi9l6xam9crka790jhpx04536387f1vq2p9yqpr5lw7h";
type = "gem";
};
-
version = "3.2.0";
};
public_suffix = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
-
sha256 = "14y4vzjwf5gp0mqgs880kis0k7n2biq8i6ci6q2n315kichl1hvj";
type = "gem";
};
-
version = "5.0.5";
};
tty-color = {
groups = ["default"];
···
platforms = [];
source = {
remotes = ["https://rubygems.org"];
+
sha256 = "0cl2qpvwiffym62z991ynks7imsm87qmgxf0yfsmlwzkgi9qcaa6";
type = "gem";
};
+
version = "2.8.7";
};
childprocess = {
+
dependencies = ["logger"];
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
+
sha256 = "1v5nalaarxnfdm6rxb7q6fmc6nx097jd630ax6h9ch7xw95li3cs";
type = "gem";
};
+
version = "5.1.0";
};
cri = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
+
sha256 = "1rank6i9p2drwdcmhan6ifkzrz1v3mwpx47fwjl75rskxwjfkgwa";
type = "gem";
};
+
version = "2.15.12";
};
deep_merge = {
groups = ["default"];
···
platforms = [];
source = {
remotes = ["https://rubygems.org"];
+
sha256 = "09bq393nrxa7hmphc3li8idgxdnb5hwgj15d0q5qsh4l5g1qvrnm";
type = "gem";
};
+
version = "4.3.1";
};
json_pure = {
groups = ["default"];
···
};
version = "2.6.3";
};
+
logger = {
+
groups = ["default"];
+
platforms = [];
+
source = {
+
remotes = ["https://rubygems.org"];
+
sha256 = "0lwncq2rf8gm79g2rcnnyzs26ma1f4wnfjm6gs4zf2wlsdz5in9s";
+
type = "gem";
+
};
+
version = "1.6.1";
+
};
minitar = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
+
sha256 = "0f307mpj4j0gp7iq77xj4p149f4krcvbll9rismng3jcijpbn79s";
type = "gem";
};
+
version = "0.12.1";
};
pastel = {
dependencies = ["tty-color"];
···
version = "1.1.3";
};
pdk = {
+
dependencies = ["childprocess" "cri" "deep_merge" "diff-lcs" "ffi" "hitimes" "json-schema" "json_pure" "minitar" "pathspec" "puppet-modulebuilder" "tty-prompt" "tty-spinner" "tty-which"];
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
+
sha256 = "1gildcnii3ayw585as8d8bqhnfb9diqg7n3vmgaz8c5b9wb8c106";
type = "gem";
};
+
version = "3.3.0";
};
public_suffix = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
+
sha256 = "0vqcw3iwby3yc6avs1vb3gfd0vcp2v7q310665dvxfswmcf4xm31";
type = "gem";
};
+
version = "6.0.1";
+
};
+
puppet-modulebuilder = {
+
dependencies = ["minitar" "pathspec"];
+
groups = ["default"];
+
platforms = [];
+
source = {
+
remotes = ["https://rubygems.org"];
+
sha256 = "0rh31hq24nkddd83cx7n9ln5bsib3a052hrmn120sq0937337173";
+
type = "gem";
+
};
+
version = "1.1.0";
};
tty-color = {
groups = ["default"];
+137
pkgs/by-name/po/positron-bin/package.nix
···
···
+
{
+
lib,
+
_7zz,
+
alsa-lib,
+
systemd,
+
autoPatchelfHook,
+
blas,
+
dpkg,
+
fetchurl,
+
gtk3,
+
libglvnd,
+
libxkbcommon,
+
makeShellWrapper,
+
mesa,
+
musl,
+
nss,
+
patchelf,
+
stdenv,
+
xorg,
+
}:
+
let
+
pname = "positron-bin";
+
version = "2024.11.0-116";
+
in
+
stdenv.mkDerivation {
+
inherit version pname;
+
+
src =
+
if stdenv.isDarwin then
+
fetchurl {
+
url = "https://github.com/posit-dev/positron/releases/download/${version}/Positron-${version}.dmg";
+
hash = "sha256-5Ym42InDgFLGdZk0LYV1H0eC5WzmsYToG1KLdiGgTto=";
+
}
+
else
+
fetchurl {
+
url = "https://github.com/posit-dev/positron/releases/download/${version}/Positron-${version}.deb";
+
hash = "sha256-pE25XVYFW8WwyQ7zmox2mmXy6ZCSaXk2gSnPimg7xtU=";
+
};
+
+
buildInputs =
+
[ makeShellWrapper ]
+
++ lib.optionals stdenv.hostPlatform.isLinux [
+
alsa-lib
+
dpkg
+
gtk3
+
libglvnd
+
libxkbcommon
+
mesa
+
musl
+
nss
+
stdenv.cc.cc
+
xorg.libX11
+
xorg.libXcomposite
+
xorg.libXdamage
+
xorg.libxkbfile
+
]
+
++ lib.optionals stdenv.hostPlatform.isDarwin [
+
blas
+
patchelf
+
];
+
+
nativeBuildInputs =
+
lib.optionals stdenv.hostPlatform.isLinux [
+
autoPatchelfHook
+
]
+
++ lib.optionals stdenv.hostPlatform.isDarwin [
+
_7zz
+
];
+
+
runtimeDependencies = lib.optionals stdenv.hostPlatform.isLinux [
+
# Needed to fix the "Zygote could not fork" error.
+
(lib.getLib systemd)
+
];
+
+
unpackPhase = ''
+
runHook preUnpack
+
${lib.optionalString stdenv.hostPlatform.isLinux ''dpkg-deb --fsys-tarfile "$src" | tar -x --no-same-owner''}
+
runHook postUnpack
+
'';
+
+
installPhase =
+
if stdenv.hostPlatform.isDarwin then
+
''
+
runHook preInstall
+
mkdir -p "$out/Applications" "$out/bin"
+
cp -r . "$out/Applications/Positron.app"
+
+
# Positron will use the system version of BLAS if we don't provide the nix version.
+
wrapProgram "$out/Applications/Positron.app/Contents/Resources/app/bin/code" \
+
--prefix DYLD_INSERT_LIBRARIES : "${lib.makeLibraryPath [ blas ]}/libblas.dylib"
+
+
ln -s "$out/Applications/Positron.app/Contents/Resources/app/bin/code" "$out/bin/positron"
+
runHook postInstall
+
''
+
else
+
''
+
runHook preInstall
+
mkdir -p "$out/share"
+
cp -r usr/share/pixmaps "$out/share/pixmaps"
+
cp -r usr/share/positron "$out/share/positron"
+
+
mkdir -p "$out/share/applications"
+
install -m 444 -D usr/share/applications/positron.desktop "$out/share/applications/positron.desktop"
+
substituteInPlace "$out/share/applications/positron.desktop" \
+
--replace-fail \
+
"Icon=com.visualstudio.code.oss" \
+
"Icon=$out/share/pixmaps/com.visualstudio.code.oss.png" \
+
--replace-fail \
+
"Exec=/usr/share/positron/positron %F" \
+
"Exec=$out/share/positron/.positron-wrapped %F" \
+
--replace-fail \
+
"/usr/share/positron/positron --new-window %F" \
+
"$out/share/positron/.positron-wrapped --new-window %F"
+
+
# Fix libGL.so not found errors.
+
wrapProgram "$out/share/positron/positron" \
+
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libglvnd ]}"
+
+
mkdir -p "$out/bin"
+
ln -s "$out/share/positron/positron" "$out/bin/positron"
+
runHook postInstall
+
'';
+
+
passthru.updateScript = ./update.sh;
+
+
meta = with lib; {
+
description = "Positron, a next-generation data science IDE";
+
homepage = "https://github.com/posit-dev/positron";
+
license = licenses.elastic20;
+
maintainers = with maintainers; [
+
b-rodrigues
+
detroyejr
+
];
+
mainProgram = "positron";
+
platforms = [ "x86_64-linux" ] ++ platforms.darwin;
+
};
+
}
+54
pkgs/by-name/po/positron-bin/update.sh
···
···
+
#!/usr/bin/env nix-shell
+
#! nix-shell -i bash -p curl jq git
+
+
nixpkgs="$(git rev-parse --show-toplevel)"
+
positron_nix="$nixpkgs/pkgs/by-name/po/positron-bin/package.nix"
+
+
current_version=$(grep -oP "version = \"\K.*\d" $positron_nix)
+
new_version=$(curl -sSfL \
+
-H "Accept: application/vnd.github+json" \
+
-H "X-GitHub-Api-Version: 2022-11-28" \
+
"https://api.github.com/repos/posit-dev/positron/releases?per_page=1" \
+
| jq -r '.[0].name')
+
+
if [[ "$new_version" == "$current_version" ]]; then
+
echo 'Positron is already up to date'
+
exit 0;
+
fi
+
+
# Update Darwin hash.
+
current_hash=$(nix store prefetch-file --json --hash-type sha256 \
+
"https://github.com/posit-dev/positron/releases/download/${current_version}/Positron-${current_version}.dmg" \
+
| jq -r .hash)
+
+
new_hash=$(nix store prefetch-file --json --hash-type sha256 \
+
"https://github.com/posit-dev/positron/releases/download/${new_version}/Positron-${new_version}.dmg" \
+
| jq -r .hash)
+
+
sed -i "s|$current_hash|$new_hash|g" $positron_nix
+
+
# Update Linux hash.
+
current_hash=$(nix store prefetch-file --json --hash-type sha256 \
+
"https://github.com/posit-dev/positron/releases/download/${current_version}/Positron-${current_version}.deb" \
+
| jq -r .hash)
+
+
new_hash=$(nix store prefetch-file --json --hash-type sha256 \
+
"https://github.com/posit-dev/positron/releases/download/${new_version}/Positron-${new_version}.deb" \
+
| jq -r .hash)
+
+
sed -i "s|$current_hash|$new_hash|g" $positron_nix
+
+
# Update version
+
sed -i "s|$current_version|$new_version|g" $positron_nix
+
+
# Attempt to build.
+
export NIXPKGS_ALLOW_UNFREE=1
+
+
if ! nix-build -A positron-bin "$nixpkgs"; then
+
echo "The updated positron-bin failed to build."
+
exit 1
+
fi
+
+
# Commit changes
+
git add "$positron_nix"
+
git commit -m "positron-bin: ${current_version} -> ${new_version}"
+3 -3
pkgs/by-name/si/simple64-netplay-server/package.nix
···
buildGoModule rec {
pname = "simple64-netplay-server";
-
version = "2024.06.1";
src = fetchFromGitHub {
owner = "simple64";
repo = "simple64-netplay-server";
rev = "refs/tags/v${version}";
-
hash = "sha256-WTEtTzRkXuIusfK6Nbj1aLwXcXyaXQi+j3SsDrvtLKo=";
};
-
vendorHash = "sha256-zfLSti368rBHj17HKDZKtOQQrhVGVa2CaieaDGHcZOk=";
meta = {
description = "Dedicated server for simple64 netplay";
···
buildGoModule rec {
pname = "simple64-netplay-server";
+
version = "2024.10.1";
src = fetchFromGitHub {
owner = "simple64";
repo = "simple64-netplay-server";
rev = "refs/tags/v${version}";
+
hash = "sha256-p9hHVf1LD95w280ScUkxHKmBJLJ9eiH3WEYV+kaALgQ=";
};
+
vendorHash = "sha256-HeYA/nR0NuP/fPMJXGGuN2eP6vB4yj1yWFfFDyp34QE=";
meta = {
description = "Dedicated server for simple64 netplay";
+20 -27
pkgs/by-name/sy/syncstorage-rs/Cargo.lock
···
[[package]]
name = "sentry"
version = "0.34.0"
-
source = "registry+https://github.com/rust-lang/crates.io-index"
-
checksum = "5484316556650182f03b43d4c746ce0e3e48074a21e2f51244b648b6542e1066"
dependencies = [
"curl",
"httpdate",
···
[[package]]
name = "sentry-backtrace"
version = "0.34.0"
-
source = "registry+https://github.com/rust-lang/crates.io-index"
-
checksum = "40aa225bb41e2ec9d7c90886834367f560efc1af028f1c5478a6cce6a59c463a"
dependencies = [
"backtrace",
"once_cell",
···
[[package]]
name = "sentry-contexts"
version = "0.34.0"
-
source = "registry+https://github.com/rust-lang/crates.io-index"
-
checksum = "1a8dd746da3d16cb8c39751619cefd4fcdbd6df9610f3310fd646b55f6e39910"
dependencies = [
"hostname",
"libc",
···
[[package]]
name = "sentry-core"
version = "0.34.0"
-
source = "registry+https://github.com/rust-lang/crates.io-index"
-
checksum = "161283cfe8e99c8f6f236a402b9ccf726b201f365988b5bb637ebca0abbd4a30"
dependencies = [
"once_cell",
"rand",
···
[[package]]
name = "sentry-debug-images"
version = "0.34.0"
-
source = "registry+https://github.com/rust-lang/crates.io-index"
-
checksum = "8fc6b25e945fcaa5e97c43faee0267eebda9f18d4b09a251775d8fef1086238a"
dependencies = [
"findshlibs",
"once_cell",
···
[[package]]
name = "sentry-tracing"
version = "0.34.0"
-
source = "registry+https://github.com/rust-lang/crates.io-index"
-
checksum = "cd3c5faf2103cd01eeda779ea439b68c4ee15adcdb16600836e97feafab362ec"
dependencies = [
"sentry-backtrace",
"sentry-core",
···
[[package]]
name = "sentry-types"
version = "0.34.0"
-
source = "registry+https://github.com/rust-lang/crates.io-index"
-
checksum = "5d68cdf6bc41b8ff3ae2a9c4671e97426dcdd154cc1d4b6b72813f285d6b163f"
dependencies = [
"debugid",
"hex",
···
[[package]]
name = "syncserver"
-
version = "0.17.9"
dependencies = [
"actix-cors",
"actix-http",
···
[[package]]
name = "syncserver-common"
-
version = "0.17.9"
dependencies = [
"actix-web",
"backtrace",
···
[[package]]
name = "syncserver-db-common"
-
version = "0.17.9"
dependencies = [
"backtrace",
"deadpool",
···
[[package]]
name = "syncserver-settings"
-
version = "0.17.9"
dependencies = [
"config 0.11.0",
"num_cpus",
···
[[package]]
name = "syncstorage-db"
-
version = "0.17.9"
dependencies = [
"async-trait",
"cadence",
···
[[package]]
name = "syncstorage-db-common"
-
version = "0.17.9"
dependencies = [
"async-trait",
"backtrace",
···
[[package]]
name = "syncstorage-mysql"
-
version = "0.17.9"
dependencies = [
"async-trait",
"backtrace",
···
[[package]]
name = "syncstorage-settings"
-
version = "0.17.9"
dependencies = [
"rand",
"serde 1.0.203",
···
[[package]]
name = "syncstorage-spanner"
-
version = "0.17.9"
dependencies = [
"async-trait",
"backtrace",
···
[[package]]
name = "tokenserver-auth"
-
version = "0.17.9"
dependencies = [
"async-trait",
"base64 0.22.1",
···
[[package]]
name = "tokenserver-common"
-
version = "0.17.9"
dependencies = [
"actix-web",
"backtrace",
···
[[package]]
name = "tokenserver-db"
-
version = "0.17.9"
dependencies = [
"async-trait",
"backtrace",
···
[[package]]
name = "tokenserver-settings"
-
version = "0.17.9"
dependencies = [
"jsonwebtoken",
"serde 1.0.203",
···
[[package]]
name = "sentry"
version = "0.34.0"
+
source = "git+https://github.com/getsentry/sentry-rust?rev=1b65b5c#1b65b5c99af975496880e7325218479e0037d097"
dependencies = [
"curl",
"httpdate",
···
[[package]]
name = "sentry-backtrace"
version = "0.34.0"
+
source = "git+https://github.com/getsentry/sentry-rust?rev=1b65b5c#1b65b5c99af975496880e7325218479e0037d097"
dependencies = [
"backtrace",
"once_cell",
···
[[package]]
name = "sentry-contexts"
version = "0.34.0"
+
source = "git+https://github.com/getsentry/sentry-rust?rev=1b65b5c#1b65b5c99af975496880e7325218479e0037d097"
dependencies = [
"hostname",
"libc",
···
[[package]]
name = "sentry-core"
version = "0.34.0"
+
source = "git+https://github.com/getsentry/sentry-rust?rev=1b65b5c#1b65b5c99af975496880e7325218479e0037d097"
dependencies = [
"once_cell",
"rand",
···
[[package]]
name = "sentry-debug-images"
version = "0.34.0"
+
source = "git+https://github.com/getsentry/sentry-rust?rev=1b65b5c#1b65b5c99af975496880e7325218479e0037d097"
dependencies = [
"findshlibs",
"once_cell",
···
[[package]]
name = "sentry-tracing"
version = "0.34.0"
+
source = "git+https://github.com/getsentry/sentry-rust?rev=1b65b5c#1b65b5c99af975496880e7325218479e0037d097"
dependencies = [
"sentry-backtrace",
"sentry-core",
···
[[package]]
name = "sentry-types"
version = "0.34.0"
+
source = "git+https://github.com/getsentry/sentry-rust?rev=1b65b5c#1b65b5c99af975496880e7325218479e0037d097"
dependencies = [
"debugid",
"hex",
···
[[package]]
name = "syncserver"
+
version = "0.17.12"
dependencies = [
"actix-cors",
"actix-http",
···
[[package]]
name = "syncserver-common"
+
version = "0.17.12"
dependencies = [
"actix-web",
"backtrace",
···
[[package]]
name = "syncserver-db-common"
+
version = "0.17.12"
dependencies = [
"backtrace",
"deadpool",
···
[[package]]
name = "syncserver-settings"
+
version = "0.17.12"
dependencies = [
"config 0.11.0",
"num_cpus",
···
[[package]]
name = "syncstorage-db"
+
version = "0.17.12"
dependencies = [
"async-trait",
"cadence",
···
[[package]]
name = "syncstorage-db-common"
+
version = "0.17.12"
dependencies = [
"async-trait",
"backtrace",
···
[[package]]
name = "syncstorage-mysql"
+
version = "0.17.12"
dependencies = [
"async-trait",
"backtrace",
···
[[package]]
name = "syncstorage-settings"
+
version = "0.17.12"
dependencies = [
"rand",
"serde 1.0.203",
···
[[package]]
name = "syncstorage-spanner"
+
version = "0.17.12"
dependencies = [
"async-trait",
"backtrace",
···
[[package]]
name = "tokenserver-auth"
+
version = "0.17.12"
dependencies = [
"async-trait",
"base64 0.22.1",
···
[[package]]
name = "tokenserver-common"
+
version = "0.17.12"
dependencies = [
"actix-web",
"backtrace",
···
[[package]]
name = "tokenserver-db"
+
version = "0.17.12"
dependencies = [
"async-trait",
"backtrace",
···
[[package]]
name = "tokenserver-settings"
+
version = "0.17.12"
dependencies = [
"jsonwebtoken",
"serde 1.0.203",
+6 -2
pkgs/by-name/sy/syncstorage-rs/package.nix
···
, libmysqlclient
, makeBinaryWrapper
, lib
}:
let
···
rustPlatform.buildRustPackage rec {
pname = "syncstorage-rs";
-
version = "0.17.9";
src = fetchFromGitHub {
owner = "mozilla-services";
repo = pname;
rev = "refs/tags/${version}";
-
hash = "sha256-ezTwAAtt0/jKfA6FtvzuQVFYOODMcD4RFiU3x0Umifk=";
};
nativeBuildInputs = [
···
lockFile = ./Cargo.lock;
outputHashes = {
"deadpool-0.7.0" = "sha256-yQwn45EuzmPBwuT+iLJ/LLWAkBkW2vF+GLswdbpFVAY=";
};
};
# almost all tests need a DB to test against
doCheck = false;
meta = {
description = "Mozilla Sync Storage built with Rust";
···
, libmysqlclient
, makeBinaryWrapper
, lib
+
, nix-update-script
}:
let
···
rustPlatform.buildRustPackage rec {
pname = "syncstorage-rs";
+
version = "0.17.12";
src = fetchFromGitHub {
owner = "mozilla-services";
repo = pname;
rev = "refs/tags/${version}";
+
hash = "sha256-hvKbKbRa5zk+80xmKWeMRjshaS6uybFzb5KdBY19Sl8=";
};
nativeBuildInputs = [
···
lockFile = ./Cargo.lock;
outputHashes = {
"deadpool-0.7.0" = "sha256-yQwn45EuzmPBwuT+iLJ/LLWAkBkW2vF+GLswdbpFVAY=";
+
"sentry-0.34.0" = "sha256-BdWz6EIEm2YU3DG3ODkuXCVCMV6srdyx2gXkOxINjHc=";
};
};
# almost all tests need a DB to test against
doCheck = false;
+
+
passthru.updateScript = nix-update-script {};
meta = {
description = "Mozilla Sync Storage built with Rust";
+1
pkgs/development/interpreters/lua-5/interpreter.nix
···
management with incremental garbage collection, making it ideal
for configuration, scripting, and rapid prototyping.
'';
license = lib.licenses.mit;
platforms = lib.platforms.unix;
};
···
management with incremental garbage collection, making it ideal
for configuration, scripting, and rapid prototyping.
'';
+
mainProgram = "lua";
license = lib.licenses.mit;
platforms = lib.platforms.unix;
};
+39
pkgs/development/python-modules/automower-ble/default.nix
···
···
+
{
+
lib,
+
bleak,
+
buildPythonPackage,
+
fetchFromGitHub,
+
setuptools,
+
pytestCheckHook,
+
pythonOlder,
+
}:
+
+
buildPythonPackage rec {
+
pname = "automower-ble";
+
version = "0.2.0";
+
pyproject = true;
+
+
disabled = pythonOlder "3.10";
+
+
src = fetchFromGitHub {
+
owner = "alistair23";
+
repo = "AutoMower-BLE";
+
rev = "refs/tags/${version}";
+
hash = "sha256-BWfRXz78e1Xq0fNOGJ2IFnjNqfH3oD5VIGMxyCPtEUw=";
+
};
+
+
build-system = [ setuptools ];
+
+
dependencies = [ bleak ];
+
+
nativeCheckInputs = [ pytestCheckHook ];
+
+
pythonImportsCheck = [ "automower_ble" ];
+
+
meta = {
+
description = "Module to connect to Husqvarna Automower Connect";
+
homepage = "https://github.com/alistair23/AutoMower-BLE";
+
license = lib.licenses.gpl3Only;
+
maintainers = with lib.maintainers; [ fab ];
+
};
+
}
+2 -2
pkgs/development/python-modules/aw-client/default.nix
···
buildPythonPackage rec {
pname = "aw-client";
-
version = "0.5.13";
format = "pyproject";
···
owner = "ActivityWatch";
repo = "aw-client";
rev = "v${version}";
-
sha256 = "sha256-A9f1Wj4F6qRvCVj3iRQvsnILewJK1L5tfI2MnAXZ4nY=";
};
disabled = pythonOlder "3.8";
···
buildPythonPackage rec {
pname = "aw-client";
+
version = "0.5.14";
format = "pyproject";
···
owner = "ActivityWatch";
repo = "aw-client";
rev = "v${version}";
+
sha256 = "sha256-HTyhQz/RaNdCtJIV6YHEd6Yhu9VRJ8E9XdN7NcoO8ao=";
};
disabled = pythonOlder "3.8";
+11 -13
pkgs/development/python-modules/ftfy/default.nix
···
{
lib,
buildPythonPackage,
-
fetchPypi,
pythonOlder,
# build-system
-
poetry-core,
# dependencies
wcwidth,
···
buildPythonPackage rec {
pname = "ftfy";
-
version = "6.2.3";
pyproject = true;
-
disabled = pythonOlder "3.7";
-
src = fetchPypi {
-
inherit pname version;
-
hash = "sha256-ebUFmI8p1XelipBpr+dVU6AqRuQt5gkcBmDNxngSutw=";
};
-
build-system = [ poetry-core ];
dependencies = [ wcwidth ];
···
export PATH=$out/bin:$PATH
'';
-
disabledTestPaths = [
-
# Calls poetry and fails to match output exactly
-
"tests/test_cli.py"
-
];
-
meta = with lib; {
description = "Given Unicode text, make its representation consistent and possibly less broken";
mainProgram = "ftfy";
homepage = "https://github.com/LuminosoInsight/python-ftfy";
···
{
lib,
buildPythonPackage,
+
fetchFromGitHub,
pythonOlder,
# build-system
+
hatchling,
# dependencies
wcwidth,
···
buildPythonPackage rec {
pname = "ftfy";
+
version = "6.3.1";
pyproject = true;
+
disabled = pythonOlder "3.9";
+
src = fetchFromGitHub {
+
owner = "rspeer";
+
repo = "python-ftfy";
+
rev = "refs/tags/v${version}";
+
hash = "sha256-TmwDJeUDcF+uOB2X5tMmnf9liCI9rP6dYJVmJoaqszo=";
};
+
build-system = [ hatchling ];
dependencies = [ wcwidth ];
···
export PATH=$out/bin:$PATH
'';
meta = with lib; {
+
changelog = "https://github.com/rspeer/python-ftfy/blob/${src.rev}/CHANGELOG.md";
description = "Given Unicode text, make its representation consistent and possibly less broken";
mainProgram = "ftfy";
homepage = "https://github.com/LuminosoInsight/python-ftfy";
+67
pkgs/development/python-modules/go2rtc-client/default.nix
···
···
+
{
+
lib,
+
aiohttp,
+
aioresponses,
+
awesomeversion,
+
buildPythonPackage,
+
fetchFromGitHub,
+
hatchling,
+
mashumaro,
+
orjson,
+
pytest-asyncio,
+
pytest-cov-stub,
+
pytestCheckHook,
+
pythonOlder,
+
syrupy,
+
webrtc-models,
+
}:
+
+
buildPythonPackage rec {
+
pname = "go2rtc-client";
+
version = "0.0.1b2";
+
pyproject = true;
+
+
disabled = pythonOlder "3.12";
+
+
src = fetchFromGitHub {
+
owner = "home-assistant-libs";
+
repo = "python-go2rtc-client";
+
rev = "refs/tags/${version}";
+
hash = "sha256-q1NDHauYy8C3tlIpt6J0iMj0TNtBv2j9aU/IE5CgBjg=";
+
};
+
+
postPatch = ''
+
substituteInPlace pyproject.toml \
+
--replace-fail 'version = "0.0.0"' 'version = "${version}"'
+
'';
+
+
pythonRelaxDeps = [ "orjson" ];
+
+
build-system = [ hatchling ];
+
+
dependencies = [
+
aiohttp
+
awesomeversion
+
mashumaro
+
orjson
+
webrtc-models
+
];
+
+
nativeCheckInputs = [
+
aioresponses
+
pytest-asyncio
+
pytest-cov-stub
+
pytestCheckHook
+
syrupy
+
];
+
+
pythonImportsCheck = [ "go2rtc_client" ];
+
+
meta = {
+
description = "Module for interacting with go2rtc";
+
homepage = "https://github.com/home-assistant-libs/python-go2rtc-client";
+
changelog = "https://github.com/home-assistant-libs/python-go2rtc-client/releases/tag/${version}";
+
license = lib.licenses.asl20;
+
maintainers = with lib.maintainers; [ ];
+
};
+
}
+2 -2
pkgs/development/python-modules/jupyterlab-git/default.nix
···
buildPythonPackage rec {
pname = "jupyterlab-git";
-
version = "0.50.1";
pyproject = true;
disabled = pythonOlder "3.8";
···
src = fetchPypi {
pname = "jupyterlab_git";
inherit version;
-
hash = "sha256-v08Go/vCsquE6l1SMmqg4LjM9OmjNX+jGKEZVg4cak0=";
};
nativeBuildInputs = [
···
buildPythonPackage rec {
pname = "jupyterlab-git";
+
version = "0.50.2";
pyproject = true;
disabled = pythonOlder "3.8";
···
src = fetchPypi {
pname = "jupyterlab_git";
inherit version;
+
hash = "sha256-zu/chWMsr0maBItDRFnQO15iFmWAHp23GXvUhvXTNDM=";
};
nativeBuildInputs = [
+4 -4
pkgs/development/python-modules/pyexploitdb/default.nix
···
buildPythonPackage rec {
pname = "pyexploitdb";
-
version = "0.2.41";
pyproject = true;
disabled = pythonOlder "3.7";
···
src = fetchPypi {
pname = "pyExploitDb";
inherit version;
-
hash = "sha256-QwMD7V1BSmFBZ7mazo7TnuZijm8MC/M/oKMV4nh1v5A=";
};
build-system = [ setuptools ];
···
meta = with lib; {
description = "Library to fetch the most recent exploit-database";
-
homepage = "https://github.com/GoVanguard/pyExploitDb";
-
changelog = "https://github.com/GoVanguard/pyExploitDb/blob/master/ChangeLog.md";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ fab ];
};
···
buildPythonPackage rec {
pname = "pyexploitdb";
+
version = "0.2.53";
pyproject = true;
disabled = pythonOlder "3.7";
···
src = fetchPypi {
pname = "pyExploitDb";
inherit version;
+
hash = "sha256-NebM8nhIo4Hgf7iwSV2utcrqR1kLh+cpmqV1Gc9r8cw=";
};
build-system = [ setuptools ];
···
meta = with lib; {
description = "Library to fetch the most recent exploit-database";
+
homepage = "https://github.com/Hackman238/pyExploitDb/pyExploitDb";
+
changelog = "https://github.com/Hackman238/pyExploitDb/pyExploitDb/blob/master/ChangeLog.md";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ fab ];
};
+2 -2
pkgs/development/python-modules/sagemaker-core/default.nix
···
buildPythonPackage rec {
pname = "sagemaker-core";
-
version = "1.0.10";
pyproject = true;
src = fetchFromGitHub {
owner = "aws";
repo = "sagemaker-core";
rev = "refs/tags/v${version}";
-
hash = "sha256-UloQJ5B10XXPbwsktVZzjcW7BLW8wCAw3wGmAkSl6wc=";
};
build-system = [
···
buildPythonPackage rec {
pname = "sagemaker-core";
+
version = "1.0.11";
pyproject = true;
src = fetchFromGitHub {
owner = "aws";
repo = "sagemaker-core";
rev = "refs/tags/v${version}";
+
hash = "sha256-6r8roHMJ4s/+mGiPeMVZ9wagdXNJQ3+tUFZ/7T+NQBc=";
};
build-system = [
+33
pkgs/development/python-modules/sphinx-lv2-theme/default.nix
···
···
+
{
+
buildPythonPackage,
+
lib,
+
fetchFromGitLab,
+
setuptools,
+
sphinx,
+
}:
+
+
buildPythonPackage rec {
+
pname = "sphinx-lv2-theme";
+
version = "1.4.2";
+
pyproject = true;
+
+
src = fetchFromGitLab {
+
owner = "LV2";
+
repo = "sphinx_lv2_theme";
+
rev = "v${version}";
+
hash = "sha256-x3h2hOQIyzOmnh58WMHjuOARdML1sDiVAf7m0YghhJ4=";
+
};
+
+
build-system = [ setuptools ];
+
+
dependencies = [ sphinx ];
+
+
pythonImportsCheck = [ "sphinx_lv2_theme" ];
+
+
meta = {
+
description = "Sphinx theme in the style of the LV2 plugin";
+
homepage = "https://gitlab.com/lv2/sphinx_lv2_theme";
+
license = lib.licenses.isc;
+
maintainers = with lib.maintainers; [ samueltardieu ];
+
};
+
}
+4 -5
pkgs/development/python-modules/thinqconnect/default.nix
···
}:
buildPythonPackage rec {
-
pname = "pythinqconnect";
-
version = "0.9.7-unstable-2024-09-09";
pyproject = true;
disabled = pythonOlder "3.10";
···
src = fetchFromGitHub {
owner = "thinq-connect";
repo = "pythinqconnect";
-
# https://github.com/thinq-connect/pythinqconnect/issues/1
-
rev = "39d535a2a5d1067a110eea37ae92002d0793b7e9";
-
hash = "sha256-+nQAUqg5rB2eJgPBJJR8NsQ1O2Wb4UsbBQVPir1jyAU=";
};
build-system = [ setuptools ];
···
}:
buildPythonPackage rec {
+
pname = "thinqconnect";
+
version = "0.9.9";
pyproject = true;
disabled = pythonOlder "3.10";
···
src = fetchFromGitHub {
owner = "thinq-connect";
repo = "pythinqconnect";
+
rev = "refs/tags/${version}";
+
hash = "sha256-G6fg+mXrUnSkfpeJAvDXEu57UgkYEObErEnds2PK13Y=";
};
build-system = [ setuptools ];
+7 -15
pkgs/development/python-modules/walrus/default.nix
···
{
lib,
-
pkgs,
buildPythonPackage,
fetchFromGitHub,
pythonOlder,
redis,
unittestCheckHook,
-
fetchpatch,
}:
buildPythonPackage rec {
pname = "walrus";
-
version = "0.9.3";
-
format = "setuptools";
disabled = pythonOlder "3.7";
···
owner = "coleifer";
repo = "walrus";
rev = "refs/tags/${version}";
-
hash = "sha256-jinYMGSBAY8HTg92qU/iU5vGIrrDr5SeQG0XjsBVfcc=";
};
-
patches = [
-
# distutils has been deprecated, this wraps its import inside a try-catch
-
# and fallsback to a fallback import.
-
# Should not be necessary in future versions.
-
(fetchpatch {
-
url = "https://github.com/coleifer/walrus/commit/79e20c89aa4015017ef8a3e0b5c27ca2731dc9b2.patch";
-
hash = "sha256-hCpvki6SV3KYhicjjUMP4VrKMEerMjq2n1BgozXKDO8=";
-
})
-
];
-
propagatedBuildInputs = [ redis ];
nativeCheckInputs = [ unittestCheckHook ];
···
{
lib,
buildPythonPackage,
fetchFromGitHub,
+
pkgs,
pythonOlder,
redis,
+
setuptools,
unittestCheckHook,
}:
buildPythonPackage rec {
pname = "walrus";
+
version = "0.9.4";
+
pyproject = true;
disabled = pythonOlder "3.7";
···
owner = "coleifer";
repo = "walrus";
rev = "refs/tags/${version}";
+
hash = "sha256-cvoRiaGGTpZWfSE6DDT6GwDmc/TC/Z/E76Qy9Zzkpsw=";
};
+
build-system = [ setuptools ];
+
dependencies = [ redis ];
nativeCheckInputs = [ unittestCheckHook ];
+59
pkgs/development/python-modules/webrtc-models/default.nix
···
···
+
{
+
lib,
+
buildPythonPackage,
+
fetchFromGitHub,
+
hatchling,
+
mashumaro,
+
orjson,
+
pytest-asyncio,
+
pytest-cov-stub,
+
pytestCheckHook,
+
pythonOlder,
+
syrupy,
+
}:
+
+
buildPythonPackage rec {
+
pname = "webrtc-models";
+
version = "0.1.0";
+
pyproject = true;
+
+
disabled = pythonOlder "3.12";
+
+
src = fetchFromGitHub {
+
owner = "home-assistant-libs";
+
repo = "python-webrtc-models";
+
rev = "refs/tags/${version}";
+
hash = "sha256-Wmz+P4FFJJZujWF0SR6HVERNNO7xSM1iCayg6tmVyso=";
+
};
+
+
postPatch = ''
+
substituteInPlace pyproject.toml \
+
--replace-fail 'version = "0.0.0"' 'version = "${version}"'
+
'';
+
+
pythonRelaxDeps = [ "orjson" ];
+
+
build-system = [ hatchling ];
+
+
dependencies = [
+
mashumaro
+
orjson
+
];
+
+
nativeCheckInputs = [
+
pytest-asyncio
+
pytest-cov-stub
+
pytestCheckHook
+
syrupy
+
];
+
+
pythonImportsCheck = [ "webrtc_models" ];
+
+
meta = {
+
description = "WebRTC models as Python dataclasses with mashumaro";
+
homepage = "https://github.com/home-assistant-libs/python-webrtc-models";
+
changelog = "https://github.com/home-assistant-libs/python-webrtc-models/releases/tag/${version}";
+
license = lib.licenses.asl20;
+
maintainers = with lib.maintainers; [ fab ];
+
};
+
}
-12
pkgs/development/tools/build-managers/gradle/default.nix
···
defaultJava = jdk17;
};
-
gradle_6 = gen {
-
version = "6.9.4";
-
hash = "sha256-PiQCKFON6fGHcqV06ZoLqVnoPW7zUQFDgazZYxeBOJo=";
-
defaultJava = jdk11;
-
meta.knownVulnerabilities = [
-
"CVE-2021-29429: '[...]files created with open permissions in the system temporary directory can allow an attacker to access information downloaded by Gradle[...]'"
-
"CVE-2021-29427: '[...]there is a vulnerability which can lead to information disclosure and/or dependency poisoning[...] In some cases, Gradle may ignore content filters and search all repositories for dependencies. This only occurs when repository content filtering is used from within a `pluginManagement` block in a settings file.'"
-
"CVE-2021-29428: '[...]the system temporary directory can be created with open permissions that allow multiple users to create and delete files within it. Gradle builds could be vulnerable to a local privilege escalation from an attacker quickly deleting and recreating files in the system temporary directory.'"
-
"CVE-2021-32751: '[...]start scripts generated by the `application` plugin and the `gradlew` script are both vulnerable to arbitrary code execution when an attacker is able to change environment variables for the user running the script[...]'"
-
];
-
};
-
wrapGradle = {
lib, callPackage, mitm-cache, substituteAll, symlinkJoin, concatTextFile, makeSetupHook, nix-update-script
}:
···
defaultJava = jdk17;
};
wrapGradle = {
lib, callPackage, mitm-cache, substituteAll, symlinkJoin, concatTextFile, makeSetupHook, nix-update-script
}:
+3 -3
pkgs/servers/home-assistant/custom-lovelace-modules/mushroom/default.nix
···
buildNpmPackage rec {
pname = "mushroom";
-
version = "4.0.7";
src = fetchFromGitHub {
owner = "piitaya";
repo = "lovelace-mushroom";
rev = "v${version}";
-
hash = "sha256-97FW4kNPaoP501xD0W/PjmykwhLbLz7yHVNZiwl/clE=";
};
-
npmDepsHash = "sha256-Gpt17teEbBMHU8teiH66fjZmgq+6v/XovTVxNfHFTg4=";
installPhase = ''
runHook preInstall
···
buildNpmPackage rec {
pname = "mushroom";
+
version = "4.0.8";
src = fetchFromGitHub {
owner = "piitaya";
repo = "lovelace-mushroom";
rev = "v${version}";
+
hash = "sha256-jwL/LrnQsjwv9Wt+jmJKE7jJ3YO8K7eBkxkvAvCbg7g=";
};
+
npmDepsHash = "sha256-fzmVRmX1lBy+t7gRCUfw2ONYyKDUs6IkSnAstiYJ7qg=";
installPhase = ''
runHook preInstall
+41
pkgs/servers/monitoring/nagios-plugins/openbsd_snmp3_check/default.nix
···
···
+
{
+
fetchFromGitHub,
+
lib,
+
nix-update-script,
+
openbsd_snmp3_check,
+
python3Packages,
+
testers,
+
}:
+
python3Packages.buildPythonApplication rec {
+
pname = "openbsd_snmp3_check";
+
version = "0.55";
+
pyproject = false;
+
+
src = fetchFromGitHub {
+
owner = "alexander-naumov";
+
repo = "openbsd_snmp3_check";
+
rev = "v${version}";
+
hash = "sha256-qDYANMvQU72f9wz8os7S1PfBH08AAqhtWLHVuSmkub4=";
+
};
+
+
postInstall = ''
+
install -Dm755 openbsd_snmp3.py $out/bin/openbsd_snmp3.py
+
'';
+
+
passthru = {
+
updateScript = nix-update-script { };
+
tests.version = testers.testVersion {
+
package = openbsd_snmp3_check;
+
};
+
};
+
+
meta = with lib; {
+
changelog = "https://github.com/alexander-naumov/openbsd_snmp3_check/releases/tag/v${version}";
+
description = "SNMP v3 check for OpenBSD systems state monitoring";
+
homepage = "https://github.com/alexander-naumov/openbsd_snmp3_check";
+
license = with licenses; [ bsd3 ];
+
platforms = platforms.unix;
+
maintainers = with maintainers; [ jwillikers ];
+
mainProgram = "openbsd_snmp3.py";
+
};
+
}
+1
pkgs/servers/monitoring/nagios-plugins/plugins.nix
···
inherit (callPackage ./labs_consol_de { }) check_mssql_health check_nwc_health check_ups_health;
manubulon-snmp-plugins = callPackage ./manubulon-snmp-plugins { };
}
···
inherit (callPackage ./labs_consol_de { }) check_mssql_health check_nwc_health check_ups_health;
manubulon-snmp-plugins = callPackage ./manubulon-snmp-plugins { };
+
openbsd_snmp3_check = callPackage ./openbsd_snmp3_check { };
}
-40
pkgs/servers/monitoring/prometheus/tor-exporter.nix
···
-
{ lib, fetchFromGitHub, python3Packages, nixosTests }:
-
-
python3Packages.buildPythonApplication rec {
-
pname = "tor-exporter";
-
version = "0.4";
-
-
# Just a single .py file to use as the application's main entry point.
-
format = "other";
-
-
src = fetchFromGitHub {
-
rev = "v${version}";
-
owner = "atx";
-
repo = "prometheus-tor_exporter";
-
sha256 = "1gzf42z0cgdqijbi9cwpjkqzkvnabaxkkfa5ac5h27r3pxx3q4n0";
-
};
-
-
propagatedBuildInputs = with python3Packages; [ prometheus-client stem retrying ];
-
-
installPhase = ''
-
mkdir -p $out/share/
-
cp prometheus-tor-exporter.py $out/share/
-
'';
-
-
fixupPhase = ''
-
makeWrapper "${python3Packages.python.interpreter}" "$out/bin/prometheus-tor-exporter" \
-
--set PYTHONPATH "$PYTHONPATH" \
-
--add-flags "$out/share/prometheus-tor-exporter.py"
-
'';
-
-
passthru.tests = { inherit (nixosTests.prometheus-exporters) tor; };
-
-
meta = with lib; {
-
description = "Prometheus exporter that exposes metrics from a Tor daemon";
-
mainProgram = "prometheus-tor-exporter";
-
homepage = "https://github.com/atx/prometheus-tor_exporter";
-
license = licenses.mit;
-
maintainers = with maintainers; [ Scrumplex ];
-
platforms = platforms.unix;
-
};
-
}
···
+4 -4
pkgs/servers/teleport/15/default.nix
···
{ wasm-bindgen-cli, ... }@args:
import ../generic.nix (args // {
-
version = "15.4.11";
-
hash = "sha256-vmJ76aRAsbSGXZ2HcuryOlUYrUOPMP6MaI8OjxxyiZ4=";
-
vendorHash = "sha256-oJo8Ga6TAUz1xSYiRckzq8zZvgIZFCeEwZbiyyVOdkI=";
-
yarnHash = "sha256-5ppgBa5CyQ49FSFhdWDbTcCTdt0vsXAzNTeyG4r7crg=";
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
···
{ wasm-bindgen-cli, ... }@args:
import ../generic.nix (args // {
+
version = "15.4.21";
+
hash = "sha256-n5dAJ5ilq5nHo3neQzCUFnDRwLhArwleMSho4/g0MT4=";
+
vendorHash = "sha256-bW8ztNeSzxUNtbuBtxIya9TeGfktC+/fz9iXB0GL0Mg=";
+
yarnHash = "sha256-ZaLLrcwAeq6TQ1SaA2few4s0HqktOZEpxCTcNGloGfk=";
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
+3 -3
pkgs/servers/teleport/16/default.nix
···
{ wasm-bindgen-cli, ... }@args:
import ../generic.nix (args // {
-
version = "16.2.0";
-
hash = "sha256-3LLoO7SNJfEfDEU7JnAhmAOIdRO+TkgiJKjT8sqzelo=";
vendorHash = "sha256-iyYfht0aB9Vv2hsaqrieFHXbDhlotKQYfLn4JFqpve8=";
-
pnpmHash = "sha256-lcev7VwTcuCuced8uZzLoobREWtNRDFRFdfmabJPLtc=";
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
···
{ wasm-bindgen-cli, ... }@args:
import ../generic.nix (args // {
+
version = "16.4.6";
+
hash = "sha256-TdOCFs6YeqINM8aPryrjYPaXEjc/gIqu7kzVYDnMsjg=";
vendorHash = "sha256-iyYfht0aB9Vv2hsaqrieFHXbDhlotKQYfLn4JFqpve8=";
+
pnpmHash = "sha256-NF45Wp4itYud01VzxC8bRHZ3xZ1T1du1QmZTDMS5nOk=";
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
+1 -1
pkgs/servers/teleport/generic.nix
···
patches = extPatches ++ [
./0001-fix-add-nix-path-to-exec-env.patch
./rdpclient.patch
-
(if lib.versionAtLeast version "16" then ./tsh_16.patch else ./tsh.patch)
];
# Reduce closure size for client machines
···
patches = extPatches ++ [
./0001-fix-add-nix-path-to-exec-env.patch
./rdpclient.patch
+
./tsh.patch
];
# Reduce closure size for client machines
+1 -1
pkgs/servers/teleport/tsh.patch
···
if err != nil {
return trace.Wrap(err)
}
-
+ cf.executablePath = path.Dir(tempBinaryPath) + "/tsh"
// configs
setEnvFlags(&cf)
···
if err != nil {
return trace.Wrap(err)
}
+
+ cf.executablePath = filepath.Dir(tempBinaryPath) + "/tsh"
// configs
setEnvFlags(&cf)
-17
pkgs/servers/teleport/tsh_16.patch
···
-
diff --git a/tool/tsh/common/tsh.go b/tool/tsh/common/tsh.go
-
index 5de21c69d0..3995c19e3c 100644
-
--- a/tool/tsh/common/tsh.go
-
+++ b/tool/tsh/common/tsh.go
-
@@ -1084,10 +1084,11 @@ func Run(ctx context.Context, args []string, opts ...CliOption) error {
-
-
var err error
-
-
- cf.executablePath, err = os.Executable()
-
+ tempBinaryPath, err := os.Executable()
-
if err != nil {
-
return trace.Wrap(err)
-
}
-
+ cf.executablePath = filepath.Dir(tempBinaryPath) + "/tsh"
-
-
// configs
-
setEnvFlags(&cf)
···
+2 -2
pkgs/servers/web-apps/nifi/default.nix
···
stdenv.mkDerivation rec {
pname = "nifi";
-
version = "1.27.0";
src = fetchzip {
url = "mirror://apache/nifi/${version}/nifi-${version}-bin.zip";
-
hash = "sha256-D3o7MLn8vdDqzk6/AJ7Lmq6Yx2swy8CwOyDTlxFSVME=";
};
nativeBuildInputs = [ makeWrapper ];
···
stdenv.mkDerivation rec {
pname = "nifi";
+
version = "1.28.0";
src = fetchzip {
url = "mirror://apache/nifi/${version}/nifi-${version}-bin.zip";
+
hash = "sha256-EQqosdwNdaSUIcP3QlvzJZhDNu1JbHg08FlnZo6ogmQ=";
};
nativeBuildInputs = [ makeWrapper ];
+3 -3
pkgs/servers/x11/xorg/default.nix
···
# THIS IS A GENERATED FILE. DO NOT EDIT!
libAppleWM = callPackage ({ stdenv, pkg-config, fetchurl, xorgproto, libX11, libXext, testers }: stdenv.mkDerivation (finalAttrs: {
pname = "libAppleWM";
-
version = "1.4.1";
builder = ./builder.sh;
src = fetchurl {
-
url = "mirror://xorg/individual/lib/libAppleWM-1.4.1.tar.bz2";
-
sha256 = "0r8x28n45q89x91mz8mv0zkkcxi8wazkac886fyvflhiv2y8ap2y";
};
hardeningDisable = [ "bindnow" "relro" ];
strictDeps = true;
···
# THIS IS A GENERATED FILE. DO NOT EDIT!
libAppleWM = callPackage ({ stdenv, pkg-config, fetchurl, xorgproto, libX11, libXext, testers }: stdenv.mkDerivation (finalAttrs: {
pname = "libAppleWM";
+
version = "be972ebc3a97292e7d2b2350eff55ae12df99a42";
builder = ./builder.sh;
src = fetchurl {
+
url = "https://gitlab.freedesktop.org/xorg/lib/libAppleWM/-/archive/be972ebc3a97292e7d2b2350eff55ae12df99a42/libAppleWM-be972ebc3a97292e7d2b2350eff55ae12df99a42.tar.bz2";
+
sha256 = "1hrq03pahmrbb05r6a7j7m1nxl65wlfi6d2lwm1kvra63q91f9ph";
};
hardeningDisable = [ "bindnow" "relro" ];
strictDeps = true;
+2 -4
pkgs/servers/x11/xorg/overrides.nix
···
});
libAppleWM = super.libAppleWM.overrideAttrs (attrs: {
-
buildInputs = attrs.buildInputs ++ [ ApplicationServices ];
-
preConfigure = ''
-
substituteInPlace src/Makefile.in --replace -F/System -F${ApplicationServices}
-
'';
});
libXau = super.libXau.overrideAttrs (attrs: {
···
});
libAppleWM = super.libAppleWM.overrideAttrs (attrs: {
+
nativeBuildInputs = attrs.nativeBuildInputs ++ [ autoreconfHook ];
+
buildInputs = attrs.buildInputs ++ [ xorg.utilmacros ];
});
libXau = super.libXau.overrideAttrs (attrs: {
+1 -1
pkgs/servers/x11/xorg/tarballs.list
···
mirror://xorg/individual/font/font-util-1.4.1.tar.xz
mirror://xorg/individual/font/font-winitzki-cyrillic-1.0.4.tar.xz
mirror://xorg/individual/font/font-xfree86-type1-1.0.5.tar.xz
-
mirror://xorg/individual/lib/libAppleWM-1.4.1.tar.bz2
mirror://xorg/individual/lib/libdmx-1.1.5.tar.xz
mirror://xorg/individual/lib/libfontenc-1.1.8.tar.xz
mirror://xorg/individual/lib/libFS-1.0.10.tar.xz
···
mirror://xorg/individual/font/font-util-1.4.1.tar.xz
mirror://xorg/individual/font/font-winitzki-cyrillic-1.0.4.tar.xz
mirror://xorg/individual/font/font-xfree86-type1-1.0.5.tar.xz
+
https://gitlab.freedesktop.org/xorg/lib/libAppleWM/-/archive/be972ebc3a97292e7d2b2350eff55ae12df99a42/libAppleWM-be972ebc3a97292e7d2b2350eff55ae12df99a42.tar.bz2
mirror://xorg/individual/lib/libdmx-1.1.5.tar.xz
mirror://xorg/individual/lib/libfontenc-1.1.8.tar.xz
mirror://xorg/individual/lib/libFS-1.0.10.tar.xz
-30
pkgs/tools/misc/hexyl/default.nix
···
-
{ lib, rustPlatform, fetchFromGitHub }:
-
-
rustPlatform.buildRustPackage rec {
-
pname = "hexyl";
-
version = "0.14.0";
-
-
src = fetchFromGitHub {
-
owner = "sharkdp";
-
repo = pname;
-
rev = "v${version}";
-
hash = "sha256-di7SBuB4LsnqlP3BdMcsSLj4zpyKA/ninVpRyR9AJaI=";
-
};
-
-
cargoHash = "sha256-fXrdOiCmRgMPJxZIS/SkTkZZkag8ZUhNnMlU4k1m/+0=";
-
-
meta = with lib; {
-
description = "Command-line hex viewer";
-
longDescription = ''
-
`hexyl` is a simple hex viewer for the terminal. It uses a colored
-
output to distinguish different categories of bytes (NULL bytes,
-
printable ASCII characters, ASCII whitespace characters, other ASCII
-
characters and non-ASCII).
-
'';
-
homepage = "https://github.com/sharkdp/hexyl";
-
changelog = "https://github.com/sharkdp/hexyl/blob/v${version}/CHANGELOG.md";
-
license = with licenses; [ asl20 /* or */ mit ];
-
maintainers = with maintainers; [ dywedir figsoda SuperSandro2000 ];
-
mainProgram = "hexyl";
-
};
-
}
···
+2 -2
pkgs/tools/misc/panoply/default.nix
···
stdenvNoCC.mkDerivation rec {
pname = "panoply";
-
version = "5.5.3";
src = fetchurl {
url = "https://www.giss.nasa.gov/tools/panoply/download/PanoplyJ-${version}.tgz";
-
hash = "sha256-TCuCLWMVp7t0JpHA6TbwUdURj/aBggzLa9I7llRY0TU=";
};
nativeBuildInputs = [ makeWrapper ];
···
stdenvNoCC.mkDerivation rec {
pname = "panoply";
+
version = "5.5.4";
src = fetchurl {
url = "https://www.giss.nasa.gov/tools/panoply/download/PanoplyJ-${version}.tgz";
+
hash = "sha256-rC2vQcaanK2nNSDtiXNhyBiV0SN3QqtwU8WNBc7D/Nw=";
};
nativeBuildInputs = [ makeWrapper ];
+4
pkgs/tools/package-management/nix/common.nix
···
atLeast210 = lib.versionAtLeast version "2.10pre";
atLeast213 = lib.versionAtLeast version "2.13pre";
atLeast214 = lib.versionAtLeast version "2.14pre";
atLeast219 = lib.versionAtLeast version "2.19pre";
atLeast220 = lib.versionAtLeast version "2.20pre";
atLeast221 = lib.versionAtLeast version "2.21pre";
···
, callPackage
, coreutils
, curl
, docbook_xsl_ns
, docbook5
, editline
···
libseccomp
] ++ lib.optionals withAWS [
aws-sdk-cpp
];
···
atLeast210 = lib.versionAtLeast version "2.10pre";
atLeast213 = lib.versionAtLeast version "2.13pre";
atLeast214 = lib.versionAtLeast version "2.14pre";
+
atLeast218 = lib.versionAtLeast version "2.18pre";
atLeast219 = lib.versionAtLeast version "2.19pre";
atLeast220 = lib.versionAtLeast version "2.20pre";
atLeast221 = lib.versionAtLeast version "2.21pre";
···
, callPackage
, coreutils
, curl
+
, darwin
, docbook_xsl_ns
, docbook5
, editline
···
libseccomp
] ++ lib.optionals withAWS [
aws-sdk-cpp
+
] ++ lib.optional (atLeast218 && stdenv.hostPlatform.isDarwin) [
+
darwin.apple_sdk.libs.sandbox
];
+51
pkgs/tools/package-management/nix/default.nix
···
version = "2.18.8";
hash = "sha256-0rHRifdjzzxMh/im8pRx6XoY62irDTDUes+Pn0CR65I=";
self_attribute_name = "nix_2_18";
};
nix_2_19 = common {
version = "2.19.6";
hash = "sha256-XT5xiwOLgXf+TdyOjbJVOl992wu9mBO25WXHoyli/Tk=";
self_attribute_name = "nix_2_19";
};
nix_2_20 = common {
version = "2.20.8";
hash = "sha256-M2tkMtjKi8LDdNLsKi3IvD8oY/i3rtarjMpvhybS3WY=";
self_attribute_name = "nix_2_20";
};
nix_2_21 = common {
version = "2.21.4";
hash = "sha256-c6nVZ0pSrfhFX3eVKqayS+ioqyAGp3zG9ZPO5rkXFRQ=";
self_attribute_name = "nix_2_21";
};
nix_2_22 = common {
version = "2.22.3";
hash = "sha256-l04csH5rTWsK7eXPWVxJBUVRPMZXllFoSkYFTq/i8WU=";
self_attribute_name = "nix_2_22";
};
nix_2_23 = common {
version = "2.23.3";
hash = "sha256-lAoLGVIhRFrfgv7wcyduEkyc83QKrtsfsq4of+WrBeg=";
self_attribute_name = "nix_2_23";
};
nix_2_24 = (common {
version = "2.24.9";
hash = "sha256-OwJByTdCz1t91ysBqynK+ifszkoIGEXUn6HE2t82+c8=";
self_attribute_name = "nix_2_24";
}).override (lib.optionalAttrs (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) {
# Fix the following error with the default x86_64-darwin SDK:
#
···
rev = "ca3fc1693b309ab6b8b0c09408a08d0055bf0363";
hash = "sha256-Hp7dkx7zfB9a4l5QusXUob0b1T2qdZ23LFo5dcp3xrU=";
};
self_attribute_name = "git";
}).override (lib.optionalAttrs (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) {
# Fix the following error with the default x86_64-darwin SDK:
···
version = "2.18.8";
hash = "sha256-0rHRifdjzzxMh/im8pRx6XoY62irDTDUes+Pn0CR65I=";
self_attribute_name = "nix_2_18";
+
patches = [
+
./patches/2_18/0001-fix-Run-all-derivation-builders-inside-the-sandbox-o.patch
+
./patches/2_18/0002-local-derivation-goal-Print-sandbox-error-detail-on-.patch
+
./patches/2_18/0003-local-derivation-goal-Refactor.patch
+
./patches/2_18/0004-local-derivation-goal-Move-builder-preparation-to-no.patch
+
];
};
nix_2_19 = common {
version = "2.19.6";
hash = "sha256-XT5xiwOLgXf+TdyOjbJVOl992wu9mBO25WXHoyli/Tk=";
self_attribute_name = "nix_2_19";
+
patches = [
+
./patches/2_19/0001-fix-Run-all-derivation-builders-inside-the-sandbox-o.patch
+
./patches/2_19/0002-local-derivation-goal-Print-sandbox-error-detail-on-.patch
+
./patches/2_19/0003-local-derivation-goal-Refactor.patch
+
./patches/2_19/0004-local-derivation-goal-Move-builder-preparation-to-no.patch
+
];
};
nix_2_20 = common {
version = "2.20.8";
hash = "sha256-M2tkMtjKi8LDdNLsKi3IvD8oY/i3rtarjMpvhybS3WY=";
self_attribute_name = "nix_2_20";
+
patches = [
+
./patches/2_20/0001-fix-Run-all-derivation-builders-inside-the-sandbox-o.patch
+
./patches/2_20/0002-local-derivation-goal-Print-sandbox-error-detail-on-.patch
+
./patches/2_20/0003-local-derivation-goal-Refactor.patch
+
./patches/2_20/0004-local-derivation-goal-Move-builder-preparation-to-no.patch
+
];
};
nix_2_21 = common {
version = "2.21.4";
hash = "sha256-c6nVZ0pSrfhFX3eVKqayS+ioqyAGp3zG9ZPO5rkXFRQ=";
self_attribute_name = "nix_2_21";
+
patches = [
+
./patches/2_21/0001-fix-Run-all-derivation-builders-inside-the-sandbox-o.patch
+
./patches/2_21/0002-local-derivation-goal-Print-sandbox-error-detail-on-.patch
+
./patches/2_21/0003-local-derivation-goal-Refactor.patch
+
./patches/2_21/0004-local-derivation-goal-Move-builder-preparation-to-no.patch
+
];
};
nix_2_22 = common {
version = "2.22.3";
hash = "sha256-l04csH5rTWsK7eXPWVxJBUVRPMZXllFoSkYFTq/i8WU=";
self_attribute_name = "nix_2_22";
+
patches = [
+
./patches/2_22/0001-fix-Run-all-derivation-builders-inside-the-sandbox-o.patch
+
./patches/2_22/0002-local-derivation-goal-Print-sandbox-error-detail-on-.patch
+
./patches/2_22/0003-local-derivation-goal-Refactor.patch
+
./patches/2_22/0004-local-derivation-goal-Move-builder-preparation-to-no.patch
+
];
};
nix_2_23 = common {
version = "2.23.3";
hash = "sha256-lAoLGVIhRFrfgv7wcyduEkyc83QKrtsfsq4of+WrBeg=";
self_attribute_name = "nix_2_23";
+
patches = [
+
./patches/2_23/0001-fix-Run-all-derivation-builders-inside-the-sandbox-o.patch
+
./patches/2_23/0002-local-derivation-goal-Print-sandbox-error-detail-on-.patch
+
./patches/2_23/0003-local-derivation-goal-Refactor.patch
+
./patches/2_23/0004-local-derivation-goal-Move-builder-preparation-to-no.patch
+
];
};
nix_2_24 = (common {
version = "2.24.9";
hash = "sha256-OwJByTdCz1t91ysBqynK+ifszkoIGEXUn6HE2t82+c8=";
self_attribute_name = "nix_2_24";
+
patches = [
+
./patches/2_24/0001-fix-Run-all-derivation-builders-inside-the-sandbox-o.patch
+
./patches/2_24/0002-packaging-Add-darwin-lsandbox-in-meson.patch
+
./patches/2_24/0003-local-derivation-goal-Print-sandbox-error-detail-on-.patch
+
./patches/2_24/0004-local-derivation-goal-Refactor.patch
+
./patches/2_24/0005-local-derivation-goal-Move-builder-preparation-to-no.patch
+
];
}).override (lib.optionalAttrs (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) {
# Fix the following error with the default x86_64-darwin SDK:
#
···
rev = "ca3fc1693b309ab6b8b0c09408a08d0055bf0363";
hash = "sha256-Hp7dkx7zfB9a4l5QusXUob0b1T2qdZ23LFo5dcp3xrU=";
};
+
patches = [
+
./patches/git/0001-Fix-meson-build-on-darwin.patch
+
./patches/git/0002-fix-Run-all-derivation-builders-inside-the-sandbox-o.patch
+
./patches/git/0003-packaging-Add-darwin-lsandbox-in-meson.patch
+
./patches/git/0004-local-derivation-goal-Print-sandbox-error-detail-on-.patch
+
./patches/git/0005-local-derivation-goal-Refactor.patch
+
./patches/git/0006-local-derivation-goal-Move-builder-preparation-to-no.patch
+
];
self_attribute_name = "git";
}).override (lib.optionalAttrs (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) {
# Fix the following error with the default x86_64-darwin SDK:
+315
pkgs/tools/package-management/nix/patches/2_18/0001-fix-Run-all-derivation-builders-inside-the-sandbox-o.patch
···
···
+
From 3c4bc6929eb13cf648c54931a28797bb1c289052 Mon Sep 17 00:00:00 2001
+
From: Puck Meerburg <puck@puckipedia.com>
+
Date: Fri, 1 Mar 2024 11:42:24 -0500
+
Subject: [PATCH 1/4] fix: Run all derivation builders inside the sandbox on
+
macOS
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
configure.ac | 6 +-
+
flake.nix | 1 +
+
src/libstore/build/local-derivation-goal.cc | 221 ++++++++++----------
+
3 files changed, 114 insertions(+), 114 deletions(-)
+
+
diff --git a/configure.ac b/configure.ac
+
index 4e50d0913..44852ad79 100644
+
--- a/configure.ac
+
+++ b/configure.ac
+
@@ -58,13 +58,17 @@ AC_CHECK_TOOL([AR], [ar])
+
AC_SYS_LARGEFILE
+
+
+
-# Solaris-specific stuff.
+
+# OS-specific stuff.
+
AC_STRUCT_DIRENT_D_TYPE
+
case "$host_os" in
+
solaris*)
+
# Solaris requires -lsocket -lnsl for network functions
+
LDFLAGS="-lsocket -lnsl $LDFLAGS"
+
;;
+
+ darwin*)
+
+ # Need to link to libsandbox.
+
+ LDFLAGS="-lsandbox $LDFLAGS"
+
+ ;;
+
esac
+
+
+
diff --git a/flake.nix b/flake.nix
+
index 6c9bef4d8..66ac1bfd8 100644
+
--- a/flake.nix
+
+++ b/flake.nix
+
@@ -173,6 +173,7 @@
+
boost
+
lowdown-nix
+
]
+
+ ++ lib.optionals stdenv.isDarwin [darwin.apple_sdk.libs.sandbox]
+
++ lib.optionals stdenv.isLinux [(libseccomp.overrideAttrs (_: rec {
+
version = "2.5.5";
+
src = fetchurl {
+
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
+
index 4d690beaf..fb83cfdc7 100644
+
--- a/src/libstore/build/local-derivation-goal.cc
+
+++ b/src/libstore/build/local-derivation-goal.cc
+
@@ -53,6 +53,10 @@
+
#if __APPLE__
+
#include <spawn.h>
+
#include <sys/sysctl.h>
+
+#include <sandbox.h>
+
+
+
+/* This definition is undocumented but depended upon by all major browsers. */
+
+extern "C" int sandbox_init_with_parameters(const char *profile, uint64_t flags, const char *const parameters[], char **errorbuf);
+
#endif
+
+
#include <pwd.h>
+
@@ -2034,141 +2038,132 @@ void LocalDerivationGoal::runChild()
+
+
std::string builder = "invalid";
+
+
- if (drv->isBuiltin()) {
+
- ;
+
- }
+
#if __APPLE__
+
- else {
+
- /* This has to appear before import statements. */
+
- std::string sandboxProfile = "(version 1)\n";
+
-
+
- if (useChroot) {
+
-
+
- /* Lots and lots and lots of file functions freak out if they can't stat their full ancestry */
+
- PathSet ancestry;
+
-
+
- /* We build the ancestry before adding all inputPaths to the store because we know they'll
+
- all have the same parents (the store), and there might be lots of inputs. This isn't
+
- particularly efficient... I doubt it'll be a bottleneck in practice */
+
- for (auto & i : dirsInChroot) {
+
- Path cur = i.first;
+
- while (cur.compare("/") != 0) {
+
- cur = dirOf(cur);
+
- ancestry.insert(cur);
+
- }
+
- }
+
+ /* This has to appear before import statements. */
+
+ std::string sandboxProfile = "(version 1)\n";
+
+
- /* And we want the store in there regardless of how empty dirsInChroot. We include the innermost
+
- path component this time, since it's typically /nix/store and we care about that. */
+
- Path cur = worker.store.storeDir;
+
+ if (useChroot) {
+
+
+
+ /* Lots and lots and lots of file functions freak out if they can't stat their full ancestry */
+
+ PathSet ancestry;
+
+
+
+ /* We build the ancestry before adding all inputPaths to the store because we know they'll
+
+ all have the same parents (the store), and there might be lots of inputs. This isn't
+
+ particularly efficient... I doubt it'll be a bottleneck in practice */
+
+ for (auto & i : dirsInChroot) {
+
+ Path cur = i.first;
+
while (cur.compare("/") != 0) {
+
- ancestry.insert(cur);
+
cur = dirOf(cur);
+
+ ancestry.insert(cur);
+
}
+
+ }
+
+
- /* Add all our input paths to the chroot */
+
- for (auto & i : inputPaths) {
+
- auto p = worker.store.printStorePath(i);
+
- dirsInChroot[p] = p;
+
- }
+
-
+
- /* Violations will go to the syslog if you set this. Unfortunately the destination does not appear to be configurable */
+
- if (settings.darwinLogSandboxViolations) {
+
- sandboxProfile += "(deny default)\n";
+
- } else {
+
- sandboxProfile += "(deny default (with no-log))\n";
+
- }
+
+ /* And we want the store in there regardless of how empty dirsInChroot. We include the innermost
+
+ path component this time, since it's typically /nix/store and we care about that. */
+
+ Path cur = worker.store.storeDir;
+
+ while (cur.compare("/") != 0) {
+
+ ancestry.insert(cur);
+
+ cur = dirOf(cur);
+
+ }
+
+
- sandboxProfile +=
+
- #include "sandbox-defaults.sb"
+
- ;
+
+ /* Add all our input paths to the chroot */
+
+ for (auto & i : inputPaths) {
+
+ auto p = worker.store.printStorePath(i);
+
+ dirsInChroot[p] = p;
+
+ }
+
+
- if (!derivationType->isSandboxed())
+
- sandboxProfile +=
+
- #include "sandbox-network.sb"
+
- ;
+
-
+
- /* Add the output paths we'll use at build-time to the chroot */
+
- sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
- for (auto & [_, path] : scratchOutputs)
+
- sandboxProfile += fmt("\t(subpath \"%s\")\n", worker.store.printStorePath(path));
+
-
+
- sandboxProfile += ")\n";
+
-
+
- /* Our inputs (transitive dependencies and any impurities computed above)
+
-
+
- without file-write* allowed, access() incorrectly returns EPERM
+
- */
+
- sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
- for (auto & i : dirsInChroot) {
+
- if (i.first != i.second.source)
+
- throw Error(
+
- "can't map '%1%' to '%2%': mismatched impure paths not supported on Darwin",
+
- i.first, i.second.source);
+
-
+
- std::string path = i.first;
+
- struct stat st;
+
- if (lstat(path.c_str(), &st)) {
+
- if (i.second.optional && errno == ENOENT)
+
- continue;
+
- throw SysError("getting attributes of path '%s", path);
+
- }
+
- if (S_ISDIR(st.st_mode))
+
- sandboxProfile += fmt("\t(subpath \"%s\")\n", path);
+
- else
+
- sandboxProfile += fmt("\t(literal \"%s\")\n", path);
+
- }
+
- sandboxProfile += ")\n";
+
+ /* Violations will go to the syslog if you set this. Unfortunately the destination does not appear to be configurable */
+
+ if (settings.darwinLogSandboxViolations) {
+
+ sandboxProfile += "(deny default)\n";
+
+ } else {
+
+ sandboxProfile += "(deny default (with no-log))\n";
+
+ }
+
+
- /* Allow file-read* on full directory hierarchy to self. Allows realpath() */
+
- sandboxProfile += "(allow file-read*\n";
+
- for (auto & i : ancestry) {
+
- sandboxProfile += fmt("\t(literal \"%s\")\n", i);
+
- }
+
- sandboxProfile += ")\n";
+
+ sandboxProfile +=
+
+ #include "sandbox-defaults.sb"
+
+ ;
+
+
- sandboxProfile += additionalSandboxProfile;
+
- } else
+
+ if (!derivationType->isSandboxed())
+
sandboxProfile +=
+
- #include "sandbox-minimal.sb"
+
+ #include "sandbox-network.sb"
+
;
+
+
- debug("Generated sandbox profile:");
+
- debug(sandboxProfile);
+
+ /* Add the output paths we'll use at build-time to the chroot */
+
+ sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
+ for (auto & [_, path] : scratchOutputs)
+
+ sandboxProfile += fmt("\t(subpath \"%s\")\n", worker.store.printStorePath(path));
+
+
- Path sandboxFile = tmpDir + "/.sandbox.sb";
+
+ sandboxProfile += ")\n";
+
+
- writeFile(sandboxFile, sandboxProfile);
+
+ /* Our inputs (transitive dependencies and any impurities computed above)
+
+
- bool allowLocalNetworking = parsedDrv->getBoolAttr("__darwinAllowLocalNetworking");
+
+ without file-write* allowed, access() incorrectly returns EPERM
+
+ */
+
+ sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
+ for (auto & i : dirsInChroot) {
+
+ if (i.first != i.second.source)
+
+ throw Error(
+
+ "can't map '%1%' to '%2%': mismatched impure paths not supported on Darwin",
+
+ i.first, i.second.source);
+
+
- /* The tmpDir in scope points at the temporary build directory for our derivation. Some packages try different mechanisms
+
- to find temporary directories, so we want to open up a broader place for them to dump their files, if needed. */
+
- Path globalTmpDir = canonPath(defaultTempDir(), true);
+
+ std::string path = i.first;
+
+ struct stat st;
+
+ if (lstat(path.c_str(), &st)) {
+
+ if (i.second.optional && errno == ENOENT)
+
+ continue;
+
+ throw SysError("getting attributes of path '%s", path);
+
+ }
+
+ if (S_ISDIR(st.st_mode))
+
+ sandboxProfile += fmt("\t(subpath \"%s\")\n", path);
+
+ else
+
+ sandboxProfile += fmt("\t(literal \"%s\")\n", path);
+
+ }
+
+ sandboxProfile += ")\n";
+
+
- /* They don't like trailing slashes on subpath directives */
+
- while (!globalTmpDir.empty() && globalTmpDir.back() == '/')
+
- globalTmpDir.pop_back();
+
+ /* Allow file-read* on full directory hierarchy to self. Allows realpath() */
+
+ sandboxProfile += "(allow file-read*\n";
+
+ for (auto & i : ancestry) {
+
+ sandboxProfile += fmt("\t(literal \"%s\")\n", i);
+
+ }
+
+ sandboxProfile += ")\n";
+
+
- if (getEnv("_NIX_TEST_NO_SANDBOX") != "1") {
+
- builder = "/usr/bin/sandbox-exec";
+
- args.push_back("sandbox-exec");
+
- args.push_back("-f");
+
- args.push_back(sandboxFile);
+
- args.push_back("-D");
+
- args.push_back("_GLOBAL_TMP_DIR=" + globalTmpDir);
+
- if (allowLocalNetworking) {
+
- args.push_back("-D");
+
- args.push_back(std::string("_ALLOW_LOCAL_NETWORKING=1"));
+
- }
+
- args.push_back(drv->builder);
+
- } else {
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
+ sandboxProfile += additionalSandboxProfile;
+
+ } else
+
+ sandboxProfile +=
+
+ #include "sandbox-minimal.sb"
+
+ ;
+
+
+
+ debug("Generated sandbox profile:");
+
+ debug(sandboxProfile);
+
+
+
+ bool allowLocalNetworking = parsedDrv->getBoolAttr("__darwinAllowLocalNetworking");
+
+
+
+ /* The tmpDir in scope points at the temporary build directory for our derivation. Some packages try different mechanisms
+
+ to find temporary directories, so we want to open up a broader place for them to dump their files, if needed. */
+
+ Path globalTmpDir = canonPath(defaultTempDir(), true);
+
+
+
+ /* They don't like trailing slashes on subpath directives */
+
+ while (!globalTmpDir.empty() && globalTmpDir.back() == '/')
+
+ globalTmpDir.pop_back();
+
+
+
+ if (getEnv("_NIX_TEST_NO_SANDBOX") != "1") {
+
+ Strings sandboxArgs;
+
+ sandboxArgs.push_back("_GLOBAL_TMP_DIR");
+
+ sandboxArgs.push_back(globalTmpDir);
+
+ if (allowLocalNetworking) {
+
+ sandboxArgs.push_back("_ALLOW_LOCAL_NETWORKING");
+
+ sandboxArgs.push_back("1");
+
+ }
+
+ if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), NULL)) {
+
+ writeFull(STDERR_FILENO, "failed to configure sandbox\n");
+
+ _exit(1);
+
}
+
}
+
+
+
+ builder = drv->builder;
+
+ args.push_back(std::string(baseNameOf(drv->builder)));
+
#else
+
- else {
+
+ if (!drv->isBuiltin()) {
+
builder = drv->builder;
+
args.push_back(std::string(baseNameOf(drv->builder)));
+
}
+
--
+
2.46.1
+
+34
pkgs/tools/package-management/nix/patches/2_18/0002-local-derivation-goal-Print-sandbox-error-detail-on-.patch
···
···
+
From 4ac099d6ab4b6851aeb8b7a1e37f5794716d5138 Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:44:12 +0200
+
Subject: [PATCH 2/4] local-derivation-goal: Print sandbox error detail on
+
darwin
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Co-Authored-By: Théophane Hufschmitt <theophane.hufschmitt@tweag.io>
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libstore/build/local-derivation-goal.cc | 5 +++--
+
1 file changed, 3 insertions(+), 2 deletions(-)
+
+
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
+
index fb83cfdc7..d41d1c1e5 100644
+
--- a/src/libstore/build/local-derivation-goal.cc
+
+++ b/src/libstore/build/local-derivation-goal.cc
+
@@ -2154,8 +2154,9 @@ void LocalDerivationGoal::runChild()
+
sandboxArgs.push_back("_ALLOW_LOCAL_NETWORKING");
+
sandboxArgs.push_back("1");
+
}
+
- if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), NULL)) {
+
- writeFull(STDERR_FILENO, "failed to configure sandbox\n");
+
+ char * sandbox_errbuf = nullptr;
+
+ if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), &sandbox_errbuf)) {
+
+ writeFull(STDERR_FILENO, fmt("failed to configure sandbox: %s\n", sandbox_errbuf ? sandbox_errbuf : "(null)"));
+
_exit(1);
+
}
+
}
+
--
+
2.46.1
+
+41
pkgs/tools/package-management/nix/patches/2_18/0003-local-derivation-goal-Refactor.patch
···
···
+
From 6fe3a5e26def808b99856099d74aa3017ecf6d9d Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:50:27 +0200
+
Subject: [PATCH 3/4] local-derivation-goal: Refactor
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
This works because the `builder` and `args` variables are only used
+
in the non-builtin code path.
+
+
Co-Authored-By: Théophane Hufschmitt <theophane.hufschmitt@tweag.io>
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libstore/build/local-derivation-goal.cc | 5 +----
+
1 file changed, 1 insertion(+), 4 deletions(-)
+
+
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
+
index d41d1c1e5..faecc403b 100644
+
--- a/src/libstore/build/local-derivation-goal.cc
+
+++ b/src/libstore/build/local-derivation-goal.cc
+
@@ -2160,15 +2160,12 @@ void LocalDerivationGoal::runChild()
+
_exit(1);
+
}
+
}
+
+#endif
+
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
-#else
+
if (!drv->isBuiltin()) {
+
builder = drv->builder;
+
args.push_back(std::string(baseNameOf(drv->builder)));
+
}
+
-#endif
+
+
for (auto & i : drv->args)
+
args.push_back(rewriteStrings(i, inputRewrites));
+
--
+
2.46.1
+
+75
pkgs/tools/package-management/nix/patches/2_18/0004-local-derivation-goal-Move-builder-preparation-to-no.patch
···
···
+
From d219faa93badcfc8134c81ba0d2b821775eb947c Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:57:00 +0200
+
Subject: [PATCH 4/4] local-derivation-goal: Move builder preparation to
+
non-builtin code path
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libstore/build/local-derivation-goal.cc | 25 +++++++++------------
+
1 file changed, 10 insertions(+), 15 deletions(-)
+
+
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
+
index faecc403b..23d5d5e3f 100644
+
--- a/src/libstore/build/local-derivation-goal.cc
+
+++ b/src/libstore/build/local-derivation-goal.cc
+
@@ -2033,11 +2033,6 @@ void LocalDerivationGoal::runChild()
+
throw SysError("setuid failed");
+
}
+
+
- /* Fill in the arguments. */
+
- Strings args;
+
-
+
- std::string builder = "invalid";
+
-
+
#if __APPLE__
+
/* This has to appear before import statements. */
+
std::string sandboxProfile = "(version 1)\n";
+
@@ -2162,14 +2157,6 @@ void LocalDerivationGoal::runChild()
+
}
+
#endif
+
+
- if (!drv->isBuiltin()) {
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
- }
+
-
+
- for (auto & i : drv->args)
+
- args.push_back(rewriteStrings(i, inputRewrites));
+
-
+
/* Indicate that we managed to set up the build environment. */
+
writeFull(STDERR_FILENO, std::string("\2\n"));
+
+
@@ -2199,6 +2186,14 @@ void LocalDerivationGoal::runChild()
+
}
+
}
+
+
+ // Now builder is not builtin
+
+
+
+ Strings args;
+
+ args.push_back(std::string(baseNameOf(drv->builder)));
+
+
+
+ for (auto & i : drv->args)
+
+ args.push_back(rewriteStrings(i, inputRewrites));
+
+
+
#if __APPLE__
+
posix_spawnattr_t attrp;
+
+
@@ -2220,9 +2215,9 @@ void LocalDerivationGoal::runChild()
+
posix_spawnattr_setbinpref_np(&attrp, 1, &cpu, NULL);
+
}
+
+
- posix_spawn(NULL, builder.c_str(), NULL, &attrp, stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
+ posix_spawn(NULL, drv->builder.c_str(), NULL, &attrp, stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
#else
+
- execve(builder.c_str(), stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
+ execve(drv->builder.c_str(), stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
#endif
+
+
throw SysError("executing '%1%'", drv->builder);
+
--
+
2.46.1
+
+312
pkgs/tools/package-management/nix/patches/2_19/0001-fix-Run-all-derivation-builders-inside-the-sandbox-o.patch
···
···
+
From 172734f47a8062285cec0055133efcc45df03e54 Mon Sep 17 00:00:00 2001
+
From: Puck Meerburg <puck@puckipedia.com>
+
Date: Fri, 1 Mar 2024 11:42:24 -0500
+
Subject: [PATCH 1/4] fix: Run all derivation builders inside the sandbox on
+
macOS
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
configure.ac | 6 +-
+
flake.nix | 1 +
+
src/libstore/build/local-derivation-goal.cc | 217 ++++++++++----------
+
3 files changed, 112 insertions(+), 112 deletions(-)
+
+
diff --git a/configure.ac b/configure.ac
+
index 281ba2c32..6d73804e2 100644
+
--- a/configure.ac
+
+++ b/configure.ac
+
@@ -58,13 +58,17 @@ AC_CHECK_TOOL([AR], [ar])
+
AC_SYS_LARGEFILE
+
+
+
-# Solaris-specific stuff.
+
+# OS-specific stuff.
+
AC_STRUCT_DIRENT_D_TYPE
+
case "$host_os" in
+
solaris*)
+
# Solaris requires -lsocket -lnsl for network functions
+
LDFLAGS="-lsocket -lnsl $LDFLAGS"
+
;;
+
+ darwin*)
+
+ # Need to link to libsandbox.
+
+ LDFLAGS="-lsandbox $LDFLAGS"
+
+ ;;
+
esac
+
+
+
diff --git a/flake.nix b/flake.nix
+
index 6deb09f22..98f9cc25f 100644
+
--- a/flake.nix
+
+++ b/flake.nix
+
@@ -202,6 +202,7 @@
+
libsodium
+
]
+
++ lib.optionals stdenv.isLinux [libseccomp]
+
+ ++ lib.optionals stdenv.isDarwin [darwin.apple_sdk.libs.sandbox]
+
++ lib.optional stdenv.hostPlatform.isx86_64 libcpuid;
+
+
checkDeps = [
+
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
+
index b6c7666e5..effd9c613 100644
+
--- a/src/libstore/build/local-derivation-goal.cc
+
+++ b/src/libstore/build/local-derivation-goal.cc
+
@@ -55,6 +55,10 @@
+
#if __APPLE__
+
#include <spawn.h>
+
#include <sys/sysctl.h>
+
+#include <sandbox.h>
+
+
+
+/* This definition is undocumented but depended upon by all major browsers. */
+
+extern "C" int sandbox_init_with_parameters(const char *profile, uint64_t flags, const char *const parameters[], char **errorbuf);
+
#endif
+
+
#include <pwd.h>
+
@@ -2031,140 +2035,131 @@ void LocalDerivationGoal::runChild()
+
+
std::string builder = "invalid";
+
+
- if (drv->isBuiltin()) {
+
- ;
+
- }
+
#if __APPLE__
+
- else {
+
- /* This has to appear before import statements. */
+
- std::string sandboxProfile = "(version 1)\n";
+
-
+
- if (useChroot) {
+
-
+
- /* Lots and lots and lots of file functions freak out if they can't stat their full ancestry */
+
- PathSet ancestry;
+
-
+
- /* We build the ancestry before adding all inputPaths to the store because we know they'll
+
- all have the same parents (the store), and there might be lots of inputs. This isn't
+
- particularly efficient... I doubt it'll be a bottleneck in practice */
+
- for (auto & i : pathsInChroot) {
+
- Path cur = i.first;
+
- while (cur.compare("/") != 0) {
+
- cur = dirOf(cur);
+
- ancestry.insert(cur);
+
- }
+
- }
+
+ /* This has to appear before import statements. */
+
+ std::string sandboxProfile = "(version 1)\n";
+
+
- /* And we want the store in there regardless of how empty pathsInChroot. We include the innermost
+
- path component this time, since it's typically /nix/store and we care about that. */
+
- Path cur = worker.store.storeDir;
+
+ if (useChroot) {
+
+
+
+ /* Lots and lots and lots of file functions freak out if they can't stat their full ancestry */
+
+ PathSet ancestry;
+
+
+
+ /* We build the ancestry before adding all inputPaths to the store because we know they'll
+
+ all have the same parents (the store), and there might be lots of inputs. This isn't
+
+ particularly efficient... I doubt it'll be a bottleneck in practice */
+
+ for (auto & i : pathsInChroot) {
+
+ Path cur = i.first;
+
while (cur.compare("/") != 0) {
+
- ancestry.insert(cur);
+
cur = dirOf(cur);
+
+ ancestry.insert(cur);
+
}
+
+ }
+
+
- /* Add all our input paths to the chroot */
+
- for (auto & i : inputPaths) {
+
- auto p = worker.store.printStorePath(i);
+
- pathsInChroot[p] = p;
+
- }
+
+ /* And we want the store in there regardless of how empty pathsInChroot. We include the innermost
+
+ path component this time, since it's typically /nix/store and we care about that. */
+
+ Path cur = worker.store.storeDir;
+
+ while (cur.compare("/") != 0) {
+
+ ancestry.insert(cur);
+
+ cur = dirOf(cur);
+
+ }
+
+
- /* Violations will go to the syslog if you set this. Unfortunately the destination does not appear to be configurable */
+
- if (settings.darwinLogSandboxViolations) {
+
- sandboxProfile += "(deny default)\n";
+
- } else {
+
- sandboxProfile += "(deny default (with no-log))\n";
+
- }
+
+ /* Add all our input paths to the chroot */
+
+ for (auto & i : inputPaths) {
+
+ auto p = worker.store.printStorePath(i);
+
+ pathsInChroot[p] = p;
+
+ }
+
+
+
+ /* Violations will go to the syslog if you set this. Unfortunately the destination does not appear to be configurable */
+
+ if (settings.darwinLogSandboxViolations) {
+
+ sandboxProfile += "(deny default)\n";
+
+ } else {
+
+ sandboxProfile += "(deny default (with no-log))\n";
+
+ }
+
+
+ sandboxProfile +=
+
+ #include "sandbox-defaults.sb"
+
+ ;
+
+
+
+ if (!derivationType->isSandboxed())
+
sandboxProfile +=
+
- #include "sandbox-defaults.sb"
+
+ #include "sandbox-network.sb"
+
;
+
+
- if (!derivationType->isSandboxed())
+
- sandboxProfile +=
+
- #include "sandbox-network.sb"
+
- ;
+
-
+
- /* Add the output paths we'll use at build-time to the chroot */
+
- sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
- for (auto & [_, path] : scratchOutputs)
+
- sandboxProfile += fmt("\t(subpath \"%s\")\n", worker.store.printStorePath(path));
+
-
+
- sandboxProfile += ")\n";
+
-
+
- /* Our inputs (transitive dependencies and any impurities computed above)
+
-
+
- without file-write* allowed, access() incorrectly returns EPERM
+
- */
+
- sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
- for (auto & i : pathsInChroot) {
+
- if (i.first != i.second.source)
+
- throw Error(
+
- "can't map '%1%' to '%2%': mismatched impure paths not supported on Darwin",
+
- i.first, i.second.source);
+
-
+
- std::string path = i.first;
+
- struct stat st;
+
- if (lstat(path.c_str(), &st)) {
+
- if (i.second.optional && errno == ENOENT)
+
- continue;
+
- throw SysError("getting attributes of path '%s", path);
+
- }
+
- if (S_ISDIR(st.st_mode))
+
- sandboxProfile += fmt("\t(subpath \"%s\")\n", path);
+
- else
+
- sandboxProfile += fmt("\t(literal \"%s\")\n", path);
+
- }
+
- sandboxProfile += ")\n";
+
+ /* Add the output paths we'll use at build-time to the chroot */
+
+ sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
+ for (auto & [_, path] : scratchOutputs)
+
+ sandboxProfile += fmt("\t(subpath \"%s\")\n", worker.store.printStorePath(path));
+
+
- /* Allow file-read* on full directory hierarchy to self. Allows realpath() */
+
- sandboxProfile += "(allow file-read*\n";
+
- for (auto & i : ancestry) {
+
- sandboxProfile += fmt("\t(literal \"%s\")\n", i);
+
- }
+
- sandboxProfile += ")\n";
+
+ sandboxProfile += ")\n";
+
+
- sandboxProfile += additionalSandboxProfile;
+
- } else
+
- sandboxProfile +=
+
- #include "sandbox-minimal.sb"
+
- ;
+
+ /* Our inputs (transitive dependencies and any impurities computed above)
+
+
+
+ without file-write* allowed, access() incorrectly returns EPERM
+
+ */
+
+ sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
+ for (auto & i : pathsInChroot) {
+
+ if (i.first != i.second.source)
+
+ throw Error(
+
+ "can't map '%1%' to '%2%': mismatched impure paths not supported on Darwin",
+
+ i.first, i.second.source);
+
+
+
+ std::string path = i.first;
+
+ struct stat st;
+
+ if (lstat(path.c_str(), &st)) {
+
+ if (i.second.optional && errno == ENOENT)
+
+ continue;
+
+ throw SysError("getting attributes of path '%s", path);
+
+ }
+
+ if (S_ISDIR(st.st_mode))
+
+ sandboxProfile += fmt("\t(subpath \"%s\")\n", path);
+
+ else
+
+ sandboxProfile += fmt("\t(literal \"%s\")\n", path);
+
+ }
+
+ sandboxProfile += ")\n";
+
+
- debug("Generated sandbox profile:");
+
- debug(sandboxProfile);
+
+ /* Allow file-read* on full directory hierarchy to self. Allows realpath() */
+
+ sandboxProfile += "(allow file-read*\n";
+
+ for (auto & i : ancestry) {
+
+ sandboxProfile += fmt("\t(literal \"%s\")\n", i);
+
+ }
+
+ sandboxProfile += ")\n";
+
+
- Path sandboxFile = tmpDir + "/.sandbox.sb";
+
+ sandboxProfile += additionalSandboxProfile;
+
+ } else
+
+ sandboxProfile +=
+
+ #include "sandbox-minimal.sb"
+
+ ;
+
+
- writeFile(sandboxFile, sandboxProfile);
+
+ debug("Generated sandbox profile:");
+
+ debug(sandboxProfile);
+
+
- bool allowLocalNetworking = parsedDrv->getBoolAttr("__darwinAllowLocalNetworking");
+
+ bool allowLocalNetworking = parsedDrv->getBoolAttr("__darwinAllowLocalNetworking");
+
+
- /* The tmpDir in scope points at the temporary build directory for our derivation. Some packages try different mechanisms
+
- to find temporary directories, so we want to open up a broader place for them to dump their files, if needed. */
+
- Path globalTmpDir = canonPath(getEnvNonEmpty("TMPDIR").value_or("/tmp"), true);
+
+ /* The tmpDir in scope points at the temporary build directory for our derivation. Some packages try different mechanisms
+
+ to find temporary directories, so we want to open up a broader place for them to dump their files, if needed. */
+
+ Path globalTmpDir = canonPath(getEnvNonEmpty("TMPDIR").value_or("/tmp"), true);
+
+
- /* They don't like trailing slashes on subpath directives */
+
- if (globalTmpDir.back() == '/') globalTmpDir.pop_back();
+
+ /* They don't like trailing slashes on subpath directives */
+
+ if (globalTmpDir.back() == '/') globalTmpDir.pop_back();
+
+
- if (getEnv("_NIX_TEST_NO_SANDBOX") != "1") {
+
- builder = "/usr/bin/sandbox-exec";
+
- args.push_back("sandbox-exec");
+
- args.push_back("-f");
+
- args.push_back(sandboxFile);
+
- args.push_back("-D");
+
- args.push_back("_GLOBAL_TMP_DIR=" + globalTmpDir);
+
- if (allowLocalNetworking) {
+
- args.push_back("-D");
+
- args.push_back(std::string("_ALLOW_LOCAL_NETWORKING=1"));
+
- }
+
- args.push_back(drv->builder);
+
- } else {
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
+ if (getEnv("_NIX_TEST_NO_SANDBOX") != "1") {
+
+ Strings sandboxArgs;
+
+ sandboxArgs.push_back("_GLOBAL_TMP_DIR");
+
+ sandboxArgs.push_back(globalTmpDir);
+
+ if (allowLocalNetworking) {
+
+ sandboxArgs.push_back("_ALLOW_LOCAL_NETWORKING");
+
+ sandboxArgs.push_back("1");
+
+ }
+
+ if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), NULL)) {
+
+ writeFull(STDERR_FILENO, "failed to configure sandbox\n");
+
+ _exit(1);
+
}
+
}
+
+
+
+ builder = drv->builder;
+
+ args.push_back(std::string(baseNameOf(drv->builder)));
+
#else
+
- else {
+
+ if (!drv->isBuiltin()) {
+
builder = drv->builder;
+
args.push_back(std::string(baseNameOf(drv->builder)));
+
}
+
--
+
2.46.1
+
+34
pkgs/tools/package-management/nix/patches/2_19/0002-local-derivation-goal-Print-sandbox-error-detail-on-.patch
···
···
+
From 4a5018019e969537fdba36314fe5c19fe91828af Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:44:12 +0200
+
Subject: [PATCH 2/4] local-derivation-goal: Print sandbox error detail on
+
darwin
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Co-Authored-By: Théophane Hufschmitt <theophane.hufschmitt@tweag.io>
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libstore/build/local-derivation-goal.cc | 5 +++--
+
1 file changed, 3 insertions(+), 2 deletions(-)
+
+
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
+
index effd9c613..a67347b59 100644
+
--- a/src/libstore/build/local-derivation-goal.cc
+
+++ b/src/libstore/build/local-derivation-goal.cc
+
@@ -2150,8 +2150,9 @@ void LocalDerivationGoal::runChild()
+
sandboxArgs.push_back("_ALLOW_LOCAL_NETWORKING");
+
sandboxArgs.push_back("1");
+
}
+
- if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), NULL)) {
+
- writeFull(STDERR_FILENO, "failed to configure sandbox\n");
+
+ char * sandbox_errbuf = nullptr;
+
+ if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), &sandbox_errbuf)) {
+
+ writeFull(STDERR_FILENO, fmt("failed to configure sandbox: %s\n", sandbox_errbuf ? sandbox_errbuf : "(null)"));
+
_exit(1);
+
}
+
}
+
--
+
2.46.1
+
+41
pkgs/tools/package-management/nix/patches/2_19/0003-local-derivation-goal-Refactor.patch
···
···
+
From f9e5b3b52323fdcac4e21bfec4d03bd66ea6a503 Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:50:27 +0200
+
Subject: [PATCH 3/4] local-derivation-goal: Refactor
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
This works because the `builder` and `args` variables are only used
+
in the non-builtin code path.
+
+
Co-Authored-By: Théophane Hufschmitt <theophane.hufschmitt@tweag.io>
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libstore/build/local-derivation-goal.cc | 5 +----
+
1 file changed, 1 insertion(+), 4 deletions(-)
+
+
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
+
index a67347b59..eeb2635ee 100644
+
--- a/src/libstore/build/local-derivation-goal.cc
+
+++ b/src/libstore/build/local-derivation-goal.cc
+
@@ -2156,15 +2156,12 @@ void LocalDerivationGoal::runChild()
+
_exit(1);
+
}
+
}
+
+#endif
+
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
-#else
+
if (!drv->isBuiltin()) {
+
builder = drv->builder;
+
args.push_back(std::string(baseNameOf(drv->builder)));
+
}
+
-#endif
+
+
for (auto & i : drv->args)
+
args.push_back(rewriteStrings(i, inputRewrites));
+
--
+
2.46.1
+
+75
pkgs/tools/package-management/nix/patches/2_19/0004-local-derivation-goal-Move-builder-preparation-to-no.patch
···
···
+
From 126a1fd3385175ac94ae4000a9798e0cafb3c168 Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:57:00 +0200
+
Subject: [PATCH 4/4] local-derivation-goal: Move builder preparation to
+
non-builtin code path
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libstore/build/local-derivation-goal.cc | 25 +++++++++------------
+
1 file changed, 10 insertions(+), 15 deletions(-)
+
+
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
+
index eeb2635ee..e29330f0e 100644
+
--- a/src/libstore/build/local-derivation-goal.cc
+
+++ b/src/libstore/build/local-derivation-goal.cc
+
@@ -2030,11 +2030,6 @@ void LocalDerivationGoal::runChild()
+
throw SysError("setuid failed");
+
}
+
+
- /* Fill in the arguments. */
+
- Strings args;
+
-
+
- std::string builder = "invalid";
+
-
+
#if __APPLE__
+
/* This has to appear before import statements. */
+
std::string sandboxProfile = "(version 1)\n";
+
@@ -2158,14 +2153,6 @@ void LocalDerivationGoal::runChild()
+
}
+
#endif
+
+
- if (!drv->isBuiltin()) {
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
- }
+
-
+
- for (auto & i : drv->args)
+
- args.push_back(rewriteStrings(i, inputRewrites));
+
-
+
/* Indicate that we managed to set up the build environment. */
+
writeFull(STDERR_FILENO, std::string("\2\n"));
+
+
@@ -2195,6 +2182,14 @@ void LocalDerivationGoal::runChild()
+
}
+
}
+
+
+ // Now builder is not builtin
+
+
+
+ Strings args;
+
+ args.push_back(std::string(baseNameOf(drv->builder)));
+
+
+
+ for (auto & i : drv->args)
+
+ args.push_back(rewriteStrings(i, inputRewrites));
+
+
+
#if __APPLE__
+
posix_spawnattr_t attrp;
+
+
@@ -2216,9 +2211,9 @@ void LocalDerivationGoal::runChild()
+
posix_spawnattr_setbinpref_np(&attrp, 1, &cpu, NULL);
+
}
+
+
- posix_spawn(NULL, builder.c_str(), NULL, &attrp, stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
+ posix_spawn(NULL, drv->builder.c_str(), NULL, &attrp, stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
#else
+
- execve(builder.c_str(), stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
+ execve(drv->builder.c_str(), stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
#endif
+
+
throw SysError("executing '%1%'", drv->builder);
+
--
+
2.46.1
+
+320
pkgs/tools/package-management/nix/patches/2_20/0001-fix-Run-all-derivation-builders-inside-the-sandbox-o.patch
···
···
+
From aa54b01af503644a393e4e4055c4ce2a23ce9139 Mon Sep 17 00:00:00 2001
+
From: Puck Meerburg <puck@puckipedia.com>
+
Date: Fri, 1 Mar 2024 11:42:24 -0500
+
Subject: [PATCH 1/4] fix: Run all derivation builders inside the sandbox on
+
macOS
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
configure.ac | 6 +-
+
package.nix | 2 +
+
src/libstore/build/local-derivation-goal.cc | 217 ++++++++++----------
+
3 files changed, 113 insertions(+), 112 deletions(-)
+
+
diff --git a/configure.ac b/configure.ac
+
index 8c29c1e62..8c524fd93 100644
+
--- a/configure.ac
+
+++ b/configure.ac
+
@@ -58,13 +58,17 @@ AC_CHECK_TOOL([AR], [ar])
+
AC_SYS_LARGEFILE
+
+
+
-# Solaris-specific stuff.
+
+# OS-specific stuff.
+
AC_STRUCT_DIRENT_D_TYPE
+
case "$host_os" in
+
solaris*)
+
# Solaris requires -lsocket -lnsl for network functions
+
LDFLAGS="-lsocket -lnsl $LDFLAGS"
+
;;
+
+ darwin*)
+
+ # Need to link to libsandbox.
+
+ LDFLAGS="-lsandbox $LDFLAGS"
+
+ ;;
+
esac
+
+
+
diff --git a/package.nix b/package.nix
+
index d1d14d10e..40283ffcf 100644
+
--- a/package.nix
+
+++ b/package.nix
+
@@ -24,6 +24,7 @@
+
, libgit2
+
, libseccomp
+
, libsodium
+
+, darwin
+
, lowdown
+
, mdbook
+
, mdbook-linkcheck
+
@@ -233,6 +234,7 @@ in {
+
gtest
+
rapidcheck
+
] ++ lib.optional stdenv.isLinux libseccomp
+
+ ++ lib.optional stdenv.hostPlatform.isDarwin darwin.apple_sdk.libs.sandbox
+
++ lib.optional stdenv.hostPlatform.isx86_64 libcpuid
+
# There have been issues building these dependencies
+
++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform && (stdenv.isLinux || stdenv.isDarwin))
+
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
+
index b8228bc11..9ab676429 100644
+
--- a/src/libstore/build/local-derivation-goal.cc
+
+++ b/src/libstore/build/local-derivation-goal.cc
+
@@ -57,6 +57,10 @@
+
#if __APPLE__
+
#include <spawn.h>
+
#include <sys/sysctl.h>
+
+#include <sandbox.h>
+
+
+
+/* This definition is undocumented but depended upon by all major browsers. */
+
+extern "C" int sandbox_init_with_parameters(const char *profile, uint64_t flags, const char *const parameters[], char **errorbuf);
+
#endif
+
+
#include <pwd.h>
+
@@ -2023,140 +2027,131 @@ void LocalDerivationGoal::runChild()
+
+
std::string builder = "invalid";
+
+
- if (drv->isBuiltin()) {
+
- ;
+
- }
+
#if __APPLE__
+
- else {
+
- /* This has to appear before import statements. */
+
- std::string sandboxProfile = "(version 1)\n";
+
-
+
- if (useChroot) {
+
-
+
- /* Lots and lots and lots of file functions freak out if they can't stat their full ancestry */
+
- PathSet ancestry;
+
-
+
- /* We build the ancestry before adding all inputPaths to the store because we know they'll
+
- all have the same parents (the store), and there might be lots of inputs. This isn't
+
- particularly efficient... I doubt it'll be a bottleneck in practice */
+
- for (auto & i : pathsInChroot) {
+
- Path cur = i.first;
+
- while (cur.compare("/") != 0) {
+
- cur = dirOf(cur);
+
- ancestry.insert(cur);
+
- }
+
- }
+
+ /* This has to appear before import statements. */
+
+ std::string sandboxProfile = "(version 1)\n";
+
+
- /* And we want the store in there regardless of how empty pathsInChroot. We include the innermost
+
- path component this time, since it's typically /nix/store and we care about that. */
+
- Path cur = worker.store.storeDir;
+
+ if (useChroot) {
+
+
+
+ /* Lots and lots and lots of file functions freak out if they can't stat their full ancestry */
+
+ PathSet ancestry;
+
+
+
+ /* We build the ancestry before adding all inputPaths to the store because we know they'll
+
+ all have the same parents (the store), and there might be lots of inputs. This isn't
+
+ particularly efficient... I doubt it'll be a bottleneck in practice */
+
+ for (auto & i : pathsInChroot) {
+
+ Path cur = i.first;
+
while (cur.compare("/") != 0) {
+
- ancestry.insert(cur);
+
cur = dirOf(cur);
+
+ ancestry.insert(cur);
+
}
+
+ }
+
+
- /* Add all our input paths to the chroot */
+
- for (auto & i : inputPaths) {
+
- auto p = worker.store.printStorePath(i);
+
- pathsInChroot[p] = p;
+
- }
+
+ /* And we want the store in there regardless of how empty pathsInChroot. We include the innermost
+
+ path component this time, since it's typically /nix/store and we care about that. */
+
+ Path cur = worker.store.storeDir;
+
+ while (cur.compare("/") != 0) {
+
+ ancestry.insert(cur);
+
+ cur = dirOf(cur);
+
+ }
+
+
- /* Violations will go to the syslog if you set this. Unfortunately the destination does not appear to be configurable */
+
- if (settings.darwinLogSandboxViolations) {
+
- sandboxProfile += "(deny default)\n";
+
- } else {
+
- sandboxProfile += "(deny default (with no-log))\n";
+
- }
+
+ /* Add all our input paths to the chroot */
+
+ for (auto & i : inputPaths) {
+
+ auto p = worker.store.printStorePath(i);
+
+ pathsInChroot[p] = p;
+
+ }
+
+
+
+ /* Violations will go to the syslog if you set this. Unfortunately the destination does not appear to be configurable */
+
+ if (settings.darwinLogSandboxViolations) {
+
+ sandboxProfile += "(deny default)\n";
+
+ } else {
+
+ sandboxProfile += "(deny default (with no-log))\n";
+
+ }
+
+
+ sandboxProfile +=
+
+ #include "sandbox-defaults.sb"
+
+ ;
+
+
+
+ if (!derivationType->isSandboxed())
+
sandboxProfile +=
+
- #include "sandbox-defaults.sb"
+
+ #include "sandbox-network.sb"
+
;
+
+
- if (!derivationType->isSandboxed())
+
- sandboxProfile +=
+
- #include "sandbox-network.sb"
+
- ;
+
-
+
- /* Add the output paths we'll use at build-time to the chroot */
+
- sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
- for (auto & [_, path] : scratchOutputs)
+
- sandboxProfile += fmt("\t(subpath \"%s\")\n", worker.store.printStorePath(path));
+
-
+
- sandboxProfile += ")\n";
+
-
+
- /* Our inputs (transitive dependencies and any impurities computed above)
+
-
+
- without file-write* allowed, access() incorrectly returns EPERM
+
- */
+
- sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
- for (auto & i : pathsInChroot) {
+
- if (i.first != i.second.source)
+
- throw Error(
+
- "can't map '%1%' to '%2%': mismatched impure paths not supported on Darwin",
+
- i.first, i.second.source);
+
-
+
- std::string path = i.first;
+
- struct stat st;
+
- if (lstat(path.c_str(), &st)) {
+
- if (i.second.optional && errno == ENOENT)
+
- continue;
+
- throw SysError("getting attributes of path '%s", path);
+
- }
+
- if (S_ISDIR(st.st_mode))
+
- sandboxProfile += fmt("\t(subpath \"%s\")\n", path);
+
- else
+
- sandboxProfile += fmt("\t(literal \"%s\")\n", path);
+
- }
+
- sandboxProfile += ")\n";
+
+ /* Add the output paths we'll use at build-time to the chroot */
+
+ sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
+ for (auto & [_, path] : scratchOutputs)
+
+ sandboxProfile += fmt("\t(subpath \"%s\")\n", worker.store.printStorePath(path));
+
+
- /* Allow file-read* on full directory hierarchy to self. Allows realpath() */
+
- sandboxProfile += "(allow file-read*\n";
+
- for (auto & i : ancestry) {
+
- sandboxProfile += fmt("\t(literal \"%s\")\n", i);
+
- }
+
- sandboxProfile += ")\n";
+
+ sandboxProfile += ")\n";
+
+
- sandboxProfile += additionalSandboxProfile;
+
- } else
+
- sandboxProfile +=
+
- #include "sandbox-minimal.sb"
+
- ;
+
+ /* Our inputs (transitive dependencies and any impurities computed above)
+
+
+
+ without file-write* allowed, access() incorrectly returns EPERM
+
+ */
+
+ sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
+ for (auto & i : pathsInChroot) {
+
+ if (i.first != i.second.source)
+
+ throw Error(
+
+ "can't map '%1%' to '%2%': mismatched impure paths not supported on Darwin",
+
+ i.first, i.second.source);
+
+
+
+ std::string path = i.first;
+
+ struct stat st;
+
+ if (lstat(path.c_str(), &st)) {
+
+ if (i.second.optional && errno == ENOENT)
+
+ continue;
+
+ throw SysError("getting attributes of path '%s", path);
+
+ }
+
+ if (S_ISDIR(st.st_mode))
+
+ sandboxProfile += fmt("\t(subpath \"%s\")\n", path);
+
+ else
+
+ sandboxProfile += fmt("\t(literal \"%s\")\n", path);
+
+ }
+
+ sandboxProfile += ")\n";
+
+
- debug("Generated sandbox profile:");
+
- debug(sandboxProfile);
+
+ /* Allow file-read* on full directory hierarchy to self. Allows realpath() */
+
+ sandboxProfile += "(allow file-read*\n";
+
+ for (auto & i : ancestry) {
+
+ sandboxProfile += fmt("\t(literal \"%s\")\n", i);
+
+ }
+
+ sandboxProfile += ")\n";
+
+
- Path sandboxFile = tmpDir + "/.sandbox.sb";
+
+ sandboxProfile += additionalSandboxProfile;
+
+ } else
+
+ sandboxProfile +=
+
+ #include "sandbox-minimal.sb"
+
+ ;
+
+
- writeFile(sandboxFile, sandboxProfile);
+
+ debug("Generated sandbox profile:");
+
+ debug(sandboxProfile);
+
+
- bool allowLocalNetworking = parsedDrv->getBoolAttr("__darwinAllowLocalNetworking");
+
+ bool allowLocalNetworking = parsedDrv->getBoolAttr("__darwinAllowLocalNetworking");
+
+
- /* The tmpDir in scope points at the temporary build directory for our derivation. Some packages try different mechanisms
+
- to find temporary directories, so we want to open up a broader place for them to dump their files, if needed. */
+
- Path globalTmpDir = canonPath(getEnvNonEmpty("TMPDIR").value_or("/tmp"), true);
+
+ /* The tmpDir in scope points at the temporary build directory for our derivation. Some packages try different mechanisms
+
+ to find temporary directories, so we want to open up a broader place for them to dump their files, if needed. */
+
+ Path globalTmpDir = canonPath(getEnvNonEmpty("TMPDIR").value_or("/tmp"), true);
+
+
- /* They don't like trailing slashes on subpath directives */
+
- if (globalTmpDir.back() == '/') globalTmpDir.pop_back();
+
+ /* They don't like trailing slashes on subpath directives */
+
+ if (globalTmpDir.back() == '/') globalTmpDir.pop_back();
+
+
- if (getEnv("_NIX_TEST_NO_SANDBOX") != "1") {
+
- builder = "/usr/bin/sandbox-exec";
+
- args.push_back("sandbox-exec");
+
- args.push_back("-f");
+
- args.push_back(sandboxFile);
+
- args.push_back("-D");
+
- args.push_back("_GLOBAL_TMP_DIR=" + globalTmpDir);
+
- if (allowLocalNetworking) {
+
- args.push_back("-D");
+
- args.push_back(std::string("_ALLOW_LOCAL_NETWORKING=1"));
+
- }
+
- args.push_back(drv->builder);
+
- } else {
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
+ if (getEnv("_NIX_TEST_NO_SANDBOX") != "1") {
+
+ Strings sandboxArgs;
+
+ sandboxArgs.push_back("_GLOBAL_TMP_DIR");
+
+ sandboxArgs.push_back(globalTmpDir);
+
+ if (allowLocalNetworking) {
+
+ sandboxArgs.push_back("_ALLOW_LOCAL_NETWORKING");
+
+ sandboxArgs.push_back("1");
+
+ }
+
+ if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), NULL)) {
+
+ writeFull(STDERR_FILENO, "failed to configure sandbox\n");
+
+ _exit(1);
+
}
+
}
+
+
+
+ builder = drv->builder;
+
+ args.push_back(std::string(baseNameOf(drv->builder)));
+
#else
+
- else {
+
+ if (!drv->isBuiltin()) {
+
builder = drv->builder;
+
args.push_back(std::string(baseNameOf(drv->builder)));
+
}
+
--
+
2.46.1
+
+34
pkgs/tools/package-management/nix/patches/2_20/0002-local-derivation-goal-Print-sandbox-error-detail-on-.patch
···
···
+
From b78e489f79165457b59faa2270fd89769d0fc17d Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:44:12 +0200
+
Subject: [PATCH 2/4] local-derivation-goal: Print sandbox error detail on
+
darwin
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Co-Authored-By: Théophane Hufschmitt <theophane.hufschmitt@tweag.io>
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libstore/build/local-derivation-goal.cc | 5 +++--
+
1 file changed, 3 insertions(+), 2 deletions(-)
+
+
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
+
index 9ab676429..8476e038e 100644
+
--- a/src/libstore/build/local-derivation-goal.cc
+
+++ b/src/libstore/build/local-derivation-goal.cc
+
@@ -2142,8 +2142,9 @@ void LocalDerivationGoal::runChild()
+
sandboxArgs.push_back("_ALLOW_LOCAL_NETWORKING");
+
sandboxArgs.push_back("1");
+
}
+
- if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), NULL)) {
+
- writeFull(STDERR_FILENO, "failed to configure sandbox\n");
+
+ char * sandbox_errbuf = nullptr;
+
+ if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), &sandbox_errbuf)) {
+
+ writeFull(STDERR_FILENO, fmt("failed to configure sandbox: %s\n", sandbox_errbuf ? sandbox_errbuf : "(null)"));
+
_exit(1);
+
}
+
}
+
--
+
2.46.1
+
+41
pkgs/tools/package-management/nix/patches/2_20/0003-local-derivation-goal-Refactor.patch
···
···
+
From db6bcf3f7714929d5a21b655c5f8ccd2ddbdf7f2 Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:50:27 +0200
+
Subject: [PATCH 3/4] local-derivation-goal: Refactor
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
This works because the `builder` and `args` variables are only used
+
in the non-builtin code path.
+
+
Co-Authored-By: Théophane Hufschmitt <theophane.hufschmitt@tweag.io>
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libstore/build/local-derivation-goal.cc | 5 +----
+
1 file changed, 1 insertion(+), 4 deletions(-)
+
+
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
+
index 8476e038e..12b67df69 100644
+
--- a/src/libstore/build/local-derivation-goal.cc
+
+++ b/src/libstore/build/local-derivation-goal.cc
+
@@ -2148,15 +2148,12 @@ void LocalDerivationGoal::runChild()
+
_exit(1);
+
}
+
}
+
+#endif
+
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
-#else
+
if (!drv->isBuiltin()) {
+
builder = drv->builder;
+
args.push_back(std::string(baseNameOf(drv->builder)));
+
}
+
-#endif
+
+
for (auto & i : drv->args)
+
args.push_back(rewriteStrings(i, inputRewrites));
+
--
+
2.46.1
+
+75
pkgs/tools/package-management/nix/patches/2_20/0004-local-derivation-goal-Move-builder-preparation-to-no.patch
···
···
+
From 55be7deee1471e77e3ad408c5e23842df0d5bc28 Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:57:00 +0200
+
Subject: [PATCH 4/4] local-derivation-goal: Move builder preparation to
+
non-builtin code path
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libstore/build/local-derivation-goal.cc | 25 +++++++++------------
+
1 file changed, 10 insertions(+), 15 deletions(-)
+
+
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
+
index 12b67df69..ada86dbb8 100644
+
--- a/src/libstore/build/local-derivation-goal.cc
+
+++ b/src/libstore/build/local-derivation-goal.cc
+
@@ -2022,11 +2022,6 @@ void LocalDerivationGoal::runChild()
+
throw SysError("setuid failed");
+
}
+
+
- /* Fill in the arguments. */
+
- Strings args;
+
-
+
- std::string builder = "invalid";
+
-
+
#if __APPLE__
+
/* This has to appear before import statements. */
+
std::string sandboxProfile = "(version 1)\n";
+
@@ -2150,14 +2145,6 @@ void LocalDerivationGoal::runChild()
+
}
+
#endif
+
+
- if (!drv->isBuiltin()) {
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
- }
+
-
+
- for (auto & i : drv->args)
+
- args.push_back(rewriteStrings(i, inputRewrites));
+
-
+
/* Indicate that we managed to set up the build environment. */
+
writeFull(STDERR_FILENO, std::string("\2\n"));
+
+
@@ -2187,6 +2174,14 @@ void LocalDerivationGoal::runChild()
+
}
+
}
+
+
+ // Now builder is not builtin
+
+
+
+ Strings args;
+
+ args.push_back(std::string(baseNameOf(drv->builder)));
+
+
+
+ for (auto & i : drv->args)
+
+ args.push_back(rewriteStrings(i, inputRewrites));
+
+
+
#if __APPLE__
+
posix_spawnattr_t attrp;
+
+
@@ -2208,9 +2203,9 @@ void LocalDerivationGoal::runChild()
+
posix_spawnattr_setbinpref_np(&attrp, 1, &cpu, NULL);
+
}
+
+
- posix_spawn(NULL, builder.c_str(), NULL, &attrp, stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
+ posix_spawn(NULL, drv->builder.c_str(), NULL, &attrp, stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
#else
+
- execve(builder.c_str(), stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
+ execve(drv->builder.c_str(), stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
#endif
+
+
throw SysError("executing '%1%'", drv->builder);
+
--
+
2.46.1
+
+320
pkgs/tools/package-management/nix/patches/2_21/0001-fix-Run-all-derivation-builders-inside-the-sandbox-o.patch
···
···
+
From ae8a38d29cc0fbd6394acd72fdaaa62b3798f698 Mon Sep 17 00:00:00 2001
+
From: Puck Meerburg <puck@puckipedia.com>
+
Date: Fri, 1 Mar 2024 11:42:24 -0500
+
Subject: [PATCH 1/4] fix: Run all derivation builders inside the sandbox on
+
macOS
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
configure.ac | 6 +-
+
package.nix | 2 +
+
src/libstore/build/local-derivation-goal.cc | 217 ++++++++++----------
+
3 files changed, 113 insertions(+), 112 deletions(-)
+
+
diff --git a/configure.ac b/configure.ac
+
index 676b145a5..f6fa35c81 100644
+
--- a/configure.ac
+
+++ b/configure.ac
+
@@ -62,13 +62,17 @@ AC_CHECK_TOOL([AR], [ar])
+
AC_SYS_LARGEFILE
+
+
+
-# Solaris-specific stuff.
+
+# OS-specific stuff.
+
AC_STRUCT_DIRENT_D_TYPE
+
case "$host_os" in
+
solaris*)
+
# Solaris requires -lsocket -lnsl for network functions
+
LDFLAGS="-lsocket -lnsl $LDFLAGS"
+
;;
+
+ darwin*)
+
+ # Need to link to libsandbox.
+
+ LDFLAGS="-lsandbox $LDFLAGS"
+
+ ;;
+
esac
+
+
+
diff --git a/package.nix b/package.nix
+
index 7d9a39771..de2e1aff1 100644
+
--- a/package.nix
+
+++ b/package.nix
+
@@ -25,6 +25,7 @@
+
, libseccomp
+
, libsodium
+
, man
+
+, darwin
+
, lowdown
+
, mdbook
+
, mdbook-linkcheck
+
@@ -239,6 +240,7 @@ in {
+
gtest
+
rapidcheck
+
] ++ lib.optional stdenv.isLinux libseccomp
+
+ ++ lib.optional stdenv.hostPlatform.isDarwin darwin.apple_sdk.libs.sandbox
+
++ lib.optional stdenv.hostPlatform.isx86_64 libcpuid
+
# There have been issues building these dependencies
+
++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform && (stdenv.isLinux || stdenv.isDarwin))
+
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
+
index 710304b67..c73b30b80 100644
+
--- a/src/libstore/build/local-derivation-goal.cc
+
+++ b/src/libstore/build/local-derivation-goal.cc
+
@@ -58,6 +58,10 @@
+
#if __APPLE__
+
#include <spawn.h>
+
#include <sys/sysctl.h>
+
+#include <sandbox.h>
+
+
+
+/* This definition is undocumented but depended upon by all major browsers. */
+
+extern "C" int sandbox_init_with_parameters(const char *profile, uint64_t flags, const char *const parameters[], char **errorbuf);
+
#endif
+
+
#include <pwd.h>
+
@@ -2018,140 +2022,131 @@ void LocalDerivationGoal::runChild()
+
+
std::string builder = "invalid";
+
+
- if (drv->isBuiltin()) {
+
- ;
+
- }
+
#if __APPLE__
+
- else {
+
- /* This has to appear before import statements. */
+
- std::string sandboxProfile = "(version 1)\n";
+
-
+
- if (useChroot) {
+
-
+
- /* Lots and lots and lots of file functions freak out if they can't stat their full ancestry */
+
- PathSet ancestry;
+
-
+
- /* We build the ancestry before adding all inputPaths to the store because we know they'll
+
- all have the same parents (the store), and there might be lots of inputs. This isn't
+
- particularly efficient... I doubt it'll be a bottleneck in practice */
+
- for (auto & i : pathsInChroot) {
+
- Path cur = i.first;
+
- while (cur.compare("/") != 0) {
+
- cur = dirOf(cur);
+
- ancestry.insert(cur);
+
- }
+
- }
+
+ /* This has to appear before import statements. */
+
+ std::string sandboxProfile = "(version 1)\n";
+
+
- /* And we want the store in there regardless of how empty pathsInChroot. We include the innermost
+
- path component this time, since it's typically /nix/store and we care about that. */
+
- Path cur = worker.store.storeDir;
+
+ if (useChroot) {
+
+
+
+ /* Lots and lots and lots of file functions freak out if they can't stat their full ancestry */
+
+ PathSet ancestry;
+
+
+
+ /* We build the ancestry before adding all inputPaths to the store because we know they'll
+
+ all have the same parents (the store), and there might be lots of inputs. This isn't
+
+ particularly efficient... I doubt it'll be a bottleneck in practice */
+
+ for (auto & i : pathsInChroot) {
+
+ Path cur = i.first;
+
while (cur.compare("/") != 0) {
+
- ancestry.insert(cur);
+
cur = dirOf(cur);
+
+ ancestry.insert(cur);
+
}
+
+ }
+
+
- /* Add all our input paths to the chroot */
+
- for (auto & i : inputPaths) {
+
- auto p = worker.store.printStorePath(i);
+
- pathsInChroot[p] = p;
+
- }
+
+ /* And we want the store in there regardless of how empty pathsInChroot. We include the innermost
+
+ path component this time, since it's typically /nix/store and we care about that. */
+
+ Path cur = worker.store.storeDir;
+
+ while (cur.compare("/") != 0) {
+
+ ancestry.insert(cur);
+
+ cur = dirOf(cur);
+
+ }
+
+
- /* Violations will go to the syslog if you set this. Unfortunately the destination does not appear to be configurable */
+
- if (settings.darwinLogSandboxViolations) {
+
- sandboxProfile += "(deny default)\n";
+
- } else {
+
- sandboxProfile += "(deny default (with no-log))\n";
+
- }
+
+ /* Add all our input paths to the chroot */
+
+ for (auto & i : inputPaths) {
+
+ auto p = worker.store.printStorePath(i);
+
+ pathsInChroot[p] = p;
+
+ }
+
+
+
+ /* Violations will go to the syslog if you set this. Unfortunately the destination does not appear to be configurable */
+
+ if (settings.darwinLogSandboxViolations) {
+
+ sandboxProfile += "(deny default)\n";
+
+ } else {
+
+ sandboxProfile += "(deny default (with no-log))\n";
+
+ }
+
+
+ sandboxProfile +=
+
+ #include "sandbox-defaults.sb"
+
+ ;
+
+
+
+ if (!derivationType->isSandboxed())
+
sandboxProfile +=
+
- #include "sandbox-defaults.sb"
+
+ #include "sandbox-network.sb"
+
;
+
+
- if (!derivationType->isSandboxed())
+
- sandboxProfile +=
+
- #include "sandbox-network.sb"
+
- ;
+
-
+
- /* Add the output paths we'll use at build-time to the chroot */
+
- sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
- for (auto & [_, path] : scratchOutputs)
+
- sandboxProfile += fmt("\t(subpath \"%s\")\n", worker.store.printStorePath(path));
+
-
+
- sandboxProfile += ")\n";
+
-
+
- /* Our inputs (transitive dependencies and any impurities computed above)
+
-
+
- without file-write* allowed, access() incorrectly returns EPERM
+
- */
+
- sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
- for (auto & i : pathsInChroot) {
+
- if (i.first != i.second.source)
+
- throw Error(
+
- "can't map '%1%' to '%2%': mismatched impure paths not supported on Darwin",
+
- i.first, i.second.source);
+
-
+
- std::string path = i.first;
+
- struct stat st;
+
- if (lstat(path.c_str(), &st)) {
+
- if (i.second.optional && errno == ENOENT)
+
- continue;
+
- throw SysError("getting attributes of path '%s", path);
+
- }
+
- if (S_ISDIR(st.st_mode))
+
- sandboxProfile += fmt("\t(subpath \"%s\")\n", path);
+
- else
+
- sandboxProfile += fmt("\t(literal \"%s\")\n", path);
+
- }
+
- sandboxProfile += ")\n";
+
+ /* Add the output paths we'll use at build-time to the chroot */
+
+ sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
+ for (auto & [_, path] : scratchOutputs)
+
+ sandboxProfile += fmt("\t(subpath \"%s\")\n", worker.store.printStorePath(path));
+
+
- /* Allow file-read* on full directory hierarchy to self. Allows realpath() */
+
- sandboxProfile += "(allow file-read*\n";
+
- for (auto & i : ancestry) {
+
- sandboxProfile += fmt("\t(literal \"%s\")\n", i);
+
- }
+
- sandboxProfile += ")\n";
+
+ sandboxProfile += ")\n";
+
+
- sandboxProfile += additionalSandboxProfile;
+
- } else
+
- sandboxProfile +=
+
- #include "sandbox-minimal.sb"
+
- ;
+
+ /* Our inputs (transitive dependencies and any impurities computed above)
+
+
+
+ without file-write* allowed, access() incorrectly returns EPERM
+
+ */
+
+ sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
+ for (auto & i : pathsInChroot) {
+
+ if (i.first != i.second.source)
+
+ throw Error(
+
+ "can't map '%1%' to '%2%': mismatched impure paths not supported on Darwin",
+
+ i.first, i.second.source);
+
+
+
+ std::string path = i.first;
+
+ struct stat st;
+
+ if (lstat(path.c_str(), &st)) {
+
+ if (i.second.optional && errno == ENOENT)
+
+ continue;
+
+ throw SysError("getting attributes of path '%s", path);
+
+ }
+
+ if (S_ISDIR(st.st_mode))
+
+ sandboxProfile += fmt("\t(subpath \"%s\")\n", path);
+
+ else
+
+ sandboxProfile += fmt("\t(literal \"%s\")\n", path);
+
+ }
+
+ sandboxProfile += ")\n";
+
+
- debug("Generated sandbox profile:");
+
- debug(sandboxProfile);
+
+ /* Allow file-read* on full directory hierarchy to self. Allows realpath() */
+
+ sandboxProfile += "(allow file-read*\n";
+
+ for (auto & i : ancestry) {
+
+ sandboxProfile += fmt("\t(literal \"%s\")\n", i);
+
+ }
+
+ sandboxProfile += ")\n";
+
+
- Path sandboxFile = tmpDir + "/.sandbox.sb";
+
+ sandboxProfile += additionalSandboxProfile;
+
+ } else
+
+ sandboxProfile +=
+
+ #include "sandbox-minimal.sb"
+
+ ;
+
+
- writeFile(sandboxFile, sandboxProfile);
+
+ debug("Generated sandbox profile:");
+
+ debug(sandboxProfile);
+
+
- bool allowLocalNetworking = parsedDrv->getBoolAttr("__darwinAllowLocalNetworking");
+
+ bool allowLocalNetworking = parsedDrv->getBoolAttr("__darwinAllowLocalNetworking");
+
+
- /* The tmpDir in scope points at the temporary build directory for our derivation. Some packages try different mechanisms
+
- to find temporary directories, so we want to open up a broader place for them to dump their files, if needed. */
+
- Path globalTmpDir = canonPath(getEnvNonEmpty("TMPDIR").value_or("/tmp"), true);
+
+ /* The tmpDir in scope points at the temporary build directory for our derivation. Some packages try different mechanisms
+
+ to find temporary directories, so we want to open up a broader place for them to dump their files, if needed. */
+
+ Path globalTmpDir = canonPath(getEnvNonEmpty("TMPDIR").value_or("/tmp"), true);
+
+
- /* They don't like trailing slashes on subpath directives */
+
- if (globalTmpDir.back() == '/') globalTmpDir.pop_back();
+
+ /* They don't like trailing slashes on subpath directives */
+
+ if (globalTmpDir.back() == '/') globalTmpDir.pop_back();
+
+
- if (getEnv("_NIX_TEST_NO_SANDBOX") != "1") {
+
- builder = "/usr/bin/sandbox-exec";
+
- args.push_back("sandbox-exec");
+
- args.push_back("-f");
+
- args.push_back(sandboxFile);
+
- args.push_back("-D");
+
- args.push_back("_GLOBAL_TMP_DIR=" + globalTmpDir);
+
- if (allowLocalNetworking) {
+
- args.push_back("-D");
+
- args.push_back(std::string("_ALLOW_LOCAL_NETWORKING=1"));
+
- }
+
- args.push_back(drv->builder);
+
- } else {
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
+ if (getEnv("_NIX_TEST_NO_SANDBOX") != "1") {
+
+ Strings sandboxArgs;
+
+ sandboxArgs.push_back("_GLOBAL_TMP_DIR");
+
+ sandboxArgs.push_back(globalTmpDir);
+
+ if (allowLocalNetworking) {
+
+ sandboxArgs.push_back("_ALLOW_LOCAL_NETWORKING");
+
+ sandboxArgs.push_back("1");
+
+ }
+
+ if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), NULL)) {
+
+ writeFull(STDERR_FILENO, "failed to configure sandbox\n");
+
+ _exit(1);
+
}
+
}
+
+
+
+ builder = drv->builder;
+
+ args.push_back(std::string(baseNameOf(drv->builder)));
+
#else
+
- else {
+
+ if (!drv->isBuiltin()) {
+
builder = drv->builder;
+
args.push_back(std::string(baseNameOf(drv->builder)));
+
}
+
--
+
2.46.1
+
+34
pkgs/tools/package-management/nix/patches/2_21/0002-local-derivation-goal-Print-sandbox-error-detail-on-.patch
···
···
+
From b429e96583e2d005c77df8c82261022397f20648 Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:44:12 +0200
+
Subject: [PATCH 2/4] local-derivation-goal: Print sandbox error detail on
+
darwin
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Co-Authored-By: Théophane Hufschmitt <theophane.hufschmitt@tweag.io>
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libstore/build/local-derivation-goal.cc | 5 +++--
+
1 file changed, 3 insertions(+), 2 deletions(-)
+
+
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
+
index c73b30b80..e6f4c397d 100644
+
--- a/src/libstore/build/local-derivation-goal.cc
+
+++ b/src/libstore/build/local-derivation-goal.cc
+
@@ -2137,8 +2137,9 @@ void LocalDerivationGoal::runChild()
+
sandboxArgs.push_back("_ALLOW_LOCAL_NETWORKING");
+
sandboxArgs.push_back("1");
+
}
+
- if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), NULL)) {
+
- writeFull(STDERR_FILENO, "failed to configure sandbox\n");
+
+ char * sandbox_errbuf = nullptr;
+
+ if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), &sandbox_errbuf)) {
+
+ writeFull(STDERR_FILENO, fmt("failed to configure sandbox: %s\n", sandbox_errbuf ? sandbox_errbuf : "(null)"));
+
_exit(1);
+
}
+
}
+
--
+
2.46.1
+
+41
pkgs/tools/package-management/nix/patches/2_21/0003-local-derivation-goal-Refactor.patch
···
···
+
From 74b93c1edba00c2601e20b8acdcc78e29bd3f092 Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:50:27 +0200
+
Subject: [PATCH 3/4] local-derivation-goal: Refactor
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
This works because the `builder` and `args` variables are only used
+
in the non-builtin code path.
+
+
Co-Authored-By: Théophane Hufschmitt <theophane.hufschmitt@tweag.io>
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libstore/build/local-derivation-goal.cc | 5 +----
+
1 file changed, 1 insertion(+), 4 deletions(-)
+
+
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
+
index e6f4c397d..e81818fa8 100644
+
--- a/src/libstore/build/local-derivation-goal.cc
+
+++ b/src/libstore/build/local-derivation-goal.cc
+
@@ -2143,15 +2143,12 @@ void LocalDerivationGoal::runChild()
+
_exit(1);
+
}
+
}
+
+#endif
+
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
-#else
+
if (!drv->isBuiltin()) {
+
builder = drv->builder;
+
args.push_back(std::string(baseNameOf(drv->builder)));
+
}
+
-#endif
+
+
for (auto & i : drv->args)
+
args.push_back(rewriteStrings(i, inputRewrites));
+
--
+
2.46.1
+
+75
pkgs/tools/package-management/nix/patches/2_21/0004-local-derivation-goal-Move-builder-preparation-to-no.patch
···
···
+
From c8de35f74cbce58651c3b64ba66061040f546b9f Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:57:00 +0200
+
Subject: [PATCH 4/4] local-derivation-goal: Move builder preparation to
+
non-builtin code path
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libstore/build/local-derivation-goal.cc | 25 +++++++++------------
+
1 file changed, 10 insertions(+), 15 deletions(-)
+
+
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
+
index e81818fa8..078f1a5be 100644
+
--- a/src/libstore/build/local-derivation-goal.cc
+
+++ b/src/libstore/build/local-derivation-goal.cc
+
@@ -2017,11 +2017,6 @@ void LocalDerivationGoal::runChild()
+
throw SysError("setuid failed");
+
}
+
+
- /* Fill in the arguments. */
+
- Strings args;
+
-
+
- std::string builder = "invalid";
+
-
+
#if __APPLE__
+
/* This has to appear before import statements. */
+
std::string sandboxProfile = "(version 1)\n";
+
@@ -2145,14 +2140,6 @@ void LocalDerivationGoal::runChild()
+
}
+
#endif
+
+
- if (!drv->isBuiltin()) {
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
- }
+
-
+
- for (auto & i : drv->args)
+
- args.push_back(rewriteStrings(i, inputRewrites));
+
-
+
/* Indicate that we managed to set up the build environment. */
+
writeFull(STDERR_FILENO, std::string("\2\n"));
+
+
@@ -2183,6 +2170,14 @@ void LocalDerivationGoal::runChild()
+
}
+
}
+
+
+ // Now builder is not builtin
+
+
+
+ Strings args;
+
+ args.push_back(std::string(baseNameOf(drv->builder)));
+
+
+
+ for (auto & i : drv->args)
+
+ args.push_back(rewriteStrings(i, inputRewrites));
+
+
+
#if __APPLE__
+
posix_spawnattr_t attrp;
+
+
@@ -2204,9 +2199,9 @@ void LocalDerivationGoal::runChild()
+
posix_spawnattr_setbinpref_np(&attrp, 1, &cpu, NULL);
+
}
+
+
- posix_spawn(NULL, builder.c_str(), NULL, &attrp, stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
+ posix_spawn(NULL, drv->builder.c_str(), NULL, &attrp, stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
#else
+
- execve(builder.c_str(), stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
+ execve(drv->builder.c_str(), stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
#endif
+
+
throw SysError("executing '%1%'", drv->builder);
+
--
+
2.46.1
+
+327
pkgs/tools/package-management/nix/patches/2_22/0001-fix-Run-all-derivation-builders-inside-the-sandbox-o.patch
···
···
+
From 8217054e3554ffd376f42fb0a65087a7af2ddfab Mon Sep 17 00:00:00 2001
+
From: Puck Meerburg <puck@puckipedia.com>
+
Date: Fri, 1 Mar 2024 11:42:24 -0500
+
Subject: [PATCH 1/4] fix: Run all derivation builders inside the sandbox on
+
macOS
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
configure.ac | 6 +-
+
package.nix | 5 +-
+
.../unix/build/local-derivation-goal.cc | 223 +++++++++---------
+
3 files changed, 118 insertions(+), 116 deletions(-)
+
+
diff --git a/configure.ac b/configure.ac
+
index 8f60bf4be..5e67e04be 100644
+
--- a/configure.ac
+
+++ b/configure.ac
+
@@ -62,13 +62,17 @@ AC_CHECK_TOOL([AR], [ar])
+
AC_SYS_LARGEFILE
+
+
+
-# Solaris-specific stuff.
+
+# OS-specific stuff.
+
AC_STRUCT_DIRENT_D_TYPE
+
case "$host_os" in
+
solaris*)
+
# Solaris requires -lsocket -lnsl for network functions
+
LDFLAGS="-lsocket -lnsl $LDFLAGS"
+
;;
+
+ darwin*)
+
+ # Need to link to libsandbox.
+
+ LDFLAGS="-lsandbox $LDFLAGS"
+
+ ;;
+
esac
+
+
+
diff --git a/package.nix b/package.nix
+
index 59265f522..28be97400 100644
+
--- a/package.nix
+
+++ b/package.nix
+
@@ -27,6 +27,7 @@
+
, libseccomp
+
, libsodium
+
, man
+
+, darwin
+
, lowdown
+
, mdbook
+
, mdbook-linkcheck
+
@@ -249,7 +250,9 @@ in {
+
] ++ lib.optionals buildUnitTests [
+
gtest
+
rapidcheck
+
- ] ++ lib.optional stdenv.isLinux (libseccomp.overrideAttrs (_: rec {
+
+ ]
+
+ ++ lib.optional stdenv.hostPlatform.isDarwin darwin.apple_sdk.libs.sandbox
+
+ ++ lib.optional stdenv.isLinux (libseccomp.overrideAttrs (_: rec {
+
version = "2.5.5";
+
src = fetchurl {
+
url = "https://github.com/seccomp/libseccomp/releases/download/v${version}/libseccomp-${version}.tar.gz";
+
diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc
+
index b8ccdf834..449d4b07c 100644
+
--- a/src/libstore/unix/build/local-derivation-goal.cc
+
+++ b/src/libstore/unix/build/local-derivation-goal.cc
+
@@ -58,6 +58,10 @@
+
#if __APPLE__
+
#include <spawn.h>
+
#include <sys/sysctl.h>
+
+#include <sandbox.h>
+
+
+
+/* This definition is undocumented but depended upon by all major browsers. */
+
+extern "C" int sandbox_init_with_parameters(const char *profile, uint64_t flags, const char *const parameters[], char **errorbuf);
+
#endif
+
+
#include <pwd.h>
+
@@ -2026,141 +2030,132 @@ void LocalDerivationGoal::runChild()
+
+
std::string builder = "invalid";
+
+
- if (drv->isBuiltin()) {
+
- ;
+
- }
+
#if __APPLE__
+
- else {
+
- /* This has to appear before import statements. */
+
- std::string sandboxProfile = "(version 1)\n";
+
-
+
- if (useChroot) {
+
-
+
- /* Lots and lots and lots of file functions freak out if they can't stat their full ancestry */
+
- PathSet ancestry;
+
-
+
- /* We build the ancestry before adding all inputPaths to the store because we know they'll
+
- all have the same parents (the store), and there might be lots of inputs. This isn't
+
- particularly efficient... I doubt it'll be a bottleneck in practice */
+
- for (auto & i : pathsInChroot) {
+
- Path cur = i.first;
+
- while (cur.compare("/") != 0) {
+
- cur = dirOf(cur);
+
- ancestry.insert(cur);
+
- }
+
- }
+
+ /* This has to appear before import statements. */
+
+ std::string sandboxProfile = "(version 1)\n";
+
+
+
+ if (useChroot) {
+
+
- /* And we want the store in there regardless of how empty pathsInChroot. We include the innermost
+
- path component this time, since it's typically /nix/store and we care about that. */
+
- Path cur = worker.store.storeDir;
+
+ /* Lots and lots and lots of file functions freak out if they can't stat their full ancestry */
+
+ PathSet ancestry;
+
+
+
+ /* We build the ancestry before adding all inputPaths to the store because we know they'll
+
+ all have the same parents (the store), and there might be lots of inputs. This isn't
+
+ particularly efficient... I doubt it'll be a bottleneck in practice */
+
+ for (auto & i : pathsInChroot) {
+
+ Path cur = i.first;
+
while (cur.compare("/") != 0) {
+
- ancestry.insert(cur);
+
cur = dirOf(cur);
+
+ ancestry.insert(cur);
+
}
+
+ }
+
+
- /* Add all our input paths to the chroot */
+
- for (auto & i : inputPaths) {
+
- auto p = worker.store.printStorePath(i);
+
- pathsInChroot[p] = p;
+
- }
+
-
+
- /* Violations will go to the syslog if you set this. Unfortunately the destination does not appear to be configurable */
+
- if (settings.darwinLogSandboxViolations) {
+
- sandboxProfile += "(deny default)\n";
+
- } else {
+
- sandboxProfile += "(deny default (with no-log))\n";
+
- }
+
+ /* And we want the store in there regardless of how empty pathsInChroot. We include the innermost
+
+ path component this time, since it's typically /nix/store and we care about that. */
+
+ Path cur = worker.store.storeDir;
+
+ while (cur.compare("/") != 0) {
+
+ ancestry.insert(cur);
+
+ cur = dirOf(cur);
+
+ }
+
+
- sandboxProfile +=
+
- #include "sandbox-defaults.sb"
+
- ;
+
+ /* Add all our input paths to the chroot */
+
+ for (auto & i : inputPaths) {
+
+ auto p = worker.store.printStorePath(i);
+
+ pathsInChroot[p] = p;
+
+ }
+
+
- if (!derivationType->isSandboxed())
+
- sandboxProfile +=
+
- #include "sandbox-network.sb"
+
- ;
+
-
+
- /* Add the output paths we'll use at build-time to the chroot */
+
- sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
- for (auto & [_, path] : scratchOutputs)
+
- sandboxProfile += fmt("\t(subpath \"%s\")\n", worker.store.printStorePath(path));
+
-
+
- sandboxProfile += ")\n";
+
-
+
- /* Our inputs (transitive dependencies and any impurities computed above)
+
-
+
- without file-write* allowed, access() incorrectly returns EPERM
+
- */
+
- sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
- for (auto & i : pathsInChroot) {
+
- if (i.first != i.second.source)
+
- throw Error(
+
- "can't map '%1%' to '%2%': mismatched impure paths not supported on Darwin",
+
- i.first, i.second.source);
+
-
+
- std::string path = i.first;
+
- auto optSt = maybeLstat(path.c_str());
+
- if (!optSt) {
+
- if (i.second.optional)
+
- continue;
+
- throw SysError("getting attributes of required path '%s", path);
+
- }
+
- if (S_ISDIR(optSt->st_mode))
+
- sandboxProfile += fmt("\t(subpath \"%s\")\n", path);
+
- else
+
- sandboxProfile += fmt("\t(literal \"%s\")\n", path);
+
- }
+
- sandboxProfile += ")\n";
+
+ /* Violations will go to the syslog if you set this. Unfortunately the destination does not appear to be configurable */
+
+ if (settings.darwinLogSandboxViolations) {
+
+ sandboxProfile += "(deny default)\n";
+
+ } else {
+
+ sandboxProfile += "(deny default (with no-log))\n";
+
+ }
+
+
- /* Allow file-read* on full directory hierarchy to self. Allows realpath() */
+
- sandboxProfile += "(allow file-read*\n";
+
- for (auto & i : ancestry) {
+
- sandboxProfile += fmt("\t(literal \"%s\")\n", i);
+
- }
+
- sandboxProfile += ")\n";
+
+ sandboxProfile +=
+
+ #include "sandbox-defaults.sb"
+
+ ;
+
+
- sandboxProfile += additionalSandboxProfile;
+
- } else
+
+ if (!derivationType->isSandboxed())
+
sandboxProfile +=
+
- #include "sandbox-minimal.sb"
+
+ #include "sandbox-network.sb"
+
;
+
+
- debug("Generated sandbox profile:");
+
- debug(sandboxProfile);
+
-
+
- Path sandboxFile = tmpDir + "/.sandbox.sb";
+
+ /* Add the output paths we'll use at build-time to the chroot */
+
+ sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
+ for (auto & [_, path] : scratchOutputs)
+
+ sandboxProfile += fmt("\t(subpath \"%s\")\n", worker.store.printStorePath(path));
+
+
- writeFile(sandboxFile, sandboxProfile);
+
+ sandboxProfile += ")\n";
+
+
- bool allowLocalNetworking = parsedDrv->getBoolAttr("__darwinAllowLocalNetworking");
+
+ /* Our inputs (transitive dependencies and any impurities computed above)
+
+
- /* The tmpDir in scope points at the temporary build directory for our derivation. Some packages try different mechanisms
+
- to find temporary directories, so we want to open up a broader place for them to put their files, if needed. */
+
- Path globalTmpDir = canonPath(defaultTempDir(), true);
+
+ without file-write* allowed, access() incorrectly returns EPERM
+
+ */
+
+ sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
+ for (auto & i : pathsInChroot) {
+
+ if (i.first != i.second.source)
+
+ throw Error(
+
+ "can't map '%1%' to '%2%': mismatched impure paths not supported on Darwin",
+
+ i.first, i.second.source);
+
+
+
+ std::string path = i.first;
+
+ auto optSt = maybeLstat(path.c_str());
+
+ if (!optSt) {
+
+ if (i.second.optional)
+
+ continue;
+
+ throw SysError("getting attributes of required path '%s", path);
+
+ }
+
+ if (S_ISDIR(optSt->st_mode))
+
+ sandboxProfile += fmt("\t(subpath \"%s\")\n", path);
+
+ else
+
+ sandboxProfile += fmt("\t(literal \"%s\")\n", path);
+
+ }
+
+ sandboxProfile += ")\n";
+
+
- /* They don't like trailing slashes on subpath directives */
+
- while (!globalTmpDir.empty() && globalTmpDir.back() == '/')
+
- globalTmpDir.pop_back();
+
+ /* Allow file-read* on full directory hierarchy to self. Allows realpath() */
+
+ sandboxProfile += "(allow file-read*\n";
+
+ for (auto & i : ancestry) {
+
+ sandboxProfile += fmt("\t(literal \"%s\")\n", i);
+
+ }
+
+ sandboxProfile += ")\n";
+
+
- if (getEnv("_NIX_TEST_NO_SANDBOX") != "1") {
+
- builder = "/usr/bin/sandbox-exec";
+
- args.push_back("sandbox-exec");
+
- args.push_back("-f");
+
- args.push_back(sandboxFile);
+
- args.push_back("-D");
+
- args.push_back("_GLOBAL_TMP_DIR=" + globalTmpDir);
+
- if (allowLocalNetworking) {
+
- args.push_back("-D");
+
- args.push_back(std::string("_ALLOW_LOCAL_NETWORKING=1"));
+
- }
+
- args.push_back(drv->builder);
+
- } else {
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
+ sandboxProfile += additionalSandboxProfile;
+
+ } else
+
+ sandboxProfile +=
+
+ #include "sandbox-minimal.sb"
+
+ ;
+
+
+
+ debug("Generated sandbox profile:");
+
+ debug(sandboxProfile);
+
+
+
+ bool allowLocalNetworking = parsedDrv->getBoolAttr("__darwinAllowLocalNetworking");
+
+
+
+ /* The tmpDir in scope points at the temporary build directory for our derivation. Some packages try different mechanisms
+
+ to find temporary directories, so we want to open up a broader place for them to put their files, if needed. */
+
+ Path globalTmpDir = canonPath(defaultTempDir(), true);
+
+
+
+ /* They don't like trailing slashes on subpath directives */
+
+ while (!globalTmpDir.empty() && globalTmpDir.back() == '/')
+
+ globalTmpDir.pop_back();
+
+
+
+ if (getEnv("_NIX_TEST_NO_SANDBOX") != "1") {
+
+ Strings sandboxArgs;
+
+ sandboxArgs.push_back("_GLOBAL_TMP_DIR");
+
+ sandboxArgs.push_back(globalTmpDir);
+
+ if (allowLocalNetworking) {
+
+ sandboxArgs.push_back("_ALLOW_LOCAL_NETWORKING");
+
+ sandboxArgs.push_back("1");
+
+ }
+
+ if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), NULL)) {
+
+ writeFull(STDERR_FILENO, "failed to configure sandbox\n");
+
+ _exit(1);
+
}
+
}
+
+
+
+ builder = drv->builder;
+
+ args.push_back(std::string(baseNameOf(drv->builder)));
+
#else
+
- else {
+
+ if (!drv->isBuiltin()) {
+
builder = drv->builder;
+
args.push_back(std::string(baseNameOf(drv->builder)));
+
}
+
--
+
2.46.1
+
+34
pkgs/tools/package-management/nix/patches/2_22/0002-local-derivation-goal-Print-sandbox-error-detail-on-.patch
···
···
+
From f0677f190d0bd042c3a864508a5307b19a2c2d26 Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:44:12 +0200
+
Subject: [PATCH 2/4] local-derivation-goal: Print sandbox error detail on
+
darwin
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Co-Authored-By: Théophane Hufschmitt <theophane.hufschmitt@tweag.io>
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libstore/unix/build/local-derivation-goal.cc | 5 +++--
+
1 file changed, 3 insertions(+), 2 deletions(-)
+
+
diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc
+
index 449d4b07c..b74bd2e64 100644
+
--- a/src/libstore/unix/build/local-derivation-goal.cc
+
+++ b/src/libstore/unix/build/local-derivation-goal.cc
+
@@ -2146,8 +2146,9 @@ void LocalDerivationGoal::runChild()
+
sandboxArgs.push_back("_ALLOW_LOCAL_NETWORKING");
+
sandboxArgs.push_back("1");
+
}
+
- if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), NULL)) {
+
- writeFull(STDERR_FILENO, "failed to configure sandbox\n");
+
+ char * sandbox_errbuf = nullptr;
+
+ if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), &sandbox_errbuf)) {
+
+ writeFull(STDERR_FILENO, fmt("failed to configure sandbox: %s\n", sandbox_errbuf ? sandbox_errbuf : "(null)"));
+
_exit(1);
+
}
+
}
+
--
+
2.46.1
+
+41
pkgs/tools/package-management/nix/patches/2_22/0003-local-derivation-goal-Refactor.patch
···
···
+
From 1b39753f4d63465c709d18482945ce680b6f3f1e Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:50:27 +0200
+
Subject: [PATCH 3/4] local-derivation-goal: Refactor
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
This works because the `builder` and `args` variables are only used
+
in the non-builtin code path.
+
+
Co-Authored-By: Théophane Hufschmitt <theophane.hufschmitt@tweag.io>
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libstore/unix/build/local-derivation-goal.cc | 5 +----
+
1 file changed, 1 insertion(+), 4 deletions(-)
+
+
diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc
+
index b74bd2e64..9b8b3c51b 100644
+
--- a/src/libstore/unix/build/local-derivation-goal.cc
+
+++ b/src/libstore/unix/build/local-derivation-goal.cc
+
@@ -2152,15 +2152,12 @@ void LocalDerivationGoal::runChild()
+
_exit(1);
+
}
+
}
+
+#endif
+
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
-#else
+
if (!drv->isBuiltin()) {
+
builder = drv->builder;
+
args.push_back(std::string(baseNameOf(drv->builder)));
+
}
+
-#endif
+
+
for (auto & i : drv->args)
+
args.push_back(rewriteStrings(i, inputRewrites));
+
--
+
2.46.1
+
+75
pkgs/tools/package-management/nix/patches/2_22/0004-local-derivation-goal-Move-builder-preparation-to-no.patch
···
···
+
From 9e198a75f76ac08f835975d4b2743e156616a219 Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:57:00 +0200
+
Subject: [PATCH 4/4] local-derivation-goal: Move builder preparation to
+
non-builtin code path
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
.../unix/build/local-derivation-goal.cc | 25 ++++++++-----------
+
1 file changed, 10 insertions(+), 15 deletions(-)
+
+
diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc
+
index 9b8b3c51b..08366712c 100644
+
--- a/src/libstore/unix/build/local-derivation-goal.cc
+
+++ b/src/libstore/unix/build/local-derivation-goal.cc
+
@@ -2025,11 +2025,6 @@ void LocalDerivationGoal::runChild()
+
throw SysError("setuid failed");
+
}
+
+
- /* Fill in the arguments. */
+
- Strings args;
+
-
+
- std::string builder = "invalid";
+
-
+
#if __APPLE__
+
/* This has to appear before import statements. */
+
std::string sandboxProfile = "(version 1)\n";
+
@@ -2154,14 +2149,6 @@ void LocalDerivationGoal::runChild()
+
}
+
#endif
+
+
- if (!drv->isBuiltin()) {
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
- }
+
-
+
- for (auto & i : drv->args)
+
- args.push_back(rewriteStrings(i, inputRewrites));
+
-
+
/* Indicate that we managed to set up the build environment. */
+
writeFull(STDERR_FILENO, std::string("\2\n"));
+
+
@@ -2192,6 +2179,14 @@ void LocalDerivationGoal::runChild()
+
}
+
}
+
+
+ // Now builder is not builtin
+
+
+
+ Strings args;
+
+ args.push_back(std::string(baseNameOf(drv->builder)));
+
+
+
+ for (auto & i : drv->args)
+
+ args.push_back(rewriteStrings(i, inputRewrites));
+
+
+
#if __APPLE__
+
posix_spawnattr_t attrp;
+
+
@@ -2213,9 +2208,9 @@ void LocalDerivationGoal::runChild()
+
posix_spawnattr_setbinpref_np(&attrp, 1, &cpu, NULL);
+
}
+
+
- posix_spawn(NULL, builder.c_str(), NULL, &attrp, stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
+ posix_spawn(NULL, drv->builder.c_str(), NULL, &attrp, stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
#else
+
- execve(builder.c_str(), stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
+ execve(drv->builder.c_str(), stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
#endif
+
+
throw SysError("executing '%1%'", drv->builder);
+
--
+
2.46.1
+
+323
pkgs/tools/package-management/nix/patches/2_23/0001-fix-Run-all-derivation-builders-inside-the-sandbox-o.patch
···
···
+
From 05994033d58e358ddafe51d1d04626eb76b8a192 Mon Sep 17 00:00:00 2001
+
From: Puck Meerburg <puck@puckipedia.com>
+
Date: Fri, 1 Mar 2024 11:42:24 -0500
+
Subject: [PATCH 1/4] fix: Run all derivation builders inside the sandbox on
+
macOS
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
configure.ac | 6 +-
+
package.nix | 2 +
+
.../unix/build/local-derivation-goal.cc | 223 +++++++++---------
+
3 files changed, 116 insertions(+), 115 deletions(-)
+
+
diff --git a/configure.ac b/configure.ac
+
index 90a6d45d5..f98a0a5ea 100644
+
--- a/configure.ac
+
+++ b/configure.ac
+
@@ -62,12 +62,16 @@ AC_CHECK_TOOL([AR], [ar])
+
AC_SYS_LARGEFILE
+
+
+
-# Solaris-specific stuff.
+
+# OS-specific stuff.
+
case "$host_os" in
+
solaris*)
+
# Solaris requires -lsocket -lnsl for network functions
+
LDFLAGS="-lsocket -lnsl $LDFLAGS"
+
;;
+
+ darwin*)
+
+ # Need to link to libsandbox.
+
+ LDFLAGS="-lsandbox $LDFLAGS"
+
+ ;;
+
esac
+
+
+
diff --git a/package.nix b/package.nix
+
index cf1654c6a..1dfe7ab31 100644
+
--- a/package.nix
+
+++ b/package.nix
+
@@ -27,6 +27,7 @@
+
, libseccomp
+
, libsodium
+
, man
+
+, darwin
+
, lowdown
+
, mdbook
+
, mdbook-linkcheck
+
@@ -250,6 +251,7 @@ in {
+
gtest
+
rapidcheck
+
] ++ lib.optional stdenv.isLinux libseccomp
+
+ ++ lib.optional stdenv.hostPlatform.isDarwin darwin.apple_sdk.libs.sandbox
+
++ lib.optional stdenv.hostPlatform.isx86_64 libcpuid
+
# There have been issues building these dependencies
+
++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform && (stdenv.isLinux || stdenv.isDarwin))
+
diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc
+
index ae9c715d6..878644fa5 100644
+
--- a/src/libstore/unix/build/local-derivation-goal.cc
+
+++ b/src/libstore/unix/build/local-derivation-goal.cc
+
@@ -58,6 +58,10 @@
+
#if __APPLE__
+
#include <spawn.h>
+
#include <sys/sysctl.h>
+
+#include <sandbox.h>
+
+
+
+/* This definition is undocumented but depended upon by all major browsers. */
+
+extern "C" int sandbox_init_with_parameters(const char *profile, uint64_t flags, const char *const parameters[], char **errorbuf);
+
#endif
+
+
#include <pwd.h>
+
@@ -2017,141 +2021,132 @@ void LocalDerivationGoal::runChild()
+
+
std::string builder = "invalid";
+
+
- if (drv->isBuiltin()) {
+
- ;
+
- }
+
#if __APPLE__
+
- else {
+
- /* This has to appear before import statements. */
+
- std::string sandboxProfile = "(version 1)\n";
+
-
+
- if (useChroot) {
+
-
+
- /* Lots and lots and lots of file functions freak out if they can't stat their full ancestry */
+
- PathSet ancestry;
+
-
+
- /* We build the ancestry before adding all inputPaths to the store because we know they'll
+
- all have the same parents (the store), and there might be lots of inputs. This isn't
+
- particularly efficient... I doubt it'll be a bottleneck in practice */
+
- for (auto & i : pathsInChroot) {
+
- Path cur = i.first;
+
- while (cur.compare("/") != 0) {
+
- cur = dirOf(cur);
+
- ancestry.insert(cur);
+
- }
+
- }
+
+ /* This has to appear before import statements. */
+
+ std::string sandboxProfile = "(version 1)\n";
+
+
+
+ if (useChroot) {
+
+
- /* And we want the store in there regardless of how empty pathsInChroot. We include the innermost
+
- path component this time, since it's typically /nix/store and we care about that. */
+
- Path cur = worker.store.storeDir;
+
+ /* Lots and lots and lots of file functions freak out if they can't stat their full ancestry */
+
+ PathSet ancestry;
+
+
+
+ /* We build the ancestry before adding all inputPaths to the store because we know they'll
+
+ all have the same parents (the store), and there might be lots of inputs. This isn't
+
+ particularly efficient... I doubt it'll be a bottleneck in practice */
+
+ for (auto & i : pathsInChroot) {
+
+ Path cur = i.first;
+
while (cur.compare("/") != 0) {
+
- ancestry.insert(cur);
+
cur = dirOf(cur);
+
+ ancestry.insert(cur);
+
}
+
+ }
+
+
- /* Add all our input paths to the chroot */
+
- for (auto & i : inputPaths) {
+
- auto p = worker.store.printStorePath(i);
+
- pathsInChroot[p] = p;
+
- }
+
-
+
- /* Violations will go to the syslog if you set this. Unfortunately the destination does not appear to be configurable */
+
- if (settings.darwinLogSandboxViolations) {
+
- sandboxProfile += "(deny default)\n";
+
- } else {
+
- sandboxProfile += "(deny default (with no-log))\n";
+
- }
+
+ /* And we want the store in there regardless of how empty pathsInChroot. We include the innermost
+
+ path component this time, since it's typically /nix/store and we care about that. */
+
+ Path cur = worker.store.storeDir;
+
+ while (cur.compare("/") != 0) {
+
+ ancestry.insert(cur);
+
+ cur = dirOf(cur);
+
+ }
+
+
- sandboxProfile +=
+
- #include "sandbox-defaults.sb"
+
- ;
+
+ /* Add all our input paths to the chroot */
+
+ for (auto & i : inputPaths) {
+
+ auto p = worker.store.printStorePath(i);
+
+ pathsInChroot[p] = p;
+
+ }
+
+
- if (!derivationType->isSandboxed())
+
- sandboxProfile +=
+
- #include "sandbox-network.sb"
+
- ;
+
-
+
- /* Add the output paths we'll use at build-time to the chroot */
+
- sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
- for (auto & [_, path] : scratchOutputs)
+
- sandboxProfile += fmt("\t(subpath \"%s\")\n", worker.store.printStorePath(path));
+
-
+
- sandboxProfile += ")\n";
+
-
+
- /* Our inputs (transitive dependencies and any impurities computed above)
+
-
+
- without file-write* allowed, access() incorrectly returns EPERM
+
- */
+
- sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
- for (auto & i : pathsInChroot) {
+
- if (i.first != i.second.source)
+
- throw Error(
+
- "can't map '%1%' to '%2%': mismatched impure paths not supported on Darwin",
+
- i.first, i.second.source);
+
-
+
- std::string path = i.first;
+
- auto optSt = maybeLstat(path.c_str());
+
- if (!optSt) {
+
- if (i.second.optional)
+
- continue;
+
- throw SysError("getting attributes of required path '%s", path);
+
- }
+
- if (S_ISDIR(optSt->st_mode))
+
- sandboxProfile += fmt("\t(subpath \"%s\")\n", path);
+
- else
+
- sandboxProfile += fmt("\t(literal \"%s\")\n", path);
+
- }
+
- sandboxProfile += ")\n";
+
+ /* Violations will go to the syslog if you set this. Unfortunately the destination does not appear to be configurable */
+
+ if (settings.darwinLogSandboxViolations) {
+
+ sandboxProfile += "(deny default)\n";
+
+ } else {
+
+ sandboxProfile += "(deny default (with no-log))\n";
+
+ }
+
+
- /* Allow file-read* on full directory hierarchy to self. Allows realpath() */
+
- sandboxProfile += "(allow file-read*\n";
+
- for (auto & i : ancestry) {
+
- sandboxProfile += fmt("\t(literal \"%s\")\n", i);
+
- }
+
- sandboxProfile += ")\n";
+
+ sandboxProfile +=
+
+ #include "sandbox-defaults.sb"
+
+ ;
+
+
- sandboxProfile += additionalSandboxProfile;
+
- } else
+
+ if (!derivationType->isSandboxed())
+
sandboxProfile +=
+
- #include "sandbox-minimal.sb"
+
+ #include "sandbox-network.sb"
+
;
+
+
- debug("Generated sandbox profile:");
+
- debug(sandboxProfile);
+
-
+
- Path sandboxFile = tmpDir + "/.sandbox.sb";
+
+ /* Add the output paths we'll use at build-time to the chroot */
+
+ sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
+ for (auto & [_, path] : scratchOutputs)
+
+ sandboxProfile += fmt("\t(subpath \"%s\")\n", worker.store.printStorePath(path));
+
+
- writeFile(sandboxFile, sandboxProfile);
+
+ sandboxProfile += ")\n";
+
+
- bool allowLocalNetworking = parsedDrv->getBoolAttr("__darwinAllowLocalNetworking");
+
+ /* Our inputs (transitive dependencies and any impurities computed above)
+
+
- /* The tmpDir in scope points at the temporary build directory for our derivation. Some packages try different mechanisms
+
- to find temporary directories, so we want to open up a broader place for them to put their files, if needed. */
+
- Path globalTmpDir = canonPath(defaultTempDir(), true);
+
+ without file-write* allowed, access() incorrectly returns EPERM
+
+ */
+
+ sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
+ for (auto & i : pathsInChroot) {
+
+ if (i.first != i.second.source)
+
+ throw Error(
+
+ "can't map '%1%' to '%2%': mismatched impure paths not supported on Darwin",
+
+ i.first, i.second.source);
+
+
+
+ std::string path = i.first;
+
+ auto optSt = maybeLstat(path.c_str());
+
+ if (!optSt) {
+
+ if (i.second.optional)
+
+ continue;
+
+ throw SysError("getting attributes of required path '%s", path);
+
+ }
+
+ if (S_ISDIR(optSt->st_mode))
+
+ sandboxProfile += fmt("\t(subpath \"%s\")\n", path);
+
+ else
+
+ sandboxProfile += fmt("\t(literal \"%s\")\n", path);
+
+ }
+
+ sandboxProfile += ")\n";
+
+
- /* They don't like trailing slashes on subpath directives */
+
- while (!globalTmpDir.empty() && globalTmpDir.back() == '/')
+
- globalTmpDir.pop_back();
+
+ /* Allow file-read* on full directory hierarchy to self. Allows realpath() */
+
+ sandboxProfile += "(allow file-read*\n";
+
+ for (auto & i : ancestry) {
+
+ sandboxProfile += fmt("\t(literal \"%s\")\n", i);
+
+ }
+
+ sandboxProfile += ")\n";
+
+
- if (getEnv("_NIX_TEST_NO_SANDBOX") != "1") {
+
- builder = "/usr/bin/sandbox-exec";
+
- args.push_back("sandbox-exec");
+
- args.push_back("-f");
+
- args.push_back(sandboxFile);
+
- args.push_back("-D");
+
- args.push_back("_GLOBAL_TMP_DIR=" + globalTmpDir);
+
- if (allowLocalNetworking) {
+
- args.push_back("-D");
+
- args.push_back(std::string("_ALLOW_LOCAL_NETWORKING=1"));
+
- }
+
- args.push_back(drv->builder);
+
- } else {
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
+ sandboxProfile += additionalSandboxProfile;
+
+ } else
+
+ sandboxProfile +=
+
+ #include "sandbox-minimal.sb"
+
+ ;
+
+
+
+ debug("Generated sandbox profile:");
+
+ debug(sandboxProfile);
+
+
+
+ bool allowLocalNetworking = parsedDrv->getBoolAttr("__darwinAllowLocalNetworking");
+
+
+
+ /* The tmpDir in scope points at the temporary build directory for our derivation. Some packages try different mechanisms
+
+ to find temporary directories, so we want to open up a broader place for them to put their files, if needed. */
+
+ Path globalTmpDir = canonPath(defaultTempDir(), true);
+
+
+
+ /* They don't like trailing slashes on subpath directives */
+
+ while (!globalTmpDir.empty() && globalTmpDir.back() == '/')
+
+ globalTmpDir.pop_back();
+
+
+
+ if (getEnv("_NIX_TEST_NO_SANDBOX") != "1") {
+
+ Strings sandboxArgs;
+
+ sandboxArgs.push_back("_GLOBAL_TMP_DIR");
+
+ sandboxArgs.push_back(globalTmpDir);
+
+ if (allowLocalNetworking) {
+
+ sandboxArgs.push_back("_ALLOW_LOCAL_NETWORKING");
+
+ sandboxArgs.push_back("1");
+
+ }
+
+ if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), NULL)) {
+
+ writeFull(STDERR_FILENO, "failed to configure sandbox\n");
+
+ _exit(1);
+
}
+
}
+
+
+
+ builder = drv->builder;
+
+ args.push_back(std::string(baseNameOf(drv->builder)));
+
#else
+
- else {
+
+ if (!drv->isBuiltin()) {
+
builder = drv->builder;
+
args.push_back(std::string(baseNameOf(drv->builder)));
+
}
+
--
+
2.46.1
+
+34
pkgs/tools/package-management/nix/patches/2_23/0002-local-derivation-goal-Print-sandbox-error-detail-on-.patch
···
···
+
From c43954ffac356b4168cbcfe2a67b4bad3f0dff5d Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:44:12 +0200
+
Subject: [PATCH 2/4] local-derivation-goal: Print sandbox error detail on
+
darwin
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Co-Authored-By: Théophane Hufschmitt <theophane.hufschmitt@tweag.io>
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libstore/unix/build/local-derivation-goal.cc | 5 +++--
+
1 file changed, 3 insertions(+), 2 deletions(-)
+
+
diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc
+
index 878644fa5..0df1f0683 100644
+
--- a/src/libstore/unix/build/local-derivation-goal.cc
+
+++ b/src/libstore/unix/build/local-derivation-goal.cc
+
@@ -2137,8 +2137,9 @@ void LocalDerivationGoal::runChild()
+
sandboxArgs.push_back("_ALLOW_LOCAL_NETWORKING");
+
sandboxArgs.push_back("1");
+
}
+
- if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), NULL)) {
+
- writeFull(STDERR_FILENO, "failed to configure sandbox\n");
+
+ char * sandbox_errbuf = nullptr;
+
+ if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), &sandbox_errbuf)) {
+
+ writeFull(STDERR_FILENO, fmt("failed to configure sandbox: %s\n", sandbox_errbuf ? sandbox_errbuf : "(null)"));
+
_exit(1);
+
}
+
}
+
--
+
2.46.1
+
+41
pkgs/tools/package-management/nix/patches/2_23/0003-local-derivation-goal-Refactor.patch
···
···
+
From 53b4bdcb8b0f114bea978cffbea325fd73f779b5 Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:50:27 +0200
+
Subject: [PATCH 3/4] local-derivation-goal: Refactor
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
This works because the `builder` and `args` variables are only used
+
in the non-builtin code path.
+
+
Co-Authored-By: Théophane Hufschmitt <theophane.hufschmitt@tweag.io>
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libstore/unix/build/local-derivation-goal.cc | 5 +----
+
1 file changed, 1 insertion(+), 4 deletions(-)
+
+
diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc
+
index 0df1f0683..9e67283c9 100644
+
--- a/src/libstore/unix/build/local-derivation-goal.cc
+
+++ b/src/libstore/unix/build/local-derivation-goal.cc
+
@@ -2143,15 +2143,12 @@ void LocalDerivationGoal::runChild()
+
_exit(1);
+
}
+
}
+
+#endif
+
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
-#else
+
if (!drv->isBuiltin()) {
+
builder = drv->builder;
+
args.push_back(std::string(baseNameOf(drv->builder)));
+
}
+
-#endif
+
+
for (auto & i : drv->args)
+
args.push_back(rewriteStrings(i, inputRewrites));
+
--
+
2.46.1
+
+75
pkgs/tools/package-management/nix/patches/2_23/0004-local-derivation-goal-Move-builder-preparation-to-no.patch
···
···
+
From 67b5c7004302cbd344f63ccd306673a9adec4520 Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:57:00 +0200
+
Subject: [PATCH 4/4] local-derivation-goal: Move builder preparation to
+
non-builtin code path
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
.../unix/build/local-derivation-goal.cc | 25 ++++++++-----------
+
1 file changed, 10 insertions(+), 15 deletions(-)
+
+
diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc
+
index 9e67283c9..1f4bafb56 100644
+
--- a/src/libstore/unix/build/local-derivation-goal.cc
+
+++ b/src/libstore/unix/build/local-derivation-goal.cc
+
@@ -2016,11 +2016,6 @@ void LocalDerivationGoal::runChild()
+
throw SysError("setuid failed");
+
}
+
+
- /* Fill in the arguments. */
+
- Strings args;
+
-
+
- std::string builder = "invalid";
+
-
+
#if __APPLE__
+
/* This has to appear before import statements. */
+
std::string sandboxProfile = "(version 1)\n";
+
@@ -2145,14 +2140,6 @@ void LocalDerivationGoal::runChild()
+
}
+
#endif
+
+
- if (!drv->isBuiltin()) {
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
- }
+
-
+
- for (auto & i : drv->args)
+
- args.push_back(rewriteStrings(i, inputRewrites));
+
-
+
/* Indicate that we managed to set up the build environment. */
+
writeFull(STDERR_FILENO, std::string("\2\n"));
+
+
@@ -2183,6 +2170,14 @@ void LocalDerivationGoal::runChild()
+
}
+
}
+
+
+ // Now builder is not builtin
+
+
+
+ Strings args;
+
+ args.push_back(std::string(baseNameOf(drv->builder)));
+
+
+
+ for (auto & i : drv->args)
+
+ args.push_back(rewriteStrings(i, inputRewrites));
+
+
+
#if __APPLE__
+
posix_spawnattr_t attrp;
+
+
@@ -2204,9 +2199,9 @@ void LocalDerivationGoal::runChild()
+
posix_spawnattr_setbinpref_np(&attrp, 1, &cpu, NULL);
+
}
+
+
- posix_spawn(NULL, builder.c_str(), NULL, &attrp, stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
+ posix_spawn(NULL, drv->builder.c_str(), NULL, &attrp, stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
#else
+
- execve(builder.c_str(), stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
+ execve(drv->builder.c_str(), stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
#endif
+
+
throw SysError("executing '%1%'", drv->builder);
+
--
+
2.46.1
+
+323
pkgs/tools/package-management/nix/patches/2_24/0001-fix-Run-all-derivation-builders-inside-the-sandbox-o.patch
···
···
+
From 170242cf0ca3e9fadbad2004126793634d56623e Mon Sep 17 00:00:00 2001
+
From: Puck Meerburg <puck@puckipedia.com>
+
Date: Fri, 1 Mar 2024 11:42:24 -0500
+
Subject: [PATCH 1/5] fix: Run all derivation builders inside the sandbox on
+
macOS
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
configure.ac | 6 +-
+
package.nix | 2 +
+
.../unix/build/local-derivation-goal.cc | 223 +++++++++---------
+
3 files changed, 116 insertions(+), 115 deletions(-)
+
+
diff --git a/configure.ac b/configure.ac
+
index 5c22ed176..dff35981b 100644
+
--- a/configure.ac
+
+++ b/configure.ac
+
@@ -62,12 +62,16 @@ AC_CHECK_TOOL([AR], [ar])
+
AC_SYS_LARGEFILE
+
+
+
-# Solaris-specific stuff.
+
+# OS-specific stuff.
+
case "$host_os" in
+
solaris*)
+
# Solaris requires -lsocket -lnsl for network functions
+
LDFLAGS="-lsocket -lnsl $LDFLAGS"
+
;;
+
+ darwin*)
+
+ # Need to link to libsandbox.
+
+ LDFLAGS="-lsandbox $LDFLAGS"
+
+ ;;
+
esac
+
+
+
diff --git a/package.nix b/package.nix
+
index a7c8923e8..fcd1e1898 100644
+
--- a/package.nix
+
+++ b/package.nix
+
@@ -23,6 +23,7 @@
+
, libseccomp
+
, libsodium
+
, man
+
+, darwin
+
, lowdown
+
, mdbook
+
, mdbook-linkcheck
+
@@ -235,6 +236,7 @@ in {
+
gtest
+
rapidcheck
+
] ++ lib.optional stdenv.isLinux libseccomp
+
+ ++ lib.optional stdenv.hostPlatform.isDarwin darwin.apple_sdk.libs.sandbox
+
++ lib.optional stdenv.hostPlatform.isx86_64 libcpuid
+
# There have been issues building these dependencies
+
++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform && (stdenv.isLinux || stdenv.isDarwin))
+
diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc
+
index 54ca69580..7ce266122 100644
+
--- a/src/libstore/unix/build/local-derivation-goal.cc
+
+++ b/src/libstore/unix/build/local-derivation-goal.cc
+
@@ -58,6 +58,10 @@
+
#if __APPLE__
+
#include <spawn.h>
+
#include <sys/sysctl.h>
+
+#include <sandbox.h>
+
+
+
+/* This definition is undocumented but depended upon by all major browsers. */
+
+extern "C" int sandbox_init_with_parameters(const char *profile, uint64_t flags, const char *const parameters[], char **errorbuf);
+
#endif
+
+
#include <pwd.h>
+
@@ -2039,141 +2043,132 @@ void LocalDerivationGoal::runChild()
+
+
std::string builder = "invalid";
+
+
- if (drv->isBuiltin()) {
+
- ;
+
- }
+
#if __APPLE__
+
- else {
+
- /* This has to appear before import statements. */
+
- std::string sandboxProfile = "(version 1)\n";
+
-
+
- if (useChroot) {
+
-
+
- /* Lots and lots and lots of file functions freak out if they can't stat their full ancestry */
+
- PathSet ancestry;
+
-
+
- /* We build the ancestry before adding all inputPaths to the store because we know they'll
+
- all have the same parents (the store), and there might be lots of inputs. This isn't
+
- particularly efficient... I doubt it'll be a bottleneck in practice */
+
- for (auto & i : pathsInChroot) {
+
- Path cur = i.first;
+
- while (cur.compare("/") != 0) {
+
- cur = dirOf(cur);
+
- ancestry.insert(cur);
+
- }
+
- }
+
+ /* This has to appear before import statements. */
+
+ std::string sandboxProfile = "(version 1)\n";
+
+
+
+ if (useChroot) {
+
+
- /* And we want the store in there regardless of how empty pathsInChroot. We include the innermost
+
- path component this time, since it's typically /nix/store and we care about that. */
+
- Path cur = worker.store.storeDir;
+
+ /* Lots and lots and lots of file functions freak out if they can't stat their full ancestry */
+
+ PathSet ancestry;
+
+
+
+ /* We build the ancestry before adding all inputPaths to the store because we know they'll
+
+ all have the same parents (the store), and there might be lots of inputs. This isn't
+
+ particularly efficient... I doubt it'll be a bottleneck in practice */
+
+ for (auto & i : pathsInChroot) {
+
+ Path cur = i.first;
+
while (cur.compare("/") != 0) {
+
- ancestry.insert(cur);
+
cur = dirOf(cur);
+
+ ancestry.insert(cur);
+
}
+
+ }
+
+
- /* Add all our input paths to the chroot */
+
- for (auto & i : inputPaths) {
+
- auto p = worker.store.printStorePath(i);
+
- pathsInChroot[p] = p;
+
- }
+
-
+
- /* Violations will go to the syslog if you set this. Unfortunately the destination does not appear to be configurable */
+
- if (settings.darwinLogSandboxViolations) {
+
- sandboxProfile += "(deny default)\n";
+
- } else {
+
- sandboxProfile += "(deny default (with no-log))\n";
+
- }
+
+ /* And we want the store in there regardless of how empty pathsInChroot. We include the innermost
+
+ path component this time, since it's typically /nix/store and we care about that. */
+
+ Path cur = worker.store.storeDir;
+
+ while (cur.compare("/") != 0) {
+
+ ancestry.insert(cur);
+
+ cur = dirOf(cur);
+
+ }
+
+
- sandboxProfile +=
+
- #include "sandbox-defaults.sb"
+
- ;
+
+ /* Add all our input paths to the chroot */
+
+ for (auto & i : inputPaths) {
+
+ auto p = worker.store.printStorePath(i);
+
+ pathsInChroot[p] = p;
+
+ }
+
+
- if (!derivationType->isSandboxed())
+
- sandboxProfile +=
+
- #include "sandbox-network.sb"
+
- ;
+
-
+
- /* Add the output paths we'll use at build-time to the chroot */
+
- sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
- for (auto & [_, path] : scratchOutputs)
+
- sandboxProfile += fmt("\t(subpath \"%s\")\n", worker.store.printStorePath(path));
+
-
+
- sandboxProfile += ")\n";
+
-
+
- /* Our inputs (transitive dependencies and any impurities computed above)
+
-
+
- without file-write* allowed, access() incorrectly returns EPERM
+
- */
+
- sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
- for (auto & i : pathsInChroot) {
+
- if (i.first != i.second.source)
+
- throw Error(
+
- "can't map '%1%' to '%2%': mismatched impure paths not supported on Darwin",
+
- i.first, i.second.source);
+
-
+
- std::string path = i.first;
+
- auto optSt = maybeLstat(path.c_str());
+
- if (!optSt) {
+
- if (i.second.optional)
+
- continue;
+
- throw SysError("getting attributes of required path '%s", path);
+
- }
+
- if (S_ISDIR(optSt->st_mode))
+
- sandboxProfile += fmt("\t(subpath \"%s\")\n", path);
+
- else
+
- sandboxProfile += fmt("\t(literal \"%s\")\n", path);
+
- }
+
- sandboxProfile += ")\n";
+
+ /* Violations will go to the syslog if you set this. Unfortunately the destination does not appear to be configurable */
+
+ if (settings.darwinLogSandboxViolations) {
+
+ sandboxProfile += "(deny default)\n";
+
+ } else {
+
+ sandboxProfile += "(deny default (with no-log))\n";
+
+ }
+
+
- /* Allow file-read* on full directory hierarchy to self. Allows realpath() */
+
- sandboxProfile += "(allow file-read*\n";
+
- for (auto & i : ancestry) {
+
- sandboxProfile += fmt("\t(literal \"%s\")\n", i);
+
- }
+
- sandboxProfile += ")\n";
+
+ sandboxProfile +=
+
+ #include "sandbox-defaults.sb"
+
+ ;
+
+
- sandboxProfile += additionalSandboxProfile;
+
- } else
+
+ if (!derivationType->isSandboxed())
+
sandboxProfile +=
+
- #include "sandbox-minimal.sb"
+
+ #include "sandbox-network.sb"
+
;
+
+
- debug("Generated sandbox profile:");
+
- debug(sandboxProfile);
+
-
+
- Path sandboxFile = tmpDir + "/.sandbox.sb";
+
+ /* Add the output paths we'll use at build-time to the chroot */
+
+ sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
+ for (auto & [_, path] : scratchOutputs)
+
+ sandboxProfile += fmt("\t(subpath \"%s\")\n", worker.store.printStorePath(path));
+
+
- writeFile(sandboxFile, sandboxProfile);
+
+ sandboxProfile += ")\n";
+
+
- bool allowLocalNetworking = parsedDrv->getBoolAttr("__darwinAllowLocalNetworking");
+
+ /* Our inputs (transitive dependencies and any impurities computed above)
+
+
- /* The tmpDir in scope points at the temporary build directory for our derivation. Some packages try different mechanisms
+
- to find temporary directories, so we want to open up a broader place for them to put their files, if needed. */
+
- Path globalTmpDir = canonPath(defaultTempDir(), true);
+
+ without file-write* allowed, access() incorrectly returns EPERM
+
+ */
+
+ sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
+ for (auto & i : pathsInChroot) {
+
+ if (i.first != i.second.source)
+
+ throw Error(
+
+ "can't map '%1%' to '%2%': mismatched impure paths not supported on Darwin",
+
+ i.first, i.second.source);
+
+
+
+ std::string path = i.first;
+
+ auto optSt = maybeLstat(path.c_str());
+
+ if (!optSt) {
+
+ if (i.second.optional)
+
+ continue;
+
+ throw SysError("getting attributes of required path '%s", path);
+
+ }
+
+ if (S_ISDIR(optSt->st_mode))
+
+ sandboxProfile += fmt("\t(subpath \"%s\")\n", path);
+
+ else
+
+ sandboxProfile += fmt("\t(literal \"%s\")\n", path);
+
+ }
+
+ sandboxProfile += ")\n";
+
+
- /* They don't like trailing slashes on subpath directives */
+
- while (!globalTmpDir.empty() && globalTmpDir.back() == '/')
+
- globalTmpDir.pop_back();
+
+ /* Allow file-read* on full directory hierarchy to self. Allows realpath() */
+
+ sandboxProfile += "(allow file-read*\n";
+
+ for (auto & i : ancestry) {
+
+ sandboxProfile += fmt("\t(literal \"%s\")\n", i);
+
+ }
+
+ sandboxProfile += ")\n";
+
+
- if (getEnv("_NIX_TEST_NO_SANDBOX") != "1") {
+
- builder = "/usr/bin/sandbox-exec";
+
- args.push_back("sandbox-exec");
+
- args.push_back("-f");
+
- args.push_back(sandboxFile);
+
- args.push_back("-D");
+
- args.push_back("_GLOBAL_TMP_DIR=" + globalTmpDir);
+
- if (allowLocalNetworking) {
+
- args.push_back("-D");
+
- args.push_back(std::string("_ALLOW_LOCAL_NETWORKING=1"));
+
- }
+
- args.push_back(drv->builder);
+
- } else {
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
+ sandboxProfile += additionalSandboxProfile;
+
+ } else
+
+ sandboxProfile +=
+
+ #include "sandbox-minimal.sb"
+
+ ;
+
+
+
+ debug("Generated sandbox profile:");
+
+ debug(sandboxProfile);
+
+
+
+ bool allowLocalNetworking = parsedDrv->getBoolAttr("__darwinAllowLocalNetworking");
+
+
+
+ /* The tmpDir in scope points at the temporary build directory for our derivation. Some packages try different mechanisms
+
+ to find temporary directories, so we want to open up a broader place for them to put their files, if needed. */
+
+ Path globalTmpDir = canonPath(defaultTempDir(), true);
+
+
+
+ /* They don't like trailing slashes on subpath directives */
+
+ while (!globalTmpDir.empty() && globalTmpDir.back() == '/')
+
+ globalTmpDir.pop_back();
+
+
+
+ if (getEnv("_NIX_TEST_NO_SANDBOX") != "1") {
+
+ Strings sandboxArgs;
+
+ sandboxArgs.push_back("_GLOBAL_TMP_DIR");
+
+ sandboxArgs.push_back(globalTmpDir);
+
+ if (allowLocalNetworking) {
+
+ sandboxArgs.push_back("_ALLOW_LOCAL_NETWORKING");
+
+ sandboxArgs.push_back("1");
+
+ }
+
+ if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), NULL)) {
+
+ writeFull(STDERR_FILENO, "failed to configure sandbox\n");
+
+ _exit(1);
+
}
+
}
+
+
+
+ builder = drv->builder;
+
+ args.push_back(std::string(baseNameOf(drv->builder)));
+
#else
+
- else {
+
+ if (!drv->isBuiltin()) {
+
builder = drv->builder;
+
args.push_back(std::string(baseNameOf(drv->builder)));
+
}
+
--
+
2.46.1
+
+53
pkgs/tools/package-management/nix/patches/2_24/0002-packaging-Add-darwin-lsandbox-in-meson.patch
···
···
+
From f8a1a149c73113e01c44b73ce9e1005575d52a9a Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:23:17 +0200
+
Subject: [PATCH 2/5] packaging: Add darwin -lsandbox in meson
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libstore/meson.build | 5 +++++
+
src/libstore/package.nix | 2 ++
+
2 files changed, 7 insertions(+)
+
+
diff --git a/src/libstore/meson.build b/src/libstore/meson.build
+
index 50b15e15d..b23c85061 100644
+
--- a/src/libstore/meson.build
+
+++ b/src/libstore/meson.build
+
@@ -68,6 +68,11 @@ has_acl_support = cxx.has_header('sys/xattr.h') \
+
and cxx.has_function('lremovexattr')
+
configdata.set('HAVE_ACL_SUPPORT', has_acl_support.to_int())
+
+
+if host_machine.system() == 'darwin'
+
+ sandbox = cxx.find_library('sandbox')
+
+ deps_other += [sandbox]
+
+endif
+
+
+
subdir('build-utils-meson/threads')
+
+
boost = dependency(
+
diff --git a/src/libstore/package.nix b/src/libstore/package.nix
+
index 4582ba0d2..d98bac16d 100644
+
--- a/src/libstore/package.nix
+
+++ b/src/libstore/package.nix
+
@@ -7,6 +7,7 @@
+
, ninja
+
, pkg-config
+
, unixtools
+
+, darwin
+
+
, nix-util
+
, boost
+
@@ -65,6 +66,7 @@ mkMesonDerivation (finalAttrs: {
+
sqlite
+
] ++ lib.optional stdenv.hostPlatform.isLinux libseccomp
+
# There have been issues building these dependencies
+
+ ++ lib.optional stdenv.hostPlatform.isDarwin darwin.apple_sdk.libs.sandbox
+
++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform && (stdenv.isLinux || stdenv.isDarwin))
+
aws-sdk-cpp
+
;
+
--
+
2.46.1
+
+34
pkgs/tools/package-management/nix/patches/2_24/0003-local-derivation-goal-Print-sandbox-error-detail-on-.patch
···
···
+
From ae7a2ea74136363c2f6ac6e624ea95da7abfafcc Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:44:12 +0200
+
Subject: [PATCH 3/5] local-derivation-goal: Print sandbox error detail on
+
darwin
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Co-Authored-By: Théophane Hufschmitt <theophane.hufschmitt@tweag.io>
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libstore/unix/build/local-derivation-goal.cc | 5 +++--
+
1 file changed, 3 insertions(+), 2 deletions(-)
+
+
diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc
+
index 7ce266122..706771e8e 100644
+
--- a/src/libstore/unix/build/local-derivation-goal.cc
+
+++ b/src/libstore/unix/build/local-derivation-goal.cc
+
@@ -2159,8 +2159,9 @@ void LocalDerivationGoal::runChild()
+
sandboxArgs.push_back("_ALLOW_LOCAL_NETWORKING");
+
sandboxArgs.push_back("1");
+
}
+
- if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), NULL)) {
+
- writeFull(STDERR_FILENO, "failed to configure sandbox\n");
+
+ char * sandbox_errbuf = nullptr;
+
+ if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), &sandbox_errbuf)) {
+
+ writeFull(STDERR_FILENO, fmt("failed to configure sandbox: %s\n", sandbox_errbuf ? sandbox_errbuf : "(null)"));
+
_exit(1);
+
}
+
}
+
--
+
2.46.1
+
+41
pkgs/tools/package-management/nix/patches/2_24/0004-local-derivation-goal-Refactor.patch
···
···
+
From 047ee50db2f660eb3f50fab8f7543ce95e814b7c Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:50:27 +0200
+
Subject: [PATCH 4/5] local-derivation-goal: Refactor
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
This works because the `builder` and `args` variables are only used
+
in the non-builtin code path.
+
+
Co-Authored-By: Théophane Hufschmitt <theophane.hufschmitt@tweag.io>
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libstore/unix/build/local-derivation-goal.cc | 5 +----
+
1 file changed, 1 insertion(+), 4 deletions(-)
+
+
diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc
+
index 706771e8e..d9738a1ea 100644
+
--- a/src/libstore/unix/build/local-derivation-goal.cc
+
+++ b/src/libstore/unix/build/local-derivation-goal.cc
+
@@ -2165,15 +2165,12 @@ void LocalDerivationGoal::runChild()
+
_exit(1);
+
}
+
}
+
+#endif
+
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
-#else
+
if (!drv->isBuiltin()) {
+
builder = drv->builder;
+
args.push_back(std::string(baseNameOf(drv->builder)));
+
}
+
-#endif
+
+
for (auto & i : drv->args)
+
args.push_back(rewriteStrings(i, inputRewrites));
+
--
+
2.46.1
+
+75
pkgs/tools/package-management/nix/patches/2_24/0005-local-derivation-goal-Move-builder-preparation-to-no.patch
···
···
+
From 50f83e4bbd9107576399f94449ac9cb4e80d575e Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:57:00 +0200
+
Subject: [PATCH 5/5] local-derivation-goal: Move builder preparation to
+
non-builtin code path
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
.../unix/build/local-derivation-goal.cc | 25 ++++++++-----------
+
1 file changed, 10 insertions(+), 15 deletions(-)
+
+
diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc
+
index d9738a1ea..2a09e3dd4 100644
+
--- a/src/libstore/unix/build/local-derivation-goal.cc
+
+++ b/src/libstore/unix/build/local-derivation-goal.cc
+
@@ -2038,11 +2038,6 @@ void LocalDerivationGoal::runChild()
+
throw SysError("setuid failed");
+
}
+
+
- /* Fill in the arguments. */
+
- Strings args;
+
-
+
- std::string builder = "invalid";
+
-
+
#if __APPLE__
+
/* This has to appear before import statements. */
+
std::string sandboxProfile = "(version 1)\n";
+
@@ -2167,14 +2162,6 @@ void LocalDerivationGoal::runChild()
+
}
+
#endif
+
+
- if (!drv->isBuiltin()) {
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
- }
+
-
+
- for (auto & i : drv->args)
+
- args.push_back(rewriteStrings(i, inputRewrites));
+
-
+
/* Indicate that we managed to set up the build environment. */
+
writeFull(STDERR_FILENO, std::string("\2\n"));
+
+
@@ -2205,6 +2192,14 @@ void LocalDerivationGoal::runChild()
+
}
+
}
+
+
+ // Now builder is not builtin
+
+
+
+ Strings args;
+
+ args.push_back(std::string(baseNameOf(drv->builder)));
+
+
+
+ for (auto & i : drv->args)
+
+ args.push_back(rewriteStrings(i, inputRewrites));
+
+
+
#if __APPLE__
+
posix_spawnattr_t attrp;
+
+
@@ -2226,9 +2221,9 @@ void LocalDerivationGoal::runChild()
+
posix_spawnattr_setbinpref_np(&attrp, 1, &cpu, NULL);
+
}
+
+
- posix_spawn(NULL, builder.c_str(), NULL, &attrp, stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
+ posix_spawn(NULL, drv->builder.c_str(), NULL, &attrp, stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
#else
+
- execve(builder.c_str(), stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
+ execve(drv->builder.c_str(), stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
#endif
+
+
throw SysError("executing '%1%'", drv->builder);
+
--
+
2.46.1
+
+28
pkgs/tools/package-management/nix/patches/git/0001-Fix-meson-build-on-darwin.patch
···
···
+
From 766263d53ae69d70c5915426e6e8f58abd988226 Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Tue, 22 Oct 2024 15:28:04 +0200
+
Subject: [PATCH 1/6] Fix meson build on darwin
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
std::stringbuf is defined in <sstream>
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libutil/strings.cc | 1 +
+
1 file changed, 1 insertion(+)
+
+
diff --git a/src/libutil/strings.cc b/src/libutil/strings.cc
+
index d1c9f700c..c221a43c6 100644
+
--- a/src/libutil/strings.cc
+
+++ b/src/libutil/strings.cc
+
@@ -1,5 +1,6 @@
+
#include <filesystem>
+
#include <string>
+
+#include <sstream>
+
+
#include "strings-inline.hh"
+
#include "os-string.hh"
+
--
+
2.46.1
+
+323
pkgs/tools/package-management/nix/patches/git/0002-fix-Run-all-derivation-builders-inside-the-sandbox-o.patch
···
···
+
From d2c880b03f58eb4fdd6d19eb3ffa4345a0477419 Mon Sep 17 00:00:00 2001
+
From: Puck Meerburg <puck@puckipedia.com>
+
Date: Fri, 1 Mar 2024 11:42:24 -0500
+
Subject: [PATCH 2/6] fix: Run all derivation builders inside the sandbox on
+
macOS
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
configure.ac | 6 +-
+
package.nix | 2 +
+
.../unix/build/local-derivation-goal.cc | 223 +++++++++---------
+
3 files changed, 116 insertions(+), 115 deletions(-)
+
+
diff --git a/configure.ac b/configure.ac
+
index 198198dea..c7c9b3f4b 100644
+
--- a/configure.ac
+
+++ b/configure.ac
+
@@ -62,12 +62,16 @@ AC_CHECK_TOOL([AR], [ar])
+
AC_SYS_LARGEFILE
+
+
+
-# Solaris-specific stuff.
+
+# OS-specific stuff.
+
case "$host_os" in
+
solaris*)
+
# Solaris requires -lsocket -lnsl for network functions
+
LDFLAGS="-lsocket -lnsl $LDFLAGS"
+
;;
+
+ darwin*)
+
+ # Need to link to libsandbox.
+
+ LDFLAGS="-lsandbox $LDFLAGS"
+
+ ;;
+
esac
+
+
+
diff --git a/package.nix b/package.nix
+
index 00621d475..77f1de58c 100644
+
--- a/package.nix
+
+++ b/package.nix
+
@@ -23,6 +23,7 @@
+
, libseccomp
+
, libsodium
+
, man
+
+, darwin
+
, lowdown
+
, mdbook
+
, mdbook-linkcheck
+
@@ -232,6 +233,7 @@ in {
+
gtest
+
rapidcheck
+
] ++ lib.optional stdenv.isLinux libseccomp
+
+ ++ lib.optional stdenv.hostPlatform.isDarwin darwin.apple_sdk.libs.sandbox
+
++ lib.optional stdenv.hostPlatform.isx86_64 libcpuid
+
# There have been issues building these dependencies
+
++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform && (stdenv.isLinux || stdenv.isDarwin))
+
diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc
+
index b4685b3a7..067755c0d 100644
+
--- a/src/libstore/unix/build/local-derivation-goal.cc
+
+++ b/src/libstore/unix/build/local-derivation-goal.cc
+
@@ -58,6 +58,10 @@
+
#if __APPLE__
+
#include <spawn.h>
+
#include <sys/sysctl.h>
+
+#include <sandbox.h>
+
+
+
+/* This definition is undocumented but depended upon by all major browsers. */
+
+extern "C" int sandbox_init_with_parameters(const char *profile, uint64_t flags, const char *const parameters[], char **errorbuf);
+
#endif
+
+
#include <pwd.h>
+
@@ -2088,141 +2092,132 @@ void LocalDerivationGoal::runChild()
+
+
std::string builder = "invalid";
+
+
- if (drv->isBuiltin()) {
+
- ;
+
- }
+
#if __APPLE__
+
- else {
+
- /* This has to appear before import statements. */
+
- std::string sandboxProfile = "(version 1)\n";
+
-
+
- if (useChroot) {
+
-
+
- /* Lots and lots and lots of file functions freak out if they can't stat their full ancestry */
+
- PathSet ancestry;
+
-
+
- /* We build the ancestry before adding all inputPaths to the store because we know they'll
+
- all have the same parents (the store), and there might be lots of inputs. This isn't
+
- particularly efficient... I doubt it'll be a bottleneck in practice */
+
- for (auto & i : pathsInChroot) {
+
- Path cur = i.first;
+
- while (cur.compare("/") != 0) {
+
- cur = dirOf(cur);
+
- ancestry.insert(cur);
+
- }
+
- }
+
+ /* This has to appear before import statements. */
+
+ std::string sandboxProfile = "(version 1)\n";
+
+
+
+ if (useChroot) {
+
+
- /* And we want the store in there regardless of how empty pathsInChroot. We include the innermost
+
- path component this time, since it's typically /nix/store and we care about that. */
+
- Path cur = worker.store.storeDir;
+
+ /* Lots and lots and lots of file functions freak out if they can't stat their full ancestry */
+
+ PathSet ancestry;
+
+
+
+ /* We build the ancestry before adding all inputPaths to the store because we know they'll
+
+ all have the same parents (the store), and there might be lots of inputs. This isn't
+
+ particularly efficient... I doubt it'll be a bottleneck in practice */
+
+ for (auto & i : pathsInChroot) {
+
+ Path cur = i.first;
+
while (cur.compare("/") != 0) {
+
- ancestry.insert(cur);
+
cur = dirOf(cur);
+
+ ancestry.insert(cur);
+
}
+
+ }
+
+
- /* Add all our input paths to the chroot */
+
- for (auto & i : inputPaths) {
+
- auto p = worker.store.printStorePath(i);
+
- pathsInChroot[p] = p;
+
- }
+
-
+
- /* Violations will go to the syslog if you set this. Unfortunately the destination does not appear to be configurable */
+
- if (settings.darwinLogSandboxViolations) {
+
- sandboxProfile += "(deny default)\n";
+
- } else {
+
- sandboxProfile += "(deny default (with no-log))\n";
+
- }
+
+ /* And we want the store in there regardless of how empty pathsInChroot. We include the innermost
+
+ path component this time, since it's typically /nix/store and we care about that. */
+
+ Path cur = worker.store.storeDir;
+
+ while (cur.compare("/") != 0) {
+
+ ancestry.insert(cur);
+
+ cur = dirOf(cur);
+
+ }
+
+
- sandboxProfile +=
+
- #include "sandbox-defaults.sb"
+
- ;
+
+ /* Add all our input paths to the chroot */
+
+ for (auto & i : inputPaths) {
+
+ auto p = worker.store.printStorePath(i);
+
+ pathsInChroot[p] = p;
+
+ }
+
+
- if (!derivationType->isSandboxed())
+
- sandboxProfile +=
+
- #include "sandbox-network.sb"
+
- ;
+
-
+
- /* Add the output paths we'll use at build-time to the chroot */
+
- sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
- for (auto & [_, path] : scratchOutputs)
+
- sandboxProfile += fmt("\t(subpath \"%s\")\n", worker.store.printStorePath(path));
+
-
+
- sandboxProfile += ")\n";
+
-
+
- /* Our inputs (transitive dependencies and any impurities computed above)
+
-
+
- without file-write* allowed, access() incorrectly returns EPERM
+
- */
+
- sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
- for (auto & i : pathsInChroot) {
+
- if (i.first != i.second.source)
+
- throw Error(
+
- "can't map '%1%' to '%2%': mismatched impure paths not supported on Darwin",
+
- i.first, i.second.source);
+
-
+
- std::string path = i.first;
+
- auto optSt = maybeLstat(path.c_str());
+
- if (!optSt) {
+
- if (i.second.optional)
+
- continue;
+
- throw SysError("getting attributes of required path '%s", path);
+
- }
+
- if (S_ISDIR(optSt->st_mode))
+
- sandboxProfile += fmt("\t(subpath \"%s\")\n", path);
+
- else
+
- sandboxProfile += fmt("\t(literal \"%s\")\n", path);
+
- }
+
- sandboxProfile += ")\n";
+
+ /* Violations will go to the syslog if you set this. Unfortunately the destination does not appear to be configurable */
+
+ if (settings.darwinLogSandboxViolations) {
+
+ sandboxProfile += "(deny default)\n";
+
+ } else {
+
+ sandboxProfile += "(deny default (with no-log))\n";
+
+ }
+
+
- /* Allow file-read* on full directory hierarchy to self. Allows realpath() */
+
- sandboxProfile += "(allow file-read*\n";
+
- for (auto & i : ancestry) {
+
- sandboxProfile += fmt("\t(literal \"%s\")\n", i);
+
- }
+
- sandboxProfile += ")\n";
+
+ sandboxProfile +=
+
+ #include "sandbox-defaults.sb"
+
+ ;
+
+
- sandboxProfile += additionalSandboxProfile;
+
- } else
+
+ if (!derivationType->isSandboxed())
+
sandboxProfile +=
+
- #include "sandbox-minimal.sb"
+
+ #include "sandbox-network.sb"
+
;
+
+
- debug("Generated sandbox profile:");
+
- debug(sandboxProfile);
+
-
+
- Path sandboxFile = tmpDir + "/.sandbox.sb";
+
+ /* Add the output paths we'll use at build-time to the chroot */
+
+ sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
+ for (auto & [_, path] : scratchOutputs)
+
+ sandboxProfile += fmt("\t(subpath \"%s\")\n", worker.store.printStorePath(path));
+
+
- writeFile(sandboxFile, sandboxProfile);
+
+ sandboxProfile += ")\n";
+
+
- bool allowLocalNetworking = parsedDrv->getBoolAttr("__darwinAllowLocalNetworking");
+
+ /* Our inputs (transitive dependencies and any impurities computed above)
+
+
- /* The tmpDir in scope points at the temporary build directory for our derivation. Some packages try different mechanisms
+
- to find temporary directories, so we want to open up a broader place for them to put their files, if needed. */
+
- Path globalTmpDir = canonPath(defaultTempDir(), true);
+
+ without file-write* allowed, access() incorrectly returns EPERM
+
+ */
+
+ sandboxProfile += "(allow file-read* file-write* process-exec\n";
+
+ for (auto & i : pathsInChroot) {
+
+ if (i.first != i.second.source)
+
+ throw Error(
+
+ "can't map '%1%' to '%2%': mismatched impure paths not supported on Darwin",
+
+ i.first, i.second.source);
+
+
+
+ std::string path = i.first;
+
+ auto optSt = maybeLstat(path.c_str());
+
+ if (!optSt) {
+
+ if (i.second.optional)
+
+ continue;
+
+ throw SysError("getting attributes of required path '%s", path);
+
+ }
+
+ if (S_ISDIR(optSt->st_mode))
+
+ sandboxProfile += fmt("\t(subpath \"%s\")\n", path);
+
+ else
+
+ sandboxProfile += fmt("\t(literal \"%s\")\n", path);
+
+ }
+
+ sandboxProfile += ")\n";
+
+
- /* They don't like trailing slashes on subpath directives */
+
- while (!globalTmpDir.empty() && globalTmpDir.back() == '/')
+
- globalTmpDir.pop_back();
+
+ /* Allow file-read* on full directory hierarchy to self. Allows realpath() */
+
+ sandboxProfile += "(allow file-read*\n";
+
+ for (auto & i : ancestry) {
+
+ sandboxProfile += fmt("\t(literal \"%s\")\n", i);
+
+ }
+
+ sandboxProfile += ")\n";
+
+
- if (getEnv("_NIX_TEST_NO_SANDBOX") != "1") {
+
- builder = "/usr/bin/sandbox-exec";
+
- args.push_back("sandbox-exec");
+
- args.push_back("-f");
+
- args.push_back(sandboxFile);
+
- args.push_back("-D");
+
- args.push_back("_GLOBAL_TMP_DIR=" + globalTmpDir);
+
- if (allowLocalNetworking) {
+
- args.push_back("-D");
+
- args.push_back(std::string("_ALLOW_LOCAL_NETWORKING=1"));
+
- }
+
- args.push_back(drv->builder);
+
- } else {
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
+ sandboxProfile += additionalSandboxProfile;
+
+ } else
+
+ sandboxProfile +=
+
+ #include "sandbox-minimal.sb"
+
+ ;
+
+
+
+ debug("Generated sandbox profile:");
+
+ debug(sandboxProfile);
+
+
+
+ bool allowLocalNetworking = parsedDrv->getBoolAttr("__darwinAllowLocalNetworking");
+
+
+
+ /* The tmpDir in scope points at the temporary build directory for our derivation. Some packages try different mechanisms
+
+ to find temporary directories, so we want to open up a broader place for them to put their files, if needed. */
+
+ Path globalTmpDir = canonPath(defaultTempDir(), true);
+
+
+
+ /* They don't like trailing slashes on subpath directives */
+
+ while (!globalTmpDir.empty() && globalTmpDir.back() == '/')
+
+ globalTmpDir.pop_back();
+
+
+
+ if (getEnv("_NIX_TEST_NO_SANDBOX") != "1") {
+
+ Strings sandboxArgs;
+
+ sandboxArgs.push_back("_GLOBAL_TMP_DIR");
+
+ sandboxArgs.push_back(globalTmpDir);
+
+ if (allowLocalNetworking) {
+
+ sandboxArgs.push_back("_ALLOW_LOCAL_NETWORKING");
+
+ sandboxArgs.push_back("1");
+
+ }
+
+ if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), NULL)) {
+
+ writeFull(STDERR_FILENO, "failed to configure sandbox\n");
+
+ _exit(1);
+
}
+
}
+
+
+
+ builder = drv->builder;
+
+ args.push_back(std::string(baseNameOf(drv->builder)));
+
#else
+
- else {
+
+ if (!drv->isBuiltin()) {
+
builder = drv->builder;
+
args.push_back(std::string(baseNameOf(drv->builder)));
+
}
+
--
+
2.46.1
+
+53
pkgs/tools/package-management/nix/patches/git/0003-packaging-Add-darwin-lsandbox-in-meson.patch
···
···
+
From f7335530619f9b18d6cc249a297e4dca369101a5 Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:23:17 +0200
+
Subject: [PATCH 3/6] packaging: Add darwin -lsandbox in meson
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libstore/meson.build | 5 +++++
+
src/libstore/package.nix | 2 ++
+
2 files changed, 7 insertions(+)
+
+
diff --git a/src/libstore/meson.build b/src/libstore/meson.build
+
index 6a6aabf97..c2aa5bff3 100644
+
--- a/src/libstore/meson.build
+
+++ b/src/libstore/meson.build
+
@@ -69,6 +69,11 @@ has_acl_support = cxx.has_header('sys/xattr.h') \
+
and cxx.has_function('lremovexattr')
+
configdata.set('HAVE_ACL_SUPPORT', has_acl_support.to_int())
+
+
+if host_machine.system() == 'darwin'
+
+ sandbox = cxx.find_library('sandbox')
+
+ deps_other += [sandbox]
+
+endif
+
+
+
subdir('build-utils-meson/threads')
+
+
boost = dependency(
+
diff --git a/src/libstore/package.nix b/src/libstore/package.nix
+
index 9568462b5..f04e3b95f 100644
+
--- a/src/libstore/package.nix
+
+++ b/src/libstore/package.nix
+
@@ -3,6 +3,7 @@
+
, mkMesonLibrary
+
+
, unixtools
+
+, darwin
+
+
, nix-util
+
, boost
+
@@ -56,6 +57,7 @@ mkMesonLibrary (finalAttrs: {
+
sqlite
+
] ++ lib.optional stdenv.hostPlatform.isLinux libseccomp
+
# There have been issues building these dependencies
+
+ ++ lib.optional stdenv.hostPlatform.isDarwin darwin.apple_sdk.libs.sandbox
+
++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform && (stdenv.isLinux || stdenv.isDarwin))
+
aws-sdk-cpp
+
;
+
--
+
2.46.1
+
+34
pkgs/tools/package-management/nix/patches/git/0004-local-derivation-goal-Print-sandbox-error-detail-on-.patch
···
···
+
From 14d09e0b55898ac22d4cdeade3bf6c4174052ffd Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:44:12 +0200
+
Subject: [PATCH 4/6] local-derivation-goal: Print sandbox error detail on
+
darwin
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Co-Authored-By: Théophane Hufschmitt <theophane.hufschmitt@tweag.io>
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libstore/unix/build/local-derivation-goal.cc | 5 +++--
+
1 file changed, 3 insertions(+), 2 deletions(-)
+
+
diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc
+
index 067755c0d..f34d68403 100644
+
--- a/src/libstore/unix/build/local-derivation-goal.cc
+
+++ b/src/libstore/unix/build/local-derivation-goal.cc
+
@@ -2208,8 +2208,9 @@ void LocalDerivationGoal::runChild()
+
sandboxArgs.push_back("_ALLOW_LOCAL_NETWORKING");
+
sandboxArgs.push_back("1");
+
}
+
- if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), NULL)) {
+
- writeFull(STDERR_FILENO, "failed to configure sandbox\n");
+
+ char * sandbox_errbuf = nullptr;
+
+ if (sandbox_init_with_parameters(sandboxProfile.c_str(), 0, stringsToCharPtrs(sandboxArgs).data(), &sandbox_errbuf)) {
+
+ writeFull(STDERR_FILENO, fmt("failed to configure sandbox: %s\n", sandbox_errbuf ? sandbox_errbuf : "(null)"));
+
_exit(1);
+
}
+
}
+
--
+
2.46.1
+
+41
pkgs/tools/package-management/nix/patches/git/0005-local-derivation-goal-Refactor.patch
···
···
+
From 06e27042e176b79561f50decb0fdf836b7bec3f5 Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:50:27 +0200
+
Subject: [PATCH 5/6] local-derivation-goal: Refactor
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
This works because the `builder` and `args` variables are only used
+
in the non-builtin code path.
+
+
Co-Authored-By: Théophane Hufschmitt <theophane.hufschmitt@tweag.io>
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
src/libstore/unix/build/local-derivation-goal.cc | 5 +----
+
1 file changed, 1 insertion(+), 4 deletions(-)
+
+
diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc
+
index f34d68403..f781a84c6 100644
+
--- a/src/libstore/unix/build/local-derivation-goal.cc
+
+++ b/src/libstore/unix/build/local-derivation-goal.cc
+
@@ -2214,15 +2214,12 @@ void LocalDerivationGoal::runChild()
+
_exit(1);
+
}
+
}
+
+#endif
+
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
-#else
+
if (!drv->isBuiltin()) {
+
builder = drv->builder;
+
args.push_back(std::string(baseNameOf(drv->builder)));
+
}
+
-#endif
+
+
for (auto & i : drv->args)
+
args.push_back(rewriteStrings(i, inputRewrites));
+
--
+
2.46.1
+
+75
pkgs/tools/package-management/nix/patches/git/0006-local-derivation-goal-Move-builder-preparation-to-no.patch
···
···
+
From d1e0bae55afb3c3ef0bcad5d644b0e04da6279b3 Mon Sep 17 00:00:00 2001
+
From: Robert Hensing <robert@roberthensing.nl>
+
Date: Thu, 3 Oct 2024 12:57:00 +0200
+
Subject: [PATCH 6/6] local-derivation-goal: Move builder preparation to
+
non-builtin code path
+
MIME-Version: 1.0
+
Content-Type: text/plain; charset=UTF-8
+
Content-Transfer-Encoding: 8bit
+
+
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+
---
+
.../unix/build/local-derivation-goal.cc | 25 ++++++++-----------
+
1 file changed, 10 insertions(+), 15 deletions(-)
+
+
diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc
+
index f781a84c6..dcfaadeef 100644
+
--- a/src/libstore/unix/build/local-derivation-goal.cc
+
+++ b/src/libstore/unix/build/local-derivation-goal.cc
+
@@ -2087,11 +2087,6 @@ void LocalDerivationGoal::runChild()
+
throw SysError("setuid failed");
+
}
+
+
- /* Fill in the arguments. */
+
- Strings args;
+
-
+
- std::string builder = "invalid";
+
-
+
#if __APPLE__
+
/* This has to appear before import statements. */
+
std::string sandboxProfile = "(version 1)\n";
+
@@ -2216,14 +2211,6 @@ void LocalDerivationGoal::runChild()
+
}
+
#endif
+
+
- if (!drv->isBuiltin()) {
+
- builder = drv->builder;
+
- args.push_back(std::string(baseNameOf(drv->builder)));
+
- }
+
-
+
- for (auto & i : drv->args)
+
- args.push_back(rewriteStrings(i, inputRewrites));
+
-
+
/* Indicate that we managed to set up the build environment. */
+
writeFull(STDERR_FILENO, std::string("\2\n"));
+
+
@@ -2254,6 +2241,14 @@ void LocalDerivationGoal::runChild()
+
}
+
}
+
+
+ // Now builder is not builtin
+
+
+
+ Strings args;
+
+ args.push_back(std::string(baseNameOf(drv->builder)));
+
+
+
+ for (auto & i : drv->args)
+
+ args.push_back(rewriteStrings(i, inputRewrites));
+
+
+
#if __APPLE__
+
posix_spawnattr_t attrp;
+
+
@@ -2275,9 +2270,9 @@ void LocalDerivationGoal::runChild()
+
posix_spawnattr_setbinpref_np(&attrp, 1, &cpu, NULL);
+
}
+
+
- posix_spawn(NULL, builder.c_str(), NULL, &attrp, stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
+ posix_spawn(NULL, drv->builder.c_str(), NULL, &attrp, stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
#else
+
- execve(builder.c_str(), stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
+ execve(drv->builder.c_str(), stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
+
#endif
+
+
throw SysError("executing '%1%'", drv->builder);
+
--
+
2.46.1
+
+44 -22
pkgs/tools/security/fulcio/default.nix pkgs/by-name/fu/fulcio/package.nix
···
-
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "fulcio";
-
version = "1.6.4";
src = fetchFromGitHub {
owner = "sigstore";
repo = pname;
rev = "v${version}";
-
hash = "sha256-eRf504i9kYQua/p0SNlDGNeXa9ztoyz6M8nukhRyzIY=";
# populate values that require us to use git. By doing this in postFetch we
# can delete .git afterwards and maintain better reproducibility of the src.
leaveDotGit = true;
···
find "$out" -name .git -print0 | xargs -0 rm -rf
'';
};
-
vendorHash = "sha256-VTJhQrsqwGHq8211N3pUf4fmU4H90gRWYJTdEufNGg4=";
nativeBuildInputs = [ installShellFiles ];
···
preCheck = ''
# test all paths
unset subPackages
-
-
# skip test that requires networking
-
substituteInPlace pkg/config/config_network_test.go \
-
--replace "TestLoad" "SkipLoad"
'';
-
postInstall = ''
-
installShellCompletion --cmd fulcio \
-
--bash <($out/bin/fulcio completion bash) \
-
--fish <($out/bin/fulcio completion fish) \
-
--zsh <($out/bin/fulcio completion zsh)
-
'';
-
doInstallCheck = true;
-
installCheckPhase = ''
-
runHook preInstallCheck
-
$out/bin/fulcio --help
-
$out/bin/fulcio version 2>&1 | grep "v${version}"
-
runHook postInstallCheck
-
'';
meta = with lib; {
homepage = "https://github.com/sigstore/fulcio";
···
disconnected instance.
'';
license = licenses.asl20;
-
maintainers = with maintainers; [ lesuisse jk ];
};
}
···
+
{
+
lib,
+
buildGoModule,
+
fetchFromGitHub,
+
+
# required for completion and cross-complilation
+
installShellFiles,
+
buildPackages,
+
stdenv,
+
+
# required for testing
+
testers,
+
fulcio,
+
}:
buildGoModule rec {
pname = "fulcio";
+
version = "1.6.5";
src = fetchFromGitHub {
owner = "sigstore";
repo = pname;
rev = "v${version}";
+
hash = "sha256-TCWZrTqNXTcTsLqTnwnJPXN+kMYVVwLm2J3Y6gd2CV8=";
# populate values that require us to use git. By doing this in postFetch we
# can delete .git afterwards and maintain better reproducibility of the src.
leaveDotGit = true;
···
find "$out" -name .git -print0 | xargs -0 rm -rf
'';
};
+
vendorHash = "sha256-3E2Y0UlJMjTiM4ILEiaNqVmt4fWMvCRAqzm//CvRIl4=";
nativeBuildInputs = [ installShellFiles ];
···
preCheck = ''
# test all paths
unset subPackages
'';
+
checkFlags = [
+
"-skip=TestLoad"
+
];
+
postInstall =
+
let
+
fulcio =
+
if stdenv.buildPlatform.canExecute stdenv.hostPlatform then
+
placeholder "out"
+
else
+
buildPackages.fulcio;
+
in
+
''
+
installShellCompletion --cmd fulcio \
+
--bash <(${fulcio}/bin/fulcio completion bash) \
+
--fish <(${fulcio}/bin/fulcio completion fish) \
+
--zsh <(${fulcio}/bin/fulcio completion zsh)
+
'';
+
+
passthru.tests.version = testers.testVersion {
+
package = fulcio;
+
command = "fulcio version";
+
version = "v${version}";
+
};
meta = with lib; {
homepage = "https://github.com/sigstore/fulcio";
···
disconnected instance.
'';
license = licenses.asl20;
+
maintainers = with maintainers; [
+
lesuisse
+
jk
+
];
};
}
-34
pkgs/tools/security/jd-cli/default.nix
···
-
{ lib, fetchFromGitHub, jre, makeWrapper, maven }:
-
-
maven.buildMavenPackage rec {
-
pname = "jd-cli";
-
version = "1.2.1";
-
-
src = fetchFromGitHub {
-
owner = "intoolswetrust";
-
repo = pname;
-
rev = "${pname}-${version}";
-
hash = "sha256-rRttA5H0A0c44loBzbKH7Waoted3IsOgxGCD2VM0U/Q=";
-
};
-
-
mvnHash = "sha256-lEcAq0H8Uacv02ItjVGfxvtRip5206HtpREBrQDzBDo=";
-
-
mvnParameters = "-DskipTests";
-
-
nativeBuildInputs = [ makeWrapper ];
-
-
installPhase = ''
-
mkdir -p $out/bin $out/share/jd-cli
-
install -Dm644 jd-cli/target/jd-cli.jar $out/share/jd-cli
-
-
makeWrapper ${jre}/bin/java $out/bin/jd-cli \
-
--add-flags "-jar $out/share/jd-cli/jd-cli.jar"
-
'';
-
-
meta = with lib; {
-
description = "Simple command line wrapper around JD Core Java Decompiler project";
-
homepage = "https://github.com/intoolswetrust/jd-cli";
-
license = licenses.gpl3;
-
maintainers = with maintainers; [ majiir ];
-
};
-
}
···
-96
pkgs/tools/security/jd-gui/default.nix
···
-
{ lib
-
, stdenv
-
, fetchFromGitHub
-
, fetchpatch
-
, jre
-
, jdk
-
, gradle_6
-
, makeDesktopItem
-
, copyDesktopItems
-
, runtimeShell
-
}:
-
-
let
-
pname = "jd-gui";
-
version = "1.6.6";
-
-
name = "${pname}-${version}";
-
-
src = fetchFromGitHub {
-
owner = "java-decompiler";
-
repo = pname;
-
rev = "v${version}";
-
hash = "sha256-QHiZPYFwDQzbXVSuhwzQqBRXlkG9QVU+Jl6SKvBoCwQ=";
-
};
-
-
gradle = gradle_6;
-
-
desktopItem = makeDesktopItem {
-
name = "jd-gui";
-
exec = "jd-gui %F";
-
icon = "jd-gui";
-
comment = "Java Decompiler JD-GUI";
-
desktopName = "JD-GUI";
-
genericName = "Java Decompiler";
-
mimeTypes = [ "application/java" "application/java-vm" "application/java-archive" ];
-
categories = [ "Development" "Debugger" ];
-
startupWMClass = "org-jd-gui-App";
-
};
-
-
in stdenv.mkDerivation rec {
-
inherit pname version src;
-
-
patches = [
-
# https://github.com/java-decompiler/jd-gui/pull/362
-
(fetchpatch {
-
name = "nebula-plugin-gradle-6-compatibility.patch";
-
url = "https://github.com/java-decompiler/jd-gui/commit/91f805f9dc8ce0097460e63c8095ccea870687e6.patch";
-
hash = "sha256-9eaM9Mx2FaKIhGSOHjATKN/CrtvJeXyrH8Mdx8LNtpE=";
-
})
-
];
-
-
nativeBuildInputs = [ jdk gradle copyDesktopItems ];
-
-
mitmCache = gradle.fetchDeps {
-
inherit pname;
-
data = ./deps.json;
-
};
-
-
__darwinAllowLocalNetworking = true;
-
-
gradleBuildTask = "jar";
-
-
installPhase = let
-
jar = "$out/share/jd-gui/${name}.jar";
-
in ''
-
runHook preInstall
-
-
mkdir -p $out/bin $out/share/{jd-gui,icons/hicolor/128x128/apps}
-
cp build/libs/${name}.jar ${jar}
-
cp src/linux/resources/jd_icon_128.png $out/share/icons/hicolor/128x128/apps/jd-gui.png
-
-
cat > $out/bin/jd-gui <<EOF
-
#!${runtimeShell}
-
export JAVA_HOME=${jre}
-
exec ${jre}/bin/java -jar ${jar} "\$@"
-
EOF
-
chmod +x $out/bin/jd-gui
-
-
runHook postInstall
-
'';
-
-
desktopItems = [ desktopItem ];
-
-
meta = with lib; {
-
description = "Fast Java Decompiler with powerful GUI";
-
mainProgram = "jd-gui";
-
homepage = "https://java-decompiler.github.io/";
-
sourceProvenance = with sourceTypes; [
-
fromSource
-
binaryBytecode # deps
-
];
-
license = licenses.gpl3;
-
platforms = platforms.unix;
-
maintainers = [ maintainers.thoughtpolice ];
-
};
-
}
···
-210
pkgs/tools/security/jd-gui/deps.json
···
-
{
-
"!comment": "This is a nixpkgs Gradle dependency lockfile. For more details, refer to the Gradle section in the nixpkgs manual.",
-
"!version": 1,
-
"https://jcenter.bintray.com": {
-
"com/bmuschko#gradle-docker-plugin/3.2.1": {
-
"jar": "sha256-BfgdS5EdMR7nrEhJ6/eLMD4HdDQY1OiaVZVCK/OAIxQ=",
-
"pom": "sha256-slOHkvEGJnUa9sjeAgdH/1E4kntOKfL69KjtOsFKzSE="
-
},
-
"com/fifesoft#rsyntaxtextarea/3.0.4": {
-
"jar": "sha256-76a7i/iJ6WnAwIGQ5AsolZbqDO3sA/7yNwGAdcsBSQU=",
-
"pom": "sha256-Dat8ku0cJsdYs0EjYsDXjQy4v2RB2i5q4FqGPAO3W64="
-
},
-
"com/netflix/nebula#gradle-ospackage-plugin/8.5.6": {
-
"jar": "sha256-sQK7oYx9F4OlcSgZj6/vNYr+/nIVufi783YpFCjvkGk=",
-
"module": "sha256-CQGrawL62gDjdBsDaCwdRtgDDQQ0aexWDIrl8jrwsYw=",
-
"pom": "sha256-zr2oKXDuN6bO9Ppzs81hOR+zFWseT5si55TrZ1yUdfs="
-
},
-
"com/thoughtworks/xstream#xstream-parent/1.4.10": {
-
"pom": "sha256-RncMfpQQkzv62s69yR5ekLAjxhoako27hXa2kh2DBsw="
-
},
-
"com/thoughtworks/xstream#xstream/1.4.10": {
-
"jar": "sha256-oVh/NfphdRNgfIbsnm5N5euKzfmjptf3RY+KjECwCFg=",
-
"pom": "sha256-pKn/aI9xPaPqwEQS5QoMml4XPmkh/kRt2wfUkB2aNBc="
-
},
-
"com/yuvimasory#orange-extensions/1.3.0": {
-
"jar": "sha256-M1gGPRjFV56evw/eRWQOqy1FJ9HummKDyTZ5zqRG3YY=",
-
"pom": "sha256-MBQbN96epg6iqwnPBCVAc4hHqKG8A1o7a9A2OsMvV7I="
-
},
-
"commons-beanutils#commons-beanutils/1.7.0": {
-
"jar": "sha256-JLyqIMy9x8hWzgwK6hRFZpQ0A+Lp8nvZd5zaHXaCPvQ=",
-
"pom": "sha256-tqymRloosCdobwJdV3AvkK0NEo4U0c/OygvYcfAIStk="
-
},
-
"commons-io#commons-io/2.6": {
-
"jar": "sha256-+HfTBGYKwqFC84ZbrfyXHex+1zx0fH+NXS9ROcpzZRM=",
-
"pom": "sha256-DCOGOJOiKR9aev29jRWSOzlIr9h+Vj+jQc3Pbq4zimA="
-
},
-
"commons-logging#commons-logging/1.2": {
-
"jar": "sha256-2t3qHqC+D1aXirMAa4rJKDSv7vvZt+TmMW/KV98PpjY=",
-
"pom": "sha256-yRq1qlcNhvb9B8wVjsa8LFAIBAKXLukXn+JBAHOfuyA="
-
},
-
"edu/sc/seis/gradle#launch4j/2.4.4": {
-
"jar": "sha256-Q3jZCBGaI9GKG9t0HAnL+KRhoNfFNSFo3PQHZmFC3FY=",
-
"pom": "sha256-Cfk0ecS6AgtilLVZvLVOHdRNsB+iLGDZLa0o0zHJFqs="
-
},
-
"junit#junit/4.12": {
-
"jar": "sha256-WXIfCAXiI9hLkGd4h9n/Vn3FNNfFAsqQPAwrF/BcEWo=",
-
"pom": "sha256-kPFj944/+28cetl96efrpO6iWAcUG4XW0SvmfKJUScQ="
-
},
-
"net/sf/launch4j#launch4j/3.12": {
-
"pom": "sha256-rVGWVL75ed10qYwXKlR93sPNhWSAORnj296G05Srvpc="
-
},
-
"net/sf/launch4j#launch4j/3.12/core": {
-
"jar": "sha256-XUbxMJCI4cijjw9KV84ITUZBakNdG5OZW8OFKooysIU="
-
},
-
"net/sf/launch4j#launch4j/3.12/workdir-linux64": {
-
"jar": "sha256-XlgZsoDyUT9EfHBsXejU3OceVlxFMUv0+pv+0MXs57k="
-
},
-
"net/sf/proguard#proguard-base/6.1.0": {
-
"jar": "sha256-gdCEOhP5zuZehDy8c/Km8U/MeyfHxgEDyLxx3umFp24=",
-
"pom": "sha256-H39OO6GpBYFGL9Jn6eEWfiAcCk9h5pq1DUV/SMBQFXY="
-
},
-
"net/sf/proguard#proguard-gradle/6.1.0": {
-
"jar": "sha256-rQfrlm3lIewsMYLaYg0xpaNTTwXMjmDDlNG41EGCmvQ=",
-
"pom": "sha256-tEDYJgbG4nVImE2JcLeF8LWCJhvDhhecWS2VMKO6TzQ="
-
},
-
"net/sf/proguard#proguard-parent/6.1.0": {
-
"pom": "sha256-v7pHjLrr8KfIx139/iBxnls33nzAgA+iYjoFgOaJEXE="
-
},
-
"org/abego/treelayout#org.abego.treelayout.core/1.0.1": {
-
"jar": "sha256-grnjYxrMcIwRUhb6ePl3gNioHbt/FfjYIpGh3DqDsdA=",
-
"pom": "sha256-fIy/ymTpcEQNTyh/NRapbABpKgOU/KHVexKpepbw6hE="
-
},
-
"org/antlr#ST4/4.0.8": {
-
"jar": "sha256-WMqrxAyfdLC1mT/YaOD2SlDAdZCU5qJRqq+tmO38ejs=",
-
"pom": "sha256-PAiQ3scRdOs7o9QEyp40GQH/awQhgIsAcTsNuxMGwXw="
-
},
-
"org/antlr#antlr-master/3.5.2": {
-
"pom": "sha256-QtkaUx6lEA6wm1QaoALDuQjo8oK9c7bi9S83HvEzG9Y="
-
},
-
"org/antlr#antlr-runtime/3.5.2": {
-
"jar": "sha256-zj/I7LEPOemjzdy7LONQ0nLZzT0LHhjm/nPDuTichzQ=",
-
"pom": "sha256-RqnCIAu4sSvXEkqnpQl/9JCZkIMpyFGgTLIFFCCqfyU="
-
},
-
"org/antlr#antlr4-runtime/4.5": {
-
"jar": "sha256-tcQNVavm6kxWFPjxHoNy2YQ07TwRKNWLjuoduVWXN6s=",
-
"pom": "sha256-hRz5esL2utOZacMOx95PhBu2R1J/Rl7CDMur+yKHIpg="
-
},
-
"org/antlr#antlr4/4.5": {
-
"jar": "sha256-do7i3es2pP5kNMgFoTyVI41LZBPlL3ce0meKGEGOMNk=",
-
"pom": "sha256-4Mhs6hXMEO/K6UuvsOEADmv8xBgUK11ybNe8OyL+dwI="
-
},
-
"org/apache#apache/13": {
-
"pom": "sha256-/1E9sDYf1BI3vvR4SWi8FarkeNTsCpSW+BEHLMrzhB0="
-
},
-
"org/apache#apache/18": {
-
"pom": "sha256-eDEwcoX9R1u8NrIK4454gvEcMVOx1ZMPhS1E7ajzPBc="
-
},
-
"org/apache#apache/19": {
-
"pom": "sha256-kfejMJbqabrCy69tAf65NMrAAsSNjIz6nCQLQPHsId8="
-
},
-
"org/apache#apache/21": {
-
"pom": "sha256-rxDBCNoBTxfK+se1KytLWjocGCZfoq+XoyXZFDU3s4A="
-
},
-
"org/apache/ant#ant-launcher/1.10.6": {
-
"jar": "sha256-wDqhjaSwHJ791kGYNkvC/PL7nqWElxYVup8aCaRoUCY=",
-
"pom": "sha256-CGuKg9hhebR7pgMeuGiOlGiKAz/qmW8ttwltSLIn6KY="
-
},
-
"org/apache/ant#ant-parent/1.10.6": {
-
"pom": "sha256-n+ReOBBPxGOdqFs4WdeUqT7oMkIrx57D5zfA/QvWmiA="
-
},
-
"org/apache/ant#ant-parent/1.9.1": {
-
"pom": "sha256-kQ71Ysi7ahrZAOGY9U2pG4bQ0o3wG8Eah9tlbZBv1us="
-
},
-
"org/apache/ant#ant/1.10.6": {
-
"jar": "sha256-bFy9iMELt61iTlY3oDdbAQ9AZ/ZJfNj85wtaXxDTtBo=",
-
"pom": "sha256-AEhxs7RrtMSGoyTlA3CgnKBY72zLhOp6Ceyks/Djx1c="
-
},
-
"org/apache/ant#ant/1.9.1": {
-
"pom": "sha256-wtNC6vx3d7G97/vmCp5NeRIOvV34/PwOY7TesMcOPFQ="
-
},
-
"org/apache/commons#commons-compress/1.18": {
-
"jar": "sha256-Xy3x5GeCXkysWZbUSJDEIBwAC0PAsjz/wHgtKKC+ubA=",
-
"pom": "sha256-Zyxf6SvT6rQ+jVMzjK1coHO2Up3k6ys4hZo+qmyegRk="
-
},
-
"org/apache/commons#commons-compress/1.8": {
-
"pom": "sha256-OPhEKHDCaR2YIlGfLP+46JxwQQBQt8RsuhdqiCGeRCk="
-
},
-
"org/apache/commons#commons-lang3/3.9": {
-
"jar": "sha256-3i4dzc8++ReozoWGYaBnJqmpRPKOM61/ngi+pE3DwjA=",
-
"pom": "sha256-pAIkKbmEJbQwGBkVchJ5pS9hDzRki9rEh9TKy76N/rU="
-
},
-
"org/apache/commons#commons-parent/33": {
-
"pom": "sha256-U9ABE1Li5RBvN52vzNrHdU7G8PeCQ8AwXklp9azd+Ps="
-
},
-
"org/apache/commons#commons-parent/34": {
-
"pom": "sha256-Oi5p0G1kHR87KTEm3J4uTqZWO/jDbIfgq2+kKS0Et5w="
-
},
-
"org/apache/commons#commons-parent/42": {
-
"pom": "sha256-zTE0lMZwtIPsJWlyrxaYszDlmPgHACNU63ZUefYEsJw="
-
},
-
"org/apache/commons#commons-parent/47": {
-
"pom": "sha256-io7LVwVTv58f+uIRqNTKnuYwwXr+WSkzaPunvZtC/Lc="
-
},
-
"org/apache/commons#commons-parent/48": {
-
"pom": "sha256-Hh996TcKe3kB8Sjx2s0UIr504/R/lViw954EwGN8oLQ="
-
},
-
"org/bouncycastle#bcpg-jdk15on/1.62": {
-
"jar": "sha256-+EduQ4RO2yAOoLL7OTWVLSI/O2syOmctcxYipLkpQ+A=",
-
"pom": "sha256-372CfVICQmFhq7AdlCOOakMDsvzWkp5sUpWPjW3wciY="
-
},
-
"org/bouncycastle#bcprov-jdk15on/1.62": {
-
"jar": "sha256-L6CrcbFU2imsE0CXvGu6zZCYfdTEAFUWFZ5klNHVLqI=",
-
"pom": "sha256-cA/nligsj+84xi/Cw974WM5EmrXzwiCINjYXVth5viY="
-
},
-
"org/hamcrest#hamcrest-core/1.3": {
-
"jar": "sha256-Zv3vkelzk0jfeglqo4SlaF9Oh1WEzOiThqekclHE2Ok=",
-
"pom": "sha256-/eOGp5BRc6GxA95quCBydYS1DQ4yKC4nl3h8IKZP+pM="
-
},
-
"org/hamcrest#hamcrest-parent/1.3": {
-
"pom": "sha256-bVNflO+2Y722gsnyelAzU5RogAlkK6epZ3UEvBvkEps="
-
},
-
"org/jd#jd-core/1.1.3": {
-
"jar": "sha256-M/YP91x33AiQXnZ2lKOPe2q3kr0uWDH0HitWNUu4Bvs=",
-
"pom": "sha256-n1Gs7cjKfNmu9LZ3nbLdOkFqcILMtO8Z67VHfBHG6wQ="
-
},
-
"org/ow2#ow2/1.5": {
-
"pom": "sha256-D4obEW52C4/mOJxRuE5LB6cPwRCC1Pk25FO1g91QtDs="
-
},
-
"org/ow2/asm#asm/7.1": {
-
"jar": "sha256-SrL6K20sycyx6qBeoynEB7R7E+0pFfYvjEuMyWJY1N4=",
-
"pom": "sha256-Dyl0Lq2mWIpGxnn0maZ1Xks5OXZwBPK9nAIBnP0dMYA="
-
},
-
"org/redline-rpm#redline/1.2.9": {
-
"jar": "sha256-zEe5s3Tr9DoPAmv4amdL9uNqVr04lqyIEcUIPTW79OE=",
-
"pom": "sha256-k94nVXykHsKx/LMHxAhtdDtYdig/41FRUi8oaJjmfGw="
-
},
-
"org/slf4j#slf4j-api/1.7.5": {
-
"jar": "sha256-/jCCUkXSM2yFncONYMD8XzZo2/Kc1YaCjStWZ+w1W5E=",
-
"pom": "sha256-r6+OdAGbIw0/Vv3XyT+xBwwNyjTz0tWrXeqfxha9XKQ="
-
},
-
"org/slf4j#slf4j-parent/1.7.5": {
-
"pom": "sha256-xDvFoCLb/Z3oK+Iy3/5GIIy8feEsFDhbXagk4zHlNbs="
-
},
-
"org/sonatype/oss#oss-parent/7": {
-
"pom": "sha256-tR+IZ8kranIkmVV/w6H96ne9+e9XRyL+kM5DailVlFQ="
-
},
-
"org/sonatype/oss#oss-parent/9": {
-
"pom": "sha256-+0AmX5glSCEv+C42LllzKyGH7G8NgBgohcFO8fmCgno="
-
},
-
"org/tukaani#xz/1.4": {
-
"pom": "sha256-/kqLT1R/okQ0L7r0pOgPDEg3HYXMQBtYUViRKENiWJI="
-
},
-
"org/tukaani#xz/1.8": {
-
"jar": "sha256-jHlks2/j8MvmRLBPy/+E5JHOgZF9svW/oMuo6VSK/10=",
-
"pom": "sha256-8p51y4jrSsv35apcCe1V6sLLrmAdY6nzdSMfRUUsEBM="
-
},
-
"org/vafer#jdeb/1.8": {
-
"jar": "sha256-N0/gKgkxTabsghngBVmOdgMjoavktxXMM84+KpvNqTI=",
-
"pom": "sha256-MQdFSRqXEzi0XcwhFMRt6GWvNOWLI96d2JJfEGFewBY="
-
},
-
"xmlpull#xmlpull/1.1.3.1": {
-
"jar": "sha256-NOCO5iEWBxy7acDtcNFaelsgjWJ5jFnyEgu4kpMky2M=",
-
"pom": "sha256-jxD/2N8NPpgZyMyEAnCcaySLxTqVTvbkVHDZrjpXNfs="
-
},
-
"xpp3#xpp3_min/1.1.4c": {
-
"jar": "sha256-v8kOnjLQ6rHzl/uXS18VCoFRiDgqxB83KnFJ1bwXgAg=",
-
"pom": "sha256-tbRqwMCdpBsE28dTRWtIkShWp/+7FJBnaRC1EMRx0T8="
-
}
-
}
-
}
···
+5
pkgs/top-level/aliases.nix
···
gnuradio3_9Minimal = throw "gnuradio3_9Minimal has been removed because it is not compatible with the latest volk and it had no dependent packages which justified it's distribution"; # Added 2024-07-28
gnuradio3_9Packages = throw "gnuradio3_9Minimal has been removed because it is not compatible with the latest volk and it had no dependent packages which justified it's distribution"; # Added 2024-07-28
gobby5 = throw "'gobby5' has been renamed to/replaced by 'gobby'"; # Converted to throw 2024-10-17
#godot
···
jami-client-qt = jami-client; # Added 2022-11-06
jami-client = jami; # Added 2023-02-10
jami-daemon = jami.daemon; # Added 2023-02-10
jsawk = throw "'jsawk' has been removed because it is unmaintained upstream"; # Added 2028-08-07
# Julia
···
prometheus-dovecot-exporter = dovecot_exporter; # Added 2024-06-10
prometheus-openldap-exporter = throw "'prometheus-openldap-exporter' has been removed from nixpkgs, as it was unmaintained"; # Added 2024-09-01
prometheus-minio-exporter = throw "'prometheus-minio-exporter' has been removed from nixpkgs, use Minio's built-in Prometheus integration instead"; # Added 2024-06-10
protobuf3_24 = protobuf_24;
protobuf3_23 = protobuf_23;
protobuf3_21 = protobuf_21;
···
gnuradio3_9Minimal = throw "gnuradio3_9Minimal has been removed because it is not compatible with the latest volk and it had no dependent packages which justified it's distribution"; # Added 2024-07-28
gnuradio3_9Packages = throw "gnuradio3_9Minimal has been removed because it is not compatible with the latest volk and it had no dependent packages which justified it's distribution"; # Added 2024-07-28
gobby5 = throw "'gobby5' has been renamed to/replaced by 'gobby'"; # Converted to throw 2024-10-17
+
gradle_6 = throw "Gradle 6 has been removed, as it is end-of-life (https://endoflife.date/gradle) and has many vulnerabilities that are not resolved until Gradle 7."; # Added 2024-10-30
+
gradle_6-unwrapped = throw "Gradle 6 has been removed, as it is end-of-life (https://endoflife.date/gradle) and has many vulnerabilities that are not resolved until Gradle 7."; # Added 2024-10-30
#godot
···
jami-client-qt = jami-client; # Added 2022-11-06
jami-client = jami; # Added 2023-02-10
jami-daemon = jami.daemon; # Added 2023-02-10
+
jd-cli = throw "jd-cli has been removed due to upstream being unmaintained since 2019. Other Java decompilers in Nixpkgs include bytecode-viewer (GUI), cfr (CLI), and procyon (CLI)."; # Added 2024-10-30
+
jd-gui = throw "jd-gui has been removed due to a dependency on the dead JCenter Bintray. Other Java decompilers in Nixpkgs include bytecode-viewer (GUI), cfr (CLI), and procyon (CLI)."; # Added 2024-10-30
jsawk = throw "'jsawk' has been removed because it is unmaintained upstream"; # Added 2028-08-07
# Julia
···
prometheus-dovecot-exporter = dovecot_exporter; # Added 2024-06-10
prometheus-openldap-exporter = throw "'prometheus-openldap-exporter' has been removed from nixpkgs, as it was unmaintained"; # Added 2024-09-01
prometheus-minio-exporter = throw "'prometheus-minio-exporter' has been removed from nixpkgs, use Minio's built-in Prometheus integration instead"; # Added 2024-06-10
+
prometheus-tor-exporter = throw "'prometheus-tor-exporter' has been removed from nixpkgs, as it was broken and unmaintained"; # Added 2024-10-30
protobuf3_24 = protobuf_24;
protobuf3_23 = protobuf_23;
protobuf3_21 = protobuf_21;
+1 -20
pkgs/top-level/all-packages.nix
···
hexio = callPackage ../development/tools/hexio { };
-
hexyl = callPackage ../tools/misc/hexyl { };
-
hid-listen = callPackage ../tools/misc/hid-listen { };
hid-tools = callPackage ../tools/misc/hid-tools { };
···
fswebcam = callPackage ../os-specific/linux/fswebcam { };
-
fulcio = callPackage ../tools/security/fulcio { };
-
fuseiso = callPackage ../tools/filesystems/fuseiso { };
fdbPackages = dontRecurseIntoAttrs (callPackage ../servers/foundationdb { });
···
jazzy = callPackage ../development/tools/jazzy { };
jc = with python3Packages; toPythonApplication jc;
-
-
jd-cli = callPackage ../tools/security/jd-cli { };
jd-diff-patch = callPackage ../development/tools/jd-diff-patch { };
-
jd-gui = callPackage ../tools/security/jd-gui { };
-
jdiskreport = callPackage ../tools/misc/jdiskreport { };
jekyll = callPackage ../applications/misc/jekyll { };
···
gradleGen = gradle-packages.gen;
wrapGradle = callPackage gradle-packages.wrapGradle { };
-
gradle_6-unwrapped = callPackage gradle-packages.gradle_6 { };
gradle_7-unwrapped = callPackage gradle-packages.gradle_7 { };
gradle_8-unwrapped = callPackage gradle-packages.gradle_8 { };
gradle-unwrapped = gradle_8-unwrapped;
-
gradle_6 = wrapGradle gradle_6-unwrapped null;
gradle_7 = wrapGradle gradle_7-unwrapped null;
gradle_8 = wrapGradle gradle_8-unwrapped null;
gradle = wrapGradle gradle-unwrapped "gradle-unwrapped";
···
prometheus-surfboard-exporter = callPackage ../servers/monitoring/prometheus/surfboard-exporter.nix { };
prometheus-sql-exporter = callPackage ../servers/monitoring/prometheus/sql-exporter.nix { };
prometheus-systemd-exporter = callPackage ../servers/monitoring/prometheus/systemd-exporter.nix { };
-
prometheus-tor-exporter = callPackage ../servers/monitoring/prometheus/tor-exporter.nix { };
prometheus-unbound-exporter = callPackage ../servers/monitoring/prometheus/unbound-exporter.nix { };
prometheus-v2ray-exporter = callPackage ../servers/monitoring/prometheus/v2ray-exporter.nix { };
prometheus-varnish-exporter = callPackage ../servers/monitoring/prometheus/varnish-exporter.nix { };
···
super-slicer-latest = super-slicer.latest;
-
bambu-studio = callPackage ../applications/misc/bambu-studio {
-
inherit (gst_all_1) gstreamer gst-plugins-base gst-plugins-bad gst-plugins-good;
-
-
wxGTK31 = wxGTK31.override {
-
withCurl = true;
-
withPrivateFonts = true;
-
withWebKit = true;
-
};
-
};
orca-slicer = callPackage ../applications/misc/bambu-studio/orca-slicer.nix {};
···
hexio = callPackage ../development/tools/hexio { };
hid-listen = callPackage ../tools/misc/hid-listen { };
hid-tools = callPackage ../tools/misc/hid-tools { };
···
fswebcam = callPackage ../os-specific/linux/fswebcam { };
fuseiso = callPackage ../tools/filesystems/fuseiso { };
fdbPackages = dontRecurseIntoAttrs (callPackage ../servers/foundationdb { });
···
jazzy = callPackage ../development/tools/jazzy { };
jc = with python3Packages; toPythonApplication jc;
jd-diff-patch = callPackage ../development/tools/jd-diff-patch { };
jdiskreport = callPackage ../tools/misc/jdiskreport { };
jekyll = callPackage ../applications/misc/jekyll { };
···
gradleGen = gradle-packages.gen;
wrapGradle = callPackage gradle-packages.wrapGradle { };
gradle_7-unwrapped = callPackage gradle-packages.gradle_7 { };
gradle_8-unwrapped = callPackage gradle-packages.gradle_8 { };
gradle-unwrapped = gradle_8-unwrapped;
gradle_7 = wrapGradle gradle_7-unwrapped null;
gradle_8 = wrapGradle gradle_8-unwrapped null;
gradle = wrapGradle gradle-unwrapped "gradle-unwrapped";
···
prometheus-surfboard-exporter = callPackage ../servers/monitoring/prometheus/surfboard-exporter.nix { };
prometheus-sql-exporter = callPackage ../servers/monitoring/prometheus/sql-exporter.nix { };
prometheus-systemd-exporter = callPackage ../servers/monitoring/prometheus/systemd-exporter.nix { };
prometheus-unbound-exporter = callPackage ../servers/monitoring/prometheus/unbound-exporter.nix { };
prometheus-v2ray-exporter = callPackage ../servers/monitoring/prometheus/v2ray-exporter.nix { };
prometheus-varnish-exporter = callPackage ../servers/monitoring/prometheus/varnish-exporter.nix { };
···
super-slicer-latest = super-slicer.latest;
+
bambu-studio = callPackage ../applications/misc/bambu-studio { };
orca-slicer = callPackage ../applications/misc/bambu-studio/orca-slicer.nix {};
+8
pkgs/top-level/python-packages.nix
···
automate-home = callPackage ../development/python-modules/automate-home { };
automx2 = callPackage ../development/python-modules/automx2 { };
autopage = callPackage ../development/python-modules/autopage { };
···
gntp = callPackage ../development/python-modules/gntp { };
gnureadline = callPackage ../development/python-modules/gnureadline { };
goalzero = callPackage ../development/python-modules/goalzero { };
···
sphinx-jupyterbook-latex = callPackage ../development/python-modules/sphinx-jupyterbook-latex { };
sphinx-multitoc-numbering = callPackage ../development/python-modules/sphinx-multitoc-numbering { };
sphinx-notfound-page = callPackage ../development/python-modules/sphinx-notfound-page { };
···
weblate-schemas = callPackage ../development/python-modules/weblate-schemas { };
webob = callPackage ../development/python-modules/webob { };
webrtc-noise-gain = callPackage ../development/python-modules/webrtc-noise-gain { };
···
automate-home = callPackage ../development/python-modules/automate-home { };
+
automower-ble = callPackage ../development/python-modules/automower-ble { };
+
automx2 = callPackage ../development/python-modules/automx2 { };
autopage = callPackage ../development/python-modules/autopage { };
···
gntp = callPackage ../development/python-modules/gntp { };
gnureadline = callPackage ../development/python-modules/gnureadline { };
+
+
go2rtc-client = callPackage ../development/python-modules/go2rtc-client { };
goalzero = callPackage ../development/python-modules/goalzero { };
···
sphinx-jupyterbook-latex = callPackage ../development/python-modules/sphinx-jupyterbook-latex { };
+
sphinx-lv2-theme = callPackage ../development/python-modules/sphinx-lv2-theme { };
+
sphinx-multitoc-numbering = callPackage ../development/python-modules/sphinx-multitoc-numbering { };
sphinx-notfound-page = callPackage ../development/python-modules/sphinx-notfound-page { };
···
weblate-schemas = callPackage ../development/python-modules/weblate-schemas { };
webob = callPackage ../development/python-modules/webob { };
+
+
webrtc-models = callPackage ../development/python-modules/webrtc-models { };
webrtc-noise-gain = callPackage ../development/python-modules/webrtc-noise-gain { };