mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 12:06:01 +01:00
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
(cherry picked from commit 80a4293486)
This commit is contained in:
parent
bab4e58a5e
commit
e04004ebc2
1 changed files with 11 additions and 1 deletions
|
|
@ -1019,6 +1019,10 @@ struct CmdFlakeArchive : FlakeCommand, MixJSON, MixDryRun
|
||||||
{
|
{
|
||||||
std::string dstUri;
|
std::string dstUri;
|
||||||
|
|
||||||
|
CheckSigsFlag checkSigs = CheckSigs;
|
||||||
|
|
||||||
|
SubstituteFlag substitute = NoSubstitute;
|
||||||
|
|
||||||
CmdFlakeArchive()
|
CmdFlakeArchive()
|
||||||
{
|
{
|
||||||
addFlag({
|
addFlag({
|
||||||
|
|
@ -1027,6 +1031,11 @@ struct CmdFlakeArchive : FlakeCommand, MixJSON, MixDryRun
|
||||||
.labels = {"store-uri"},
|
.labels = {"store-uri"},
|
||||||
.handler = {&dstUri},
|
.handler = {&dstUri},
|
||||||
});
|
});
|
||||||
|
addFlag({
|
||||||
|
.longName = "no-check-sigs",
|
||||||
|
.description = "Do not require that paths are signed by trusted keys.",
|
||||||
|
.handler = {&checkSigs, NoCheckSigs},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string description() override
|
std::string description() override
|
||||||
|
|
@ -1087,7 +1096,8 @@ struct CmdFlakeArchive : FlakeCommand, MixJSON, MixDryRun
|
||||||
|
|
||||||
if (!dryRun && !dstUri.empty()) {
|
if (!dryRun && !dstUri.empty()) {
|
||||||
ref<Store> dstStore = dstUri.empty() ? openStore() : openStore(dstUri);
|
ref<Store> dstStore = dstUri.empty() ? openStore() : openStore(dstUri);
|
||||||
copyPaths(*store, *dstStore, sources);
|
|
||||||
|
copyPaths(*store, *dstStore, sources, NoRepair, checkSigs, substitute);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue