Replace defaultBla.$system with bla.$system.default

This also simplifies some InstallableFlake logic and fixes 'nix
bundle' parsing its installable twice.

Fixes #5532.
This commit is contained in:
Eelco Dolstra
2022-02-22 11:47:41 +01:00
parent caf5172945
commit 162fbe31ff
9 changed files with 61 additions and 41 deletions
+6 -5
View File
@@ -49,9 +49,11 @@ struct CmdBundle : InstallableCommand
Category category() override { return catSecondary; }
// FIXME: cut&paste from CmdRun.
Strings getDefaultFlakeAttrPaths() override
{
Strings res{
"apps." + settings.thisSystem.get() + ".default",
"defaultApp." + settings.thisSystem.get()
};
for (auto & s : SourceExprCommand::getDefaultFlakeAttrPaths())
@@ -61,10 +63,7 @@ struct CmdBundle : InstallableCommand
Strings getDefaultFlakeAttrPathPrefixes() override
{
Strings res{
"apps." + settings.thisSystem.get() + "."
};
Strings res{"apps." + settings.thisSystem.get() + "."};
for (auto & s : SourceExprCommand::getDefaultFlakeAttrPathPrefixes())
res.push_back(s);
return res;
@@ -80,7 +79,9 @@ struct CmdBundle : InstallableCommand
const flake::LockFlags lockFlags{ .writeLockFile = false };
InstallableFlake bundler{this,
evalState, std::move(bundlerFlakeRef), bundlerName,
{"defaultBundler." + settings.thisSystem.get()},
{"bundlers." + settings.thisSystem.get() + ".default",
"defaultBundler." + settings.thisSystem.get()
},
{"bundlers." + settings.thisSystem.get() + "."},
lockFlags
};