Skip to content

Commit 80a4293

Browse files
committed
nix flake archive: add --no-check-sigs option
Allows to copy the archive to a remote host and not get error: cannot add path '/nix/store/01x2k4nlxcpyd85nnr0b9gm89rm8ff4x-source' because it lacks a signature by a trusted key
1 parent 74a107d commit 80a4293

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/nix/flake.cc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,10 @@ struct CmdFlakeArchive : FlakeCommand, MixJSON, MixDryRun
10511051
{
10521052
std::string dstUri;
10531053

1054+
CheckSigsFlag checkSigs = CheckSigs;
1055+
1056+
SubstituteFlag substitute = NoSubstitute;
1057+
10541058
CmdFlakeArchive()
10551059
{
10561060
addFlag({
@@ -1059,6 +1063,11 @@ struct CmdFlakeArchive : FlakeCommand, MixJSON, MixDryRun
10591063
.labels = {"store-uri"},
10601064
.handler = {&dstUri},
10611065
});
1066+
addFlag({
1067+
.longName = "no-check-sigs",
1068+
.description = "Do not require that paths are signed by trusted keys.",
1069+
.handler = {&checkSigs, NoCheckSigs},
1070+
});
10621071
}
10631072

10641073
std::string description() override
@@ -1122,7 +1131,8 @@ struct CmdFlakeArchive : FlakeCommand, MixJSON, MixDryRun
11221131

11231132
if (!dryRun && !dstUri.empty()) {
11241133
ref<Store> dstStore = dstUri.empty() ? openStore() : openStore(dstUri);
1125-
copyPaths(*store, *dstStore, sources);
1134+
1135+
copyPaths(*store, *dstStore, sources, NoRepair, checkSigs, substitute);
11261136
}
11271137
}
11281138
};

0 commit comments

Comments
 (0)