Mic92/nix-fast-build

Package propagates Python interpreter to shell

Closed this issue · 0 comments

If you construct a simple flake like this:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    nix-fast-build.url = "github:Mic92/nix-fast-build";
    nix-fast-build.inputs.nixpkgs.follows = "nixpkgs";
  };

  outputs = { self, nixpkgs, nix-fast-build }: 
    let
      forAllSystems = nixpkgs.lib.genAttrs [
        "aarch64-darwin"
        "aarch64-linux"
        "x86_64-darwin"
        "x86_64-linux"
      ];
    in
  {
    devShells = forAllSystems (localSystem:
      let
        pkgs = import nixpkgs { inherit localSystem; };
      in
      {
        default = pkgs.mkShell {
          nativeBuildInputs = [
            nix-fast-build.packages.${localSystem}.nix-fast-build
          ];
        };
      }
    );
  };
}

You end up with python3 in your shell, which is unexpected:

$ which -a python3
/usr/bin/python3

$ nix develop --command which -a python3
/nix/store/rycxjkclx801wrhwrgllak0302xzjdvx-python3-3.11.4/bin/python3
/usr/bin/python3

This doesn't happen with other Python packages, for example:

$ nix-shell -p pre-commit --run "which -a python3"
/usr/bin/python3