diff --git a/src/nix/flake-command.hh b/src/nix/flake-command.hh index 3636bd52510..0a07aba9220 100644 --- a/src/nix/flake-command.hh +++ b/src/nix/flake-command.hh @@ -12,6 +12,8 @@ class FlakeCommand : virtual Args, public MixFlakeOptions { protected: std::string flakeUrl = "."; + CheckSigsFlag checkSigs = CheckSigs; + SubstituteFlag substitute = NoSubstitute; public: diff --git a/src/nix/flake.cc b/src/nix/flake.cc index a7b72c7e189..01d14336e6d 100644 --- a/src/nix/flake.cc +++ b/src/nix/flake.cc @@ -36,13 +36,27 @@ struct CmdFlakeUpdate; FlakeCommand::FlakeCommand() { - expectArgs( - {.label = "flake-url", - .optional = true, - .handler = {&flakeUrl}, - .completer = {[&](AddCompletions & completions, size_t, std::string_view prefix) { - completeFlakeRef(completions, getStore(), prefix); - }}}); + expectArgs({ + .label = "flake-url", + .optional = true, + .handler = {&flakeUrl}, + .completer = {[&](AddCompletions & completions, size_t, std::string_view prefix) { + completeFlakeRef(completions, getStore(), prefix); + }} + }); + + addFlag({ + .longName = "no-check-sigs", + .description = "Do not require that paths are signed by trusted keys.", + .handler = {&checkSigs, NoCheckSigs}, + }); + + addFlag({ + .longName = "substitute-on-destination", + .shortName = 's', + .description = "Whether to try substitutes on the destination store (only supported by SSH stores).", + .handler = {&substitute, Substitute}, + }); } FlakeRef FlakeCommand::getFlakeRef() @@ -1086,7 +1100,6 @@ struct CmdFlakeArchive : FlakeCommand, MixJSON, MixDryRun if (!dryRun && !dstUri.empty()) { ref dstStore = dstUri.empty() ? openStore() : openStore(dstUri); - copyPaths(*store, *dstStore, sources, NoRepair, checkSigs, substitute); } }