Skip to content

Commit

Permalink
fixup! Add an 'add-root' comamnd to manually add indirect roots
Browse files Browse the repository at this point in the history
  • Loading branch information
layus committed Sep 15, 2024
1 parent fee7efb commit 9465b19
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/nix/add-root.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

using namespace nix;

struct CmdAddRoot: StoreCommand
struct CmdAddRoot : StoreCommand
{
std::vector<std::string> links;
bool checkResults = true;
Expand All @@ -31,17 +31,20 @@ struct CmdAddRoot: StoreCommand
std::string doc() override
{
return
#include "add-root.md"
;
#include "add-root.md"
;
}

Category category() override { return catSecondary; }
Category category() override
{
return catSecondary;
}

void run(ref<Store> store) override
{
auto & indirectRootStore = require<IndirectRootStore>(*store);

for (auto &link: links) {
for (auto & link : links) {
auto indirectPath = absPath(link);
if (indirectRootStore.isInStore(indirectPath)) {
throw Error("Indirect root '%1%' must not be in the Nix store", link);
Expand Down

0 comments on commit 9465b19

Please sign in to comment.