From be0cfacc2ed3db4ed50b43e9bd7f00e4c03c6e52 Mon Sep 17 00:00:00 2001 From: DataHearth Date: Sun, 28 Apr 2024 01:01:37 +0200 Subject: [PATCH 01/20] maintainers: update datahearth fingerprints --- maintainers/maintainer-list.nix | 11 +- pkgs/development/web/insomnia/default.nix | 155 +++++++++------------- 2 files changed, 74 insertions(+), 92 deletions(-) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index ff48ec64b1ed..9a27f15139dc 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -4505,9 +4505,14 @@ github = "DataHearth"; githubId = 28595242; name = "DataHearth"; - keys = [{ - fingerprint = "A129 2547 0298 BFEE 7EE0 92B3 946E 2D0C 410C 7B3D"; - }]; + keys = [ + { + fingerprint = "A129 2547 0298 BFEE 7EE0 92B3 946E 2D0C 410C 7B3D"; + } + { + fingerprint = "FFC4 92C1 5320 B05D 0F8D 7D58 ABF6 737C 6339 6D35"; + } + ]; }; davegallant = { name = "Dave Gallant"; diff --git a/pkgs/development/web/insomnia/default.nix b/pkgs/development/web/insomnia/default.nix index 0d9b0e422b50..29c5e7ffd65d 100644 --- a/pkgs/development/web/insomnia/default.nix +++ b/pkgs/development/web/insomnia/default.nix @@ -1,100 +1,77 @@ -{ lib, stdenv, makeWrapper, fetchurl, dpkg, alsa-lib, atk, cairo, cups, dbus, expat -, fontconfig, freetype, gdk-pixbuf, glib, pango, mesa, nspr, nss, gtk3 -, at-spi2-atk, gsettings-desktop-schemas, gobject-introspection, wrapGAppsHook3 -, libX11, libXScrnSaver, libXcomposite, libXcursor, libXdamage, libXext -, libXfixes, libXi, libXrandr, libXrender, libXtst, libxcb, libxshmfence, nghttp2 -, libudev0-shim, glibc, curl, openssl, autoPatchelfHook }: - +{ + lib, + stdenv, + fetchurl, + appimageTools +}: let - runtimeLibs = lib.makeLibraryPath [ - curl - glibc - libudev0-shim - nghttp2 - openssl - stdenv.cc.cc.lib - ]; -in stdenv.mkDerivation rec { pname = "insomnia"; version = "8.6.1"; src = fetchurl { - url = "https://github.com/Kong/insomnia/releases/download/core%40${version}/Insomnia.Core-${version}.deb"; - hash = "sha256-qy2j6kdmtDgfTab8gTz7eb/uNKwtzbxcoJHNibVa35c="; - }; - - nativeBuildInputs = [ - autoPatchelfHook - dpkg - makeWrapper - gobject-introspection - wrapGAppsHook3 - ]; - - buildInputs = [ - alsa-lib - at-spi2-atk - atk - cairo - cups - dbus - expat - fontconfig - freetype - gdk-pixbuf - glib - pango - gtk3 - gsettings-desktop-schemas - libX11 - libXScrnSaver - libXcomposite - libXcursor - libXdamage - libXext - libXfixes - libXi - libXrandr - libXrender - libXtst - libxcb - libxshmfence - mesa # for libgbm - nspr - nss - ]; - - dontBuild = true; - dontConfigure = true; - dontWrapGApps = true; - - unpackPhase = "dpkg-deb -x $src ."; - - installPhase = '' - mkdir -p $out/share/insomnia $out/lib $out/bin - - mv usr/share/* $out/share/ - mv opt/Insomnia/* $out/share/insomnia - - ln -s $out/share/insomnia/insomnia $out/bin/insomnia - sed -i 's|\/opt\/Insomnia|'$out'/bin|g' $out/share/applications/insomnia.desktop - ''; - - preFixup = '' - wrapProgramShell "$out/bin/insomnia" \ - "''${gappsWrapperArgs[@]}" \ - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland --enable-features=WaylandWindowDecorations}}" \ - --prefix LD_LIBRARY_PATH : ${runtimeLibs} - ''; + x86_64-darwin = { + url = "https://github.com/Kong/insomnia/releases/download/core%40${version}/Insomnia.Core-${version}.dmg"; + hash = "sha256-4Y6e5cQ9J0enp2teXVNCvrjbhH130op45BVxZxA74JE"; + }; + x86_64-linux = { + url = "https://github.com/Kong/insomnia/releases/download/core%40${version}/Insomnia.Core-${version}.AppImage"; + hash = lib.fakeHash; + }; + }.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}"); meta = with lib; { - homepage = "https://insomnia.rest/"; - description = "The most intuitive cross-platform REST API Client"; + homepage = "https://insomnia.rest"; + description = " The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage. "; mainProgram = "insomnia"; - sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; - license = licenses.mit; - platforms = [ "x86_64-linux" ]; - maintainers = with maintainers; [ markus1189 babariviere kashw2 ]; + changelog = "https://github.com/Kong/insomnia/releases/tag/core@${version}"; + license = licenses.asl20; + platforms = [ "x86_64-linux" "x86_64-darwin" ]; + maintainers = with maintainers; [ markus1189 babariviere kashw2 DataHearth ]; }; +in +if stdenv.isDarwin then stdenv.mkDerivation { + inherit pname version src meta; + sourceRoot = "."; + unpackCmd = '' + echo "Creating temp directory" + mnt=$(TMPDIR=/tmp mktemp -d -t nix-XXXXXXXXXX) + function finish { + echo "Ejecting temp directory" + /usr/bin/hdiutil detach $mnt -force + rm -rf $mnt + } + # Detach volume when receiving SIG "0" + trap finish EXIT + # Mount DMG file + echo "Mounting DMG file into \"$mnt\"" + /usr/bin/hdiutil attach -nobrowse -mountpoint $mnt $curSrc + # Copy content to local dir for later use + echo 'Copying extracted content into "sourceRoot"' + cp -a $mnt/Insomnia.app $PWD/ + ''; + + installPhase = '' + runHook preInstall + mkdir -p "$out/Applications" + mv Insomnia.app $out/Applications/ + runHook postInstall + ''; +} else { + inherit pname version src meta; + + extraInstallCommands = let + appimageContents = appimageTools.extract { + inherit pname version src; + }; + in '' + # Replace version from binary name + mv $out/bin/${pname}-${version} $out/bin/${pname} + # Install XDG Desktop file and its icon + install -Dm444 ${appimageContents}/insomnia.desktop -t $out/share/applications + install -Dm444 ${appimageContents}/insomnia.png -t $out/share/pixmaps + # Replace wrong exec statement in XDG Desktop file + substituteInPlace $out/share/applications/insomnia.desktop \ + --replace 'Exec=AppRun --no-sandbox %U' 'Exec=insomnia' + ''; } From aac727eef0ffb6c5db016a1c00a4dbbf937bf0ca Mon Sep 17 00:00:00 2001 From: DataHearth Date: Mon, 29 Apr 2024 00:11:44 +0200 Subject: [PATCH 02/20] insomnia: 8.6.1 -> 9.0.0 --- pkgs/development/web/insomnia/default.nix | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkgs/development/web/insomnia/default.nix b/pkgs/development/web/insomnia/default.nix index 29c5e7ffd65d..d46a098e89f9 100644 --- a/pkgs/development/web/insomnia/default.nix +++ b/pkgs/development/web/insomnia/default.nix @@ -6,16 +6,16 @@ }: let pname = "insomnia"; - version = "8.6.1"; + version = "9.0.0"; src = fetchurl { x86_64-darwin = { url = "https://github.com/Kong/insomnia/releases/download/core%40${version}/Insomnia.Core-${version}.dmg"; - hash = "sha256-4Y6e5cQ9J0enp2teXVNCvrjbhH130op45BVxZxA74JE"; + hash = "sha256-QIArPdThQcNTUgrXpWP8JHaZfrZ/6ztekIvzFdoWjsY="; }; x86_64-linux = { url = "https://github.com/Kong/insomnia/releases/download/core%40${version}/Insomnia.Core-${version}.AppImage"; - hash = lib.fakeHash; + hash = "sha256-2UiqopYmNxnDcIqQMn/H89ugvOtTWkHH4LrmKkQErSs="; }; }.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}"); @@ -57,7 +57,7 @@ if stdenv.isDarwin then stdenv.mkDerivation { mv Insomnia.app $out/Applications/ runHook postInstall ''; -} else { +} else appimageTools.wrapType2 { inherit pname version src meta; extraInstallCommands = let @@ -65,13 +65,11 @@ if stdenv.isDarwin then stdenv.mkDerivation { inherit pname version src; }; in '' - # Replace version from binary name - mv $out/bin/${pname}-${version} $out/bin/${pname} # Install XDG Desktop file and its icon install -Dm444 ${appimageContents}/insomnia.desktop -t $out/share/applications install -Dm444 ${appimageContents}/insomnia.png -t $out/share/pixmaps # Replace wrong exec statement in XDG Desktop file substituteInPlace $out/share/applications/insomnia.desktop \ - --replace 'Exec=AppRun --no-sandbox %U' 'Exec=insomnia' + --replace-fail 'Exec=AppRun --no-sandbox %U' 'Exec=insomnia' ''; } From 35d05033a839943cf22de44b341278bbde4de2e7 Mon Sep 17 00:00:00 2001 From: uncenter <47499684+uncenter@users.noreply.github.com> Date: Sun, 12 May 2024 13:04:04 -0400 Subject: [PATCH 03/20] spicetify-cli: rename bin --- pkgs/by-name/sp/spicetify-cli/package.nix | 24 +++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/sp/spicetify-cli/package.nix b/pkgs/by-name/sp/spicetify-cli/package.nix index 13d1b8aceedb..cd53385ca60a 100644 --- a/pkgs/by-name/sp/spicetify-cli/package.nix +++ b/pkgs/by-name/sp/spicetify-cli/package.nix @@ -1,4 +1,10 @@ -{ lib, buildGoModule, fetchFromGitHub, testers, spicetify-cli }: +{ + lib, + buildGoModule, + fetchFromGitHub, + testers, + spicetify-cli, +}: buildGoModule rec { pname = "spicetify-cli"; @@ -20,6 +26,8 @@ buildGoModule rec { # used at runtime, but not installed by default postInstall = '' + mv $out/bin/spicetify-cli $out/bin/spicetify + ln -s $out/bin/spicetify $out/bin/spicetify-cli cp -r ${src}/jsHelper $out/bin/jsHelper cp -r ${src}/CustomApps $out/bin/CustomApps cp -r ${src}/Extensions $out/bin/Extensions @@ -28,19 +36,19 @@ buildGoModule rec { doInstallCheck = true; installCheckPhase = '' - $out/bin/spicetify-cli --help > /dev/null + $out/bin/spicetify --help > /dev/null ''; - passthru.tests.version = testers.testVersion { - package = spicetify-cli; - command = "spicetify-cli -v"; - }; + passthru.tests.version = testers.testVersion { package = spicetify-cli; }; meta = with lib; { description = "Command-line tool to customize Spotify client"; homepage = "https://github.com/spicetify/spicetify-cli/"; license = licenses.gpl3Plus; - maintainers = with maintainers; [ jonringer mdarocha ]; - mainProgram = "spicetify-cli"; + maintainers = with maintainers; [ + jonringer + mdarocha + ]; + mainProgram = "spicetify"; }; } From 46e2173897aa518b8f5bf8e58d96d167e83ebc08 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 23 May 2024 01:46:58 +0000 Subject: [PATCH 04/20] ctlptl: 0.8.28 -> 0.8.29 --- pkgs/development/tools/ctlptl/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/ctlptl/default.nix b/pkgs/development/tools/ctlptl/default.nix index 3c2abdd45497..4edc9423314d 100644 --- a/pkgs/development/tools/ctlptl/default.nix +++ b/pkgs/development/tools/ctlptl/default.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "ctlptl"; - version = "0.8.28"; + version = "0.8.29"; src = fetchFromGitHub { owner = "tilt-dev"; repo = pname; rev = "v${version}"; - hash = "sha256-GFCyFJrhl6VEnIuZNpIIYgdTHYxeBmaukpJ72xspwFM="; + hash = "sha256-4drk8mqFVGXUktPiWuVNzWVBQr4TRcutZgGsF3vpRIE="; }; - vendorHash = "sha256-DEUZbqHHYfjD5jGT5nn3UbWT1aODRsLailSorI/W6w4="; + vendorHash = "sha256-rf/4xyridcsSlGOVQ91Wr8bHnm7wfuXs6HSPKW2J8hM="; nativeBuildInputs = [ installShellFiles ]; From 67d4cea69dcbfbc8bf30e8ac2c39f6c75bbf1c05 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Thu, 23 May 2024 11:17:09 +0200 Subject: [PATCH 05/20] f3d: condition autoPatchelfHook on isElf should fix darwin --- pkgs/applications/graphics/f3d/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/applications/graphics/f3d/default.nix b/pkgs/applications/graphics/f3d/default.nix index 3b45ca987f1a..5edbd078cd01 100644 --- a/pkgs/applications/graphics/f3d/default.nix +++ b/pkgs/applications/graphics/f3d/default.nix @@ -29,6 +29,7 @@ stdenv.mkDerivation rec { cmake help2man gzip + ] ++ lib.optionals stdenv.hostPlatform.isElf [ # https://github.com/f3d-app/f3d/pull/1217 autoPatchelfHook ]; From 37070309cda1e719f65f1eff06b9128d9ba13392 Mon Sep 17 00:00:00 2001 From: Shaw Vrana Date: Thu, 23 May 2024 07:24:55 -0700 Subject: [PATCH 06/20] ctlptl: build only main executable --- pkgs/development/tools/ctlptl/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/tools/ctlptl/default.nix b/pkgs/development/tools/ctlptl/default.nix index 3c2abdd45497..c97ef2a7c2fa 100644 --- a/pkgs/development/tools/ctlptl/default.nix +++ b/pkgs/development/tools/ctlptl/default.nix @@ -15,6 +15,8 @@ buildGoModule rec { nativeBuildInputs = [ installShellFiles ]; + subPackages = [ "cmd/ctlptl" ]; + ldflags = [ "-s" "-w" From 7a15b0207775ada3fd588d3f215dd97647b4b57d Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 24 May 2024 00:14:33 +0900 Subject: [PATCH 07/20] pdm: 2.15.2 -> 2.15.3 Changelog: https://github.com/pdm-project/pdm/releases/tag/2.15.3 --- pkgs/tools/package-management/pdm/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/package-management/pdm/default.nix b/pkgs/tools/package-management/pdm/default.nix index f7e39900a98d..3eaddce9e708 100644 --- a/pkgs/tools/package-management/pdm/default.nix +++ b/pkgs/tools/package-management/pdm/default.nix @@ -11,14 +11,14 @@ with python3.pkgs; buildPythonApplication rec { pname = "pdm"; - version = "2.15.2"; + version = "2.15.3"; pyproject = true; disabled = pythonOlder "3.8"; src = fetchPypi { inherit pname version; - hash = "sha256-wI6HB4wpwA562WgdxqI0GdxWF9y+bMIFAk70tOfihHU="; + hash = "sha256-wifYH2vxCWJqVkOnu1McX1t3eoUMTqyNCLRywRRr7uU="; }; nativeBuildInputs = [ @@ -50,7 +50,6 @@ buildPythonApplication rec { unearth virtualenv ] ++ httpx.optional-dependencies.socks - ++ pbs-installer.optional-dependencies.install ++ lib.optionals (pythonOlder "3.11") [ tomli ] @@ -81,11 +80,12 @@ buildPythonApplication rec { ''; nativeCheckInputs = [ + first pytestCheckHook pytest-mock pytest-xdist pytest-httpserver - ] ++ lib.optional stdenv.isLinux first; + ]; pytestFlagsArray = [ "-m 'not network'" From dc4209a00a5e37407039e42e84e675c482ed72ad Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Thu, 23 May 2024 23:05:43 +0200 Subject: [PATCH 08/20] f3d: add withManual option, by default disabled on darwin should fix darwin --- pkgs/applications/graphics/f3d/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/graphics/f3d/default.nix b/pkgs/applications/graphics/f3d/default.nix index 5edbd078cd01..dd893ba9a976 100644 --- a/pkgs/applications/graphics/f3d/default.nix +++ b/pkgs/applications/graphics/f3d/default.nix @@ -10,13 +10,14 @@ , libGL , Cocoa , OpenGL +, withManual ? !stdenv.isDarwin }: stdenv.mkDerivation rec { pname = "f3d"; version = "2.4.0"; - outputs = [ "out" "man" ]; + outputs = [ "out" ] ++ lib.optionals withManual [ "man" ]; src = fetchFromGitHub { owner = "f3d-app"; @@ -27,6 +28,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake + ] ++ lib.optionals withManual [ + # manpage help2man gzip ] ++ lib.optionals stdenv.hostPlatform.isElf [ @@ -42,7 +45,7 @@ stdenv.mkDerivation rec { "-DCMAKE_INSTALL_LIBDIR=lib" "-DCMAKE_INSTALL_INCLUDEDIR=include" "-DCMAKE_INSTALL_BINDIR=bin" - + ] ++ lib.optionals withManual [ "-DF3D_LINUX_GENERATE_MAN=ON" ]; From c7cc3739240e11c983df6b50ba3821880766b18d Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Fri, 24 May 2024 12:12:59 +0200 Subject: [PATCH 09/20] stalwart-mail_0_6: drop --- pkgs/top-level/all-packages.nix | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8126fabe5d66..9c68db551d2d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26586,23 +26586,6 @@ with pkgs; thttpd = callPackage ../servers/http/thttpd { }; - stalwart-mail_0_6 = (stalwart-mail.override { rocksdb_8_11 = rocksdb_8_3; }).overrideAttrs (old: rec { - pname = "stalwart-mail_0_6"; - version = "0.6.0"; - src = fetchFromGitHub { - owner = "stalwartlabs"; - repo = "mail-server"; - rev = "v${version}"; - hash = "sha256-OHwUWSUW6ovLQTxnuUrolQGhxbhp4YqKSH+ZTpe2WXc="; - fetchSubmodules = true; - }; - cargoDeps = old.cargoDeps.overrideAttrs (_: { - inherit src; - name = "${pname}-${version}-vendor.tar.gz"; - outputHash = "sha256-mW3OXQj6DcIMO1YlTG3G+a1ORRcuvp5/h7BU+b4QbnE="; - }); - }); - static-web-server = callPackage ../servers/static-web-server { }; stone = callPackage ../servers/stone { }; From 2323925c24c578fc239c0cc0dce06a6a1d63cc5d Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Fri, 24 May 2024 12:13:16 +0200 Subject: [PATCH 10/20] stalwart-mail: add onny as maintainer --- pkgs/by-name/st/stalwart-mail/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/st/stalwart-mail/package.nix b/pkgs/by-name/st/stalwart-mail/package.nix index d021afe01f64..68e0d97bebb5 100644 --- a/pkgs/by-name/st/stalwart-mail/package.nix +++ b/pkgs/by-name/st/stalwart-mail/package.nix @@ -75,6 +75,6 @@ rustPlatform.buildRustPackage { homepage = "https://github.com/stalwartlabs/mail-server"; changelog = "https://github.com/stalwartlabs/mail-server/blob/${version}/CHANGELOG"; license = licenses.agpl3Only; - maintainers = with maintainers; [ happysalada ]; + maintainers = with maintainers; [ happysalada onny ]; }; } From 3d6a20f3807ea5d5d2b6bf03c7561f0d142df02a Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Fri, 24 May 2024 12:15:50 +0200 Subject: [PATCH 11/20] nixos/stalwart-mail: drop legacy package --- nixos/modules/services/mail/stalwart-mail.nix | 29 +------------------ 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/nixos/modules/services/mail/stalwart-mail.nix b/nixos/modules/services/mail/stalwart-mail.nix index 06b48c86907c..0a9e4daf29cc 100644 --- a/nixos/modules/services/mail/stalwart-mail.nix +++ b/nixos/modules/services/mail/stalwart-mail.nix @@ -7,28 +7,12 @@ let configFormat = pkgs.formats.toml { }; configFile = configFormat.generate "stalwart-mail.toml" cfg.settings; dataDir = "/var/lib/stalwart-mail"; - stalwartAtLeast = versionAtLeast cfg.package.version; in { options.services.stalwart-mail = { enable = mkEnableOption "the Stalwart all-in-one email server"; - package = mkOption { - type = types.package; - description = '' - Which package to use for the Stalwart mail server. - - ::: {.note} - Upgrading from version 0.6.0 to version 0.7.0 or higher requires manual - intervention. See - for upgrade instructions. - ::: - ''; - default = pkgs.stalwart-mail_0_6; - defaultText = lib.literalExpression "pkgs.stalwart-mail_0_6"; - example = lib.literalExpression "pkgs.stalwart-mail"; - relatedPackages = [ "stalwart-mail_0_6" "stalwart-mail" ]; - }; + package = mkPackageOption pkgs "stalwart-mail" { }; settings = mkOption { inherit (configFormat) type; @@ -44,17 +28,6 @@ in { config = mkIf cfg.enable { - warnings = lib.optionals (!stalwartAtLeast "0.7.0") [ - '' - Versions of stalwart-mail < 0.7.0 will get deprecated in NixOS 24.11. - Please set services.stalwart-mail.package to pkgs.stalwart-mail to - upgrade to the latest version. - Please note that upgrading to version >= 0.7 requires manual - intervention, see - for upgrade instructions. - '' - ]; - # Default config: all local services.stalwart-mail.settings = { global.tracing.method = mkDefault "stdout"; From dfe479c64e90019cc22b7c9dcd3f77633c1008fd Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Fri, 24 May 2024 12:20:38 +0200 Subject: [PATCH 12/20] nixos/tests/stalwart-mail: drop legacy package --- nixos/tests/stalwart-mail.nix | 227 +++++++++++++++------------------- 1 file changed, 100 insertions(+), 127 deletions(-) diff --git a/nixos/tests/stalwart-mail.nix b/nixos/tests/stalwart-mail.nix index 4075b32e2c1f..d223450d5f28 100644 --- a/nixos/tests/stalwart-mail.nix +++ b/nixos/tests/stalwart-mail.nix @@ -1,147 +1,120 @@ # Rudimentary test checking that the Stalwart email server can: # - receive some message through SMTP submission, then # - serve this message through IMAP. -{ - system ? builtins.currentSystem, - config ? { }, - pkgs ? import ../../.. { inherit system config; }, - lib ? pkgs.lib, -}: let certs = import ./common/acme/server/snakeoil-certs.nix; domain = certs.domain; - makeTest = import ./make-test-python.nix; - mkTestName = - pkg: "${pkg.pname}_${pkg.version}"; - stalwartPackages = { - inherit (pkgs) stalwart-mail_0_6 stalwart-mail; - }; - stalwartAtLeast = lib.versionAtLeast; - makeStalwartTest = - { - package, - name ? mkTestName package, - }: - makeTest { - inherit name; - meta.maintainers = with lib.maintainers; [ - happysalada pacien onny - ]; - nodes.machine = { lib, ... }: { +in import ./make-test-python.nix ({ lib, ... }: { + name = "stalwart-mail"; - security.pki.certificateFiles = [ certs.ca.cert ]; + nodes.main = { pkgs, ... }: { + security.pki.certificateFiles = [ certs.ca.cert ]; - services.stalwart-mail = { + services.stalwart-mail = { + enable = true; + settings = { + server.hostname = domain; + + certificate."snakeoil" = { + cert = "%{file:${certs.${domain}.cert}}%"; + private-key = "%{file:${certs.${domain}.key}}%"; + }; + + server.tls = { + certificate = "snakeoil"; enable = true; - inherit package; - settings = { - server.hostname = domain; + implicit = false; + }; - # TODO: Remove backwards compatibility as soon as we drop legacy version 0.6.0 - certificate."snakeoil" = let - certPath = if stalwartAtLeast package.version "0.7.0" then "%{file://${certs.${domain}.cert}}%" else "file://${certs.${domain}.cert}"; - keyPath = if stalwartAtLeast package.version "0.7.0" then "%{file:${certs.${domain}.key}}%" else "file://${certs.${domain}.key}"; - in { - cert = certPath; - private-key = keyPath; - }; + server.listener = { + "smtp-submission" = { + bind = [ "[::]:587" ]; + protocol = "smtp"; + }; - server.tls = { - certificate = "snakeoil"; - enable = true; - implicit = false; - }; - - server.listener = { - "smtp-submission" = { - bind = [ "[::]:587" ]; - protocol = "smtp"; - }; - - "imap" = { - bind = [ "[::]:143" ]; - protocol = "imap"; - }; - }; - - session.auth.mechanisms = "[plain]"; - session.auth.directory = "'in-memory'"; - storage.directory = "in-memory"; - - session.rcpt.directory = "'in-memory'"; - queue.outbound.next-hop = "'local'"; - - directory."in-memory" = { - type = "memory"; - # TODO: Remove backwards compatibility as soon as we drop legacy version 0.6.0 - principals = let - condition = if stalwartAtLeast package.version "0.7.0" then "class" else "type"; - in builtins.map (p: p // { ${condition} = "individual"; }) [ - { - name = "alice"; - secret = "foobar"; - email = [ "alice@${domain}" ]; - } - { - name = "bob"; - secret = "foobar"; - email = [ "bob@${domain}" ]; - } - ]; - }; + "imap" = { + bind = [ "[::]:143" ]; + protocol = "imap"; }; }; - environment.systemPackages = [ - (pkgs.writers.writePython3Bin "test-smtp-submission" { } '' - from smtplib import SMTP + session.auth.mechanisms = "[plain]"; + session.auth.directory = "'in-memory'"; + storage.directory = "in-memory"; - with SMTP('localhost', 587) as smtp: - smtp.starttls() - smtp.login('alice', 'foobar') - smtp.sendmail( - 'alice@${domain}', - 'bob@${domain}', - """ - From: alice@${domain} - To: bob@${domain} - Subject: Some test message - - This is a test message. - """.strip() - ) - '') - - (pkgs.writers.writePython3Bin "test-imap-read" { } '' - from imaplib import IMAP4 - - with IMAP4('localhost') as imap: - imap.starttls() - status, [caps] = imap.login('bob', 'foobar') - assert status == 'OK' - imap.select() - status, [ref] = imap.search(None, 'ALL') - assert status == 'OK' - [msgId] = ref.split() - status, msg = imap.fetch(msgId, 'BODY[TEXT]') - assert status == 'OK' - assert msg[0][1].strip() == b'This is a test message.' - '') - ]; + session.rcpt.directory = "'in-memory'"; + queue.outbound.next-hop = "'local'"; + directory."in-memory" = { + type = "memory"; + principals = [ + { + class = "individual"; + name = "alice"; + secret = "foobar"; + email = [ "alice@${domain}" ]; + } + { + class = "individual"; + name = "bob"; + secret = "foobar"; + email = [ "bob@${domain}" ]; + } + ]; + }; }; - - testScript = '' - start_all() - machine.wait_for_unit("stalwart-mail.service") - machine.wait_for_open_port(587) - machine.wait_for_open_port(143) - - machine.succeed("test-smtp-submission") - machine.succeed("test-imap-read") - ''; }; -in -lib.mapAttrs (_: package: makeStalwartTest { inherit package; }) stalwartPackages + + environment.systemPackages = [ + (pkgs.writers.writePython3Bin "test-smtp-submission" { } '' + from smtplib import SMTP + + with SMTP('localhost', 587) as smtp: + smtp.starttls() + smtp.login('alice', 'foobar') + smtp.sendmail( + 'alice@${domain}', + 'bob@${domain}', + """ + From: alice@${domain} + To: bob@${domain} + Subject: Some test message + + This is a test message. + """.strip() + ) + '') + + (pkgs.writers.writePython3Bin "test-imap-read" { } '' + from imaplib import IMAP4 + + with IMAP4('localhost') as imap: + imap.starttls() + status, [caps] = imap.login('bob', 'foobar') + assert status == 'OK' + imap.select() + status, [ref] = imap.search(None, 'ALL') + assert status == 'OK' + [msgId] = ref.split() + status, msg = imap.fetch(msgId, 'BODY[TEXT]') + assert status == 'OK' + assert msg[0][1].strip() == b'This is a test message.' + '') + ]; + }; + + testScript = /* python */ '' + main.wait_for_unit("stalwart-mail.service") + main.wait_for_open_port(587) + main.wait_for_open_port(143) + + main.succeed("test-smtp-submission") + main.succeed("test-imap-read") + ''; + + meta = { + maintainers = with lib.maintainers; [ happysalada pacien ]; + }; +}) From 3c80361f9a43bc94561156b10002ea18f7856f4d Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Fri, 24 May 2024 12:25:33 +0200 Subject: [PATCH 13/20] nixos/stalwart-mail: add release notes --- nixos/doc/manual/release-notes/rl-2411.section.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nixos/doc/manual/release-notes/rl-2411.section.md b/nixos/doc/manual/release-notes/rl-2411.section.md index 2277308d6ba2..343c1fc5933d 100644 --- a/nixos/doc/manual/release-notes/rl-2411.section.md +++ b/nixos/doc/manual/release-notes/rl-2411.section.md @@ -16,6 +16,11 @@ nvimpager settings: user commands in `-c` and `--cmd` now override the respective default settings because they are executed later. +- Legacy package `stalwart-mail_0_6` was dropped, please note the + [manual upgrade process](https://github.com/stalwartlabs/mail-server/blob/main/UPGRADING.md) + before changing the package to `pkgs.stalwart-mail` in + [`services.stalwart-mail.package`](#opt-services.stalwart-mail.package). + ## Other Notable Changes {#sec-release-24.11-notable-changes} - Create the first release note entry in this section! From 2d53258c2e973b41744d5c087acbe7e82c481b65 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Fri, 24 May 2024 12:25:54 +0200 Subject: [PATCH 14/20] nixos/tests/stalwart-mail: add onny as maintainer --- nixos/tests/stalwart-mail.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/tests/stalwart-mail.nix b/nixos/tests/stalwart-mail.nix index d223450d5f28..173b4fce4ad5 100644 --- a/nixos/tests/stalwart-mail.nix +++ b/nixos/tests/stalwart-mail.nix @@ -115,6 +115,6 @@ in import ./make-test-python.nix ({ lib, ... }: { ''; meta = { - maintainers = with lib.maintainers; [ happysalada pacien ]; + maintainers = with lib.maintainers; [ happysalada pacien onny ]; }; }) From 50388b71cc7c244b7a7dce326ba05170ad7b6acc Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Fri, 24 May 2024 12:26:13 +0200 Subject: [PATCH 15/20] nixos/stalwart-mail: add onny as maintainer --- nixos/modules/services/mail/stalwart-mail.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/mail/stalwart-mail.nix b/nixos/modules/services/mail/stalwart-mail.nix index 0a9e4daf29cc..68606698e59f 100644 --- a/nixos/modules/services/mail/stalwart-mail.nix +++ b/nixos/modules/services/mail/stalwart-mail.nix @@ -111,6 +111,6 @@ in { }; meta = { - maintainers = with maintainers; [ happysalada pacien ]; + maintainers = with maintainers; [ happysalada pacien onny ]; }; } From bc89a9f0fb67b8ffdcf4cfb2d1dc1b85a3104d83 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 24 May 2024 12:05:32 +0000 Subject: [PATCH 16/20] python311Packages.streamlit: 1.34.0 -> 1.35.0 --- pkgs/development/python-modules/streamlit/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/streamlit/default.nix b/pkgs/development/python-modules/streamlit/default.nix index 5c477b62579c..eb7dca81db64 100644 --- a/pkgs/development/python-modules/streamlit/default.nix +++ b/pkgs/development/python-modules/streamlit/default.nix @@ -34,14 +34,14 @@ buildPythonPackage rec { pname = "streamlit"; - version = "1.34.0"; + version = "1.35.0"; pyproject = true; disabled = pythonOlder "3.8"; src = fetchPypi { inherit pname version; - hash = "sha256-E1o7eaaGsxMrc/IERQrW6IneBPM0nWkpJeCfDiHnS1I="; + hash = "sha256-Z51Vu2GJdD9gar8GlmI98L/SI6bQyNlrjWBnjUiR0tY="; }; nativeBuildInputs = [ From 780eff574b1cf35cb4b8db40756a68a4287a5b9a Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 24 May 2024 12:41:45 +0000 Subject: [PATCH 17/20] cargo-mobile2: 0.11.1 -> 0.12.0 --- pkgs/development/tools/rust/cargo-mobile2/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/rust/cargo-mobile2/default.nix b/pkgs/development/tools/rust/cargo-mobile2/default.nix index 1aecd6d91973..2bcf7484fc67 100644 --- a/pkgs/development/tools/rust/cargo-mobile2/default.nix +++ b/pkgs/development/tools/rust/cargo-mobile2/default.nix @@ -12,7 +12,7 @@ let inherit (darwin.apple_sdk.frameworks) CoreServices; pname = "cargo-mobile2"; - version = "0.11.1"; + version = "0.12.0"; in rustPlatform.buildRustPackage { inherit pname version; @@ -20,14 +20,14 @@ rustPlatform.buildRustPackage { owner = "tauri-apps"; repo = pname; rev = "cargo-mobile2-v${version}"; - hash = "sha256-HLDuWEKLij1hTKxf3lrAb4d2DIHzzkj4kuiZXgQwH4Q="; + hash = "sha256-x9Vby8QTe6swJLoT6mjsqzmxv24jfnxsy5v8yC3qveU="; }; # Manually specify the sourceRoot since this crate depends on other crates in the workspace. Relevant info at # https://discourse.nixos.org/t/difficulty-using-buildrustpackage-with-a-src-containing-multiple-cargo-workspaces/10202 # sourceRoot = "${src.name}/tooling/cli"; - cargoHash = "sha256-jCsP5xhNkqnwz8HocUzzf17omU8WDNrL/WVj/lP+51w="; + cargoHash = "sha256-t0+GbN+btZyRNcSh8DfJw5NT/ntV3NmRYVHZDE9VjLo="; preBuild = '' mkdir -p $out/share/ From 835e4595569d4d9138eaa271e9a5093742c989cb Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 24 May 2024 22:45:34 +0200 Subject: [PATCH 18/20] home-assistant: 2024.5.4 -> 2024.5.5 https://github.com/home-assistant/core/releases/tag/2024.5.5 --- pkgs/servers/home-assistant/component-packages.nix | 2 +- pkgs/servers/home-assistant/default.nix | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index d9dfc59b12f1..23f17c9ad7c1 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -2,7 +2,7 @@ # Do not edit! { - version = "2024.5.4"; + version = "2024.5.5"; components = { "3_day_blinds" = ps: with ps; [ ]; diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index bb2de0881bf6..d122c85fc75e 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -550,7 +550,7 @@ let extraBuildInputs = extraPackages python.pkgs; # Don't forget to run update-component-packages.py after updating - hassVersion = "2024.5.4"; + hassVersion = "2024.5.5"; in python.pkgs.buildPythonApplication rec { pname = "homeassistant"; @@ -568,13 +568,13 @@ in python.pkgs.buildPythonApplication rec { owner = "home-assistant"; repo = "core"; rev = "refs/tags/${version}"; - hash = "sha256-YJluhc1MCRxeDtn8R9tF2QYA6qCiYpjOpRJaQeay3lk="; + hash = "sha256-WAwLir9+O82kNBAwy0hUdfVxgDb3C4sIRDcyzVxfcuM="; }; # Secondary source is pypi sdist for translations sdist = fetchPypi { inherit pname version; - hash = "sha256-e2evRFP/l2HHcDgMUWQEM7xvvAfLRwdFtz+u2mwXepI="; + hash = "sha256-kcZM+IK96/q2GXeDSJzJTbzbz5mYcHevTDLpKspII6o="; }; build-system = with python.pkgs; [ From 32d5e854a0a92fadd157eddfc18a8fddae5f0cae Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 24 May 2024 20:47:46 +0000 Subject: [PATCH 19/20] edge-runtime: 1.53.1 -> 1.53.2 --- pkgs/development/web/edge-runtime/default.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/development/web/edge-runtime/default.nix b/pkgs/development/web/edge-runtime/default.nix index dcb30c61625a..e5653777529a 100644 --- a/pkgs/development/web/edge-runtime/default.nix +++ b/pkgs/development/web/edge-runtime/default.nix @@ -11,7 +11,7 @@ let pname = "edge-runtime"; - version = "1.53.1"; + version = "1.53.2"; in rustPlatform.buildRustPackage { inherit pname version; @@ -20,13 +20,12 @@ rustPlatform.buildRustPackage { owner = "supabase"; repo = pname; rev = "v${version}"; - hash = "sha256-qEEFEeAyUOnNvxIBfAmhMDWde3OPOpyaEI2pBYrdCr0="; + hash = "sha256-CJT7q1QPpZScTo7MxCrK6dF5EvSVePMh7wgimVn6u/8="; fetchSubmodules = true; }; cargoLock = { lockFile = ./Cargo.lock; - outputHashes = { "ort-2.0.0-rc.0" = "sha256-j3g9ES2ZLmAAcPYgszBGDG16HiFJTnohwxSvXypFGTw="; }; From a3a2b3a004a3afa5d56295b5d09365a04fce3afc Mon Sep 17 00:00:00 2001 From: Raghav Sood Date: Sat, 25 May 2024 08:17:18 +0800 Subject: [PATCH 20/20] flyctl: 0.2.55 -> 0.2.58 --- pkgs/development/web/flyctl/default.nix | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pkgs/development/web/flyctl/default.nix b/pkgs/development/web/flyctl/default.nix index d085da78de3c..6ff332b5a5cd 100644 --- a/pkgs/development/web/flyctl/default.nix +++ b/pkgs/development/web/flyctl/default.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "flyctl"; - version = "0.2.55"; + version = "0.2.58"; src = fetchFromGitHub { owner = "superfly"; repo = "flyctl"; rev = "v${version}"; - hash = "sha256-yCRaF600UrDmazsgTRp/grWtkULeSQedE5m69K6h/4Q="; + hash = "sha256-aXiBDPl/x/xeu+fNrxs+JejVtSZu8KZKbrSetJj4/Pk="; }; - vendorHash = "sha256-1hlWyr41t8J4naN5QbEtfCv3npe/kvMH5NKKaxYvLYk="; + vendorHash = "sha256-NmogEh3xWQ/opMm9UarpfuH3MJzJ9+qb0KX/O+i/pcA="; subPackages = [ "." ]; @@ -34,11 +34,6 @@ buildGoModule rec { HOME=$(mktemp -d) ''; - checkFlags = [ - # these tests require network - "-skip=TestToTestMachineConfig" - ]; - # We override checkPhase to be able to test ./... while using subPackages checkPhase = '' runHook preCheck