From d7b6c8f59197c5b5a0f8a8ea077538372992d7ef Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 21 Aug 2021 01:24:03 +0200 Subject: [PATCH 1/2] nix develop: Fix `devShells` lookup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It currently fails with the following error: error: flake 'git+file://…' does not provide attribute 'devShells.x86_64-linuxhaskell', 'packages.x86_64-linux.haskell', 'legacyPackages.x86_64-linux.haskell' or 'haskell' --- src/nix/develop.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nix/develop.cc b/src/nix/develop.cc index 55023545d..c823f16c8 100644 --- a/src/nix/develop.cc +++ b/src/nix/develop.cc @@ -330,7 +330,7 @@ struct Common : InstallableCommand, MixProfile Strings getDefaultFlakeAttrPathPrefixes() override { auto res = SourceExprCommand::getDefaultFlakeAttrPathPrefixes(); - res.emplace_front("devShells." + settings.thisSystem.get()); + res.emplace_front("devShells." + settings.thisSystem.get() + "."); return res; } From 2d66a31f015a26f182f8a70fa09c635d1c7a1739 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 21 Aug 2021 20:17:05 +0200 Subject: [PATCH 2/2] nix {bundle,run}: drop broken flake attr-path prefixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit “packages” was probably meant to be “packages.${system}.” but that is already listed in `getDefaultFlakeAttrPathPrefixes` in `installables`, which is probably why no one noticed it was broken. --- src/nix/bundle.cc | 2 +- src/nix/run.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nix/bundle.cc b/src/nix/bundle.cc index cedb5704c..aca024bca 100644 --- a/src/nix/bundle.cc +++ b/src/nix/bundle.cc @@ -59,7 +59,7 @@ struct CmdBundle : InstallableCommand Strings getDefaultFlakeAttrPathPrefixes() override { - Strings res{"apps." + settings.thisSystem.get() + ".", "packages"}; + Strings res{"apps." + settings.thisSystem.get() + "."}; for (auto & s : SourceExprCommand::getDefaultFlakeAttrPathPrefixes()) res.push_back(s); return res; diff --git a/src/nix/run.cc b/src/nix/run.cc index 7597b61f7..b01fdebaa 100644 --- a/src/nix/run.cc +++ b/src/nix/run.cc @@ -167,7 +167,7 @@ struct CmdRun : InstallableCommand Strings getDefaultFlakeAttrPathPrefixes() override { - Strings res{"apps." + settings.thisSystem.get() + ".", "packages"}; + Strings res{"apps." + settings.thisSystem.get() + "."}; for (auto & s : SourceExprCommand::getDefaultFlakeAttrPathPrefixes()) res.push_back(s); return res;