Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/nix/flake-command.hh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class FlakeCommand : virtual Args, public MixFlakeOptions
{
protected:
std::string flakeUrl = ".";
CheckSigsFlag checkSigs = CheckSigs;
SubstituteFlag substitute = NoSubstitute;

public:

Expand Down
29 changes: 21 additions & 8 deletions src/nix/flake.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -1086,7 +1100,6 @@ struct CmdFlakeArchive : FlakeCommand, MixJSON, MixDryRun

if (!dryRun && !dstUri.empty()) {
ref<Store> dstStore = dstUri.empty() ? openStore() : openStore(dstUri);

copyPaths(*store, *dstStore, sources, NoRepair, checkSigs, substitute);
}
}
Expand Down
Loading