diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-04-05T13·30+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-04-05T14·39+0200 |
commit | d0f5719c2a2e5a0eea49dc072b26e7d161564bbb (patch) | |
tree | 48589fd3963b008418004a2fca383a29c347e1be /src/nix-daemon/nix-daemon.cc | |
parent | 80da7a637559aadb6544599adc9f5807188cb9e5 (diff) |
Add "nix copy-sigs" command
This imports signatures from one store into another. E.g. $ nix copy-sigs -r /run/current-system -s https://cache.nixos.org/ imported 595 signatures
Diffstat (limited to 'src/nix-daemon/nix-daemon.cc')
-rw-r--r-- | src/nix-daemon/nix-daemon.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nix-daemon/nix-daemon.cc b/src/nix-daemon/nix-daemon.cc index 527f6bca93ac..439cd3dc0bce 100644 --- a/src/nix-daemon/nix-daemon.cc +++ b/src/nix-daemon/nix-daemon.cc @@ -543,6 +543,18 @@ static void performOp(ref<LocalStore> store, bool trusted, unsigned int clientVe break; } + case wopAddSignatures: { + Path path = readStorePath(from); + StringSet sigs = readStrings<StringSet>(from); + startWork(); + if (!trusted) + throw Error("you are not privileged to add signatures"); + store->addSignatures(path, sigs); + stopWork(); + to << 1; + break; + } + default: throw Error(format("invalid operation %1%") % op); } |