From 6b33c9dcfb21123b0337e00bac72965e6a14ba0f Mon Sep 17 00:00:00 2001 From: Guillaume Girol Date: Thu, 23 Apr 2026 12:00:00 +0000 Subject: [PATCH] nixseparatedebuginfod2: 1.0.1 -> 2.0.0 Changelog: https://github.com/symphorien/nixseparatedebuginfod2/blob/master/CHANGELOG.md Modify the module to use systemd activation. --- .../development/nixseparatedebuginfod2.nix | 13 +++++++------ nixos/tests/nixseparatedebuginfod2.nix | 3 +-- .../ni/nixseparatedebuginfod2/package.nix | 19 ++++++++++++++++--- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/nixos/modules/services/development/nixseparatedebuginfod2.nix b/nixos/modules/services/development/nixseparatedebuginfod2.nix index b91af7bf3c3d..01b0f302b662 100644 --- a/nixos/modules/services/development/nixseparatedebuginfod2.nix +++ b/nixos/modules/services/development/nixseparatedebuginfod2.nix @@ -7,7 +7,7 @@ }: let cfg = config.services.nixseparatedebuginfod2; - url = "127.0.0.1:${toString cfg.port}"; + address = "127.0.0.1:${toString cfg.port}"; in { imports = [ @@ -40,16 +40,16 @@ in }; }; config = lib.mkIf cfg.enable { - systemd.services.nixseparatedebuginfod2 = { + systemd.sockets.nixseparatedebuginfod2 = { wantedBy = [ "multi-user.target" ]; - path = [ config.nix.package ]; + socketConfig.ListenStream = [ address ]; + }; + systemd.services.nixseparatedebuginfod2 = { serviceConfig = { ExecStart = [ (utils.escapeSystemdExecArgs ( [ (lib.getExe cfg.package) - "--listen-address" - url "--expiration" cfg.cacheExpirationDelay ] @@ -59,6 +59,7 @@ in ]) cfg.substituters) )) ]; + Type = "notify"; Restart = "on-failure"; CacheDirectory = "nixseparatedebuginfod2"; DynamicUser = true; @@ -101,7 +102,7 @@ in }; }; - environment.debuginfodServers = [ "http://${url}" ]; + environment.debuginfodServers = [ "http://${address}" ]; }; } diff --git a/nixos/tests/nixseparatedebuginfod2.nix b/nixos/tests/nixseparatedebuginfod2.nix index aa35a91971e8..054e0bba5689 100644 --- a/nixos/tests/nixseparatedebuginfod2.nix +++ b/nixos/tests/nixseparatedebuginfod2.nix @@ -44,8 +44,7 @@ start_all() cache.wait_for_unit("nginx.service") cache.wait_for_open_port(80) - machine.wait_for_unit("nixseparatedebuginfod2.service") - machine.wait_for_open_port(1949) + machine.wait_for_unit("nixseparatedebuginfod2.socket") with subtest("check that the binary cache works"): machine.succeed("nix-store --extra-substituters http://cache --option require-sigs false -r ${pkgs.sl}") diff --git a/pkgs/by-name/ni/nixseparatedebuginfod2/package.nix b/pkgs/by-name/ni/nixseparatedebuginfod2/package.nix index ef8992be225e..143c4ae6558a 100644 --- a/pkgs/by-name/ni/nixseparatedebuginfod2/package.nix +++ b/pkgs/by-name/ni/nixseparatedebuginfod2/package.nix @@ -10,24 +10,30 @@ elfutils, nix, nixosTests, + systemd, + util-linux, + cacert, }: rustPlatform.buildRustPackage (finalAttrs: { pname = "nixseparatedebuginfod2"; - version = "1.0.1"; + version = "2.0.0"; src = fetchFromGitHub { owner = "symphorien"; repo = "nixseparatedebuginfod2"; tag = "v${finalAttrs.version}"; - hash = "sha256-INY9mLJ+7i3BoShqFZMELm9aXiDbZkuLyokgm42kEbo="; + hash = "sha256-D327Pz3oHOHgfekXnDRQ0l+GrIcFUK1zcIqzR2Y3zqU="; }; - cargoHash = "sha256-6JyC0CLGnkbQWp8l27DXZ04Gt0nsNNSBFfcvAQtllE4="; + cargoHash = "sha256-iAhm54jb+5Nv/XG6GYpoEgPjYmBTHvEnnmynFF8D8n4="; buildInputs = [ libarchive openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + systemd ]; nativeBuildInputs = [ pkg-config ]; @@ -37,6 +43,13 @@ rustPlatform.buildRustPackage (finalAttrs: { bubblewrap elfutils nix + util-linux + cacert + ]; + + # disable systemd feature on non linux + cargoBuildFlags = lib.optionals (!stdenv.hostPlatform.isLinux) [ + "--no-default-features" ]; env.OPENSSL_NO_VENDOR = "1";