Skip to content

Commit

Permalink
nix copy: Add --substitute flag
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Sep 8, 2017
1 parent b7376ed commit e02edb1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/nix/copy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ struct CmdCopy : StorePathsCommand

CheckSigsFlag checkSigs = CheckSigs;

SubstituteFlag substitute = NoSubstitute;

CmdCopy()
{
mkFlag(0, "from", "store-uri", "URI of the source Nix store", &srcUri);
Expand All @@ -23,6 +25,12 @@ struct CmdCopy : StorePathsCommand
.longName("no-check-sigs")
.description("do not require that paths are signed by trusted keys")
.set(&checkSigs, NoCheckSigs);

mkFlag()
.longName("substitute")
.shortName('s')
.description("whether to try substitutes on the destination store (only supported by SSH)")
.set(&substitute, Substitute);
}

std::string name() override
Expand Down Expand Up @@ -66,7 +74,7 @@ struct CmdCopy : StorePathsCommand
ref<Store> dstStore = dstUri.empty() ? openStore() : openStore(dstUri);

copyPaths(srcStore, dstStore, PathSet(storePaths.begin(), storePaths.end()),
NoRepair, checkSigs);
NoRepair, checkSigs, substitute);
}
};

Expand Down

0 comments on commit e02edb1

Please sign in to comment.