mirror of
https://github.com/NixOS/nix
synced 2025-07-07 10:11:47 +02:00
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:
parent
caf5172945
commit
162fbe31ff
9 changed files with 61 additions and 41 deletions
|
@ -158,7 +158,10 @@ SourceExprCommand::SourceExprCommand()
|
|||
|
||||
Strings SourceExprCommand::getDefaultFlakeAttrPaths()
|
||||
{
|
||||
return {"defaultPackage." + settings.thisSystem.get()};
|
||||
return {
|
||||
"packages." + settings.thisSystem.get() + ".default",
|
||||
"defaultPackage." + settings.thisSystem.get()
|
||||
};
|
||||
}
|
||||
|
||||
Strings SourceExprCommand::getDefaultFlakeAttrPathPrefixes()
|
||||
|
|
|
@ -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
|
||||
};
|
||||
|
|
|
@ -325,8 +325,15 @@ struct Common : InstallableCommand, MixProfile
|
|||
|
||||
Strings getDefaultFlakeAttrPaths() override
|
||||
{
|
||||
return {"devShell." + settings.thisSystem.get(), "defaultPackage." + settings.thisSystem.get()};
|
||||
Strings paths{
|
||||
"devShells." + settings.thisSystem.get() + ".default",
|
||||
"devShell." + settings.thisSystem.get(),
|
||||
};
|
||||
for (auto & p : SourceExprCommand::getDefaultFlakeAttrPaths())
|
||||
paths.push_back(p);
|
||||
return paths;
|
||||
}
|
||||
|
||||
Strings getDefaultFlakeAttrPathPrefixes() override
|
||||
{
|
||||
auto res = SourceExprCommand::getDefaultFlakeAttrPathPrefixes();
|
||||
|
|
|
@ -651,7 +651,7 @@ struct CmdFlakeCheck : FlakeCommand
|
|||
};
|
||||
|
||||
static Strings defaultTemplateAttrPathsPrefixes{"templates."};
|
||||
static Strings defaultTemplateAttrPaths = {"defaultTemplate"};
|
||||
static Strings defaultTemplateAttrPaths = {"templates.default", "defaultTemplate"};
|
||||
|
||||
struct CmdFlakeInitCommon : virtual Args, EvalCommand
|
||||
{
|
||||
|
|
|
@ -158,7 +158,10 @@ struct CmdRun : InstallableCommand
|
|||
|
||||
Strings getDefaultFlakeAttrPaths() override
|
||||
{
|
||||
Strings res{"defaultApp." + settings.thisSystem.get()};
|
||||
Strings res{
|
||||
"apps." + settings.thisSystem.get() + ".default",
|
||||
"defaultApp." + settings.thisSystem.get(),
|
||||
};
|
||||
for (auto & s : SourceExprCommand::getDefaultFlakeAttrPaths())
|
||||
res.push_back(s);
|
||||
return res;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue