nixseparatedebuginfod2: 1.0.1 -> 2.0.0

Changelog: https://github.com/symphorien/nixseparatedebuginfod2/blob/master/CHANGELOG.md

Modify the module to use systemd activation.
This commit is contained in:
Guillaume Girol
2026-04-23 12:00:00 +00:00
parent 911507e404
commit 6b33c9dcfb
3 changed files with 24 additions and 11 deletions

View File

@@ -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}" ];
};
}

View File

@@ -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}")

View File

@@ -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";