diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-01-29 23:12:58 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-01-29 23:14:27 +0100 |
commit | b9fb3720750a24d8b2fbe6b1491696d6a51dcff3 (patch) | |
tree | 27bef94799d20261c9b49e43bbcd1907a107fde9 /src/nix | |
parent | 88b44b1e94735710853bdabb6904073bc77f2ccb (diff) |
Add --update-input flag to update a specific flake input
Typical usage:
$ nix flake update ~/Misc/eelco-configurations/hagbard --update-input nixpkgs
to update the 'nixpkgs' input of a flake while leaving every other
input unchanged.
The argument is an input path, so you can do e.g. '--update-input
dwarffs/nixpkgs' to update an input of an input.
Fixes #2928.
Diffstat (limited to 'src/nix')
-rw-r--r-- | src/nix/installables.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nix/installables.cc b/src/nix/installables.cc index 24eb739f5..77a43ef2a 100644 --- a/src/nix/installables.cc +++ b/src/nix/installables.cc @@ -40,6 +40,14 @@ MixFlakeOptions::MixFlakeOptions() .set(&lockFlags.useRegistries, false); mkFlag() + .longName("update-input") + .description("update a specific flake input") + .label("input-path") + .handler([&](std::vector<std::string> ss) { + lockFlags.inputUpdates.insert(flake::parseInputPath(ss[0])); + }); + + mkFlag() .longName("override-input") .description("override a specific flake input (e.g. 'dwarffs/nixpkgs')") .arity(2) |