From 7ceda7d52283e2d5bcb2bcb26c0dc2a947dde179 Mon Sep 17 00:00:00 2001 From: r-vdp Date: Wed, 17 Dec 2025 12:26:49 +0200 Subject: [PATCH] sudo-rs: add a store path for zoneinfo so that sudo-rs also works on non-NixOS --- pkgs/by-name/su/sudo-rs/package.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/su/sudo-rs/package.nix b/pkgs/by-name/su/sudo-rs/package.nix index af4da9c1f9c0..f112b9b1309a 100644 --- a/pkgs/by-name/su/sudo-rs/package.nix +++ b/pkgs/by-name/su/sudo-rs/package.nix @@ -7,6 +7,7 @@ versionCheckHook, pam, rustPlatform, + tzdata, }: rustPlatform.buildRustPackage (finalAttrs: { @@ -28,7 +29,8 @@ rustPlatform.buildRustPackage (finalAttrs: { postPatch = '' substituteInPlace src/system/audit.rs \ - --replace-fail "/usr/share/zoneinfo" "/etc/zoneinfo" + --replace-fail '/usr/share/zoneinfo' '/etc/zoneinfo' \ + --replace-fail '/usr/share/lib/zoneinfo' '${tzdata}/share/zoneinfo' ''; postInstall = '' @@ -61,7 +63,9 @@ rustPlatform.buildRustPackage (finalAttrs: { "system::interface::test::test_unix_user" "system::tests::test_get_user_and_group_by_id" - # Assumes runtime zoneinfo paths + # Store paths are not owned by root in the build sandbox, so the zoneinfo path + # doesn't pass the validations done by sudo-rs. + # This is not an issue at runtime, since there the zoneinfo path is owned by root. "sudo::env::environment::tests::test_tzinfo" # Unsure why those are failing