Skip to content

Commit 5311bcf

Browse files
committed
Sign store paths before copying to cache @claude
1 parent 8f782af commit 5311bcf

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

kubenix/daemonset.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ in
142142
ssh-config.mountPath = "/etc/ssh";
143143
ssh-dynauth.mountPath = "/etc/ssh-dynauth";
144144
ssh-key.mountPath = "/etc/ssh-key";
145+
nix-key.mountPath = "/etc/nix-key";
145146
};
146147
resources = {
147148
requests = {
@@ -265,6 +266,10 @@ in
265266
secretName = "ssh-key";
266267
defaultMode = 256; # 400
267268
};
269+
nix-key.secret = {
270+
secretName = "nix-key";
271+
defaultMode = 256; # 400
272+
};
268273
};
269274
};
270275
};

pkgs/nixkube/src/cache.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,19 @@ async def copy_to_cache(package_paths: set[Path]) -> None:
104104
paths = {p for p in paths if p.suffix != ".drv"}
105105

106106
if len(paths) > 0:
107+
sign_result = await run_captured(
108+
"nix",
109+
"store",
110+
"sign",
111+
"--key-file",
112+
"/etc/nix-key/nix_ed25519",
113+
*paths,
114+
)
115+
if sign_result.returncode != 0:
116+
logger.warning(
117+
f"Failed to sign paths (rc={sign_result.returncode}): {sign_result.stderr}"
118+
)
119+
107120
for attempt in range(6):
108121
if attempt > 0:
109122
exp_backoff = min(5 * (2 ** (attempt - 1)), 60)

0 commit comments

Comments
 (0)