shell.nix: Support nix-shell -A (#353240)

This commit is contained in:
Robert Hensing 2024-11-06 15:01:08 +01:00 committed by GitHub
commit 603cc87dd6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,8 +17,17 @@
}:
let
inherit (import ./ci { inherit nixpkgs system; }) pkgs;
# For `nix-shell -A hello`
curPkgs = builtins.removeAttrs (import ./. { inherit system; }) [
# Although this is what anyone may expect from a `_type = "pkgs"`,
# this file is intended to produce a shell in the first place,
# and a `_type` tag could confuse some code.
"_type"
];
in
pkgs.mkShellNoCC {
curPkgs
// pkgs.mkShellNoCC {
packages = with pkgs; [
# The default formatter for Nix code
# See https://github.com/NixOS/nixfmt