My flake.nix
{
description = "";
inputs = {
nixpkgs.url = "nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
nixpkgs,
nixpkgs-unstable,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
pkgs-unstable = nixpkgs-unstable.legacyPackages.${system};
in
rec {
formatter = pkgs.nixfmt-rfc-style;
packages.default = pkgs.stdenv.mkDerivation rec {
pname = "test.sh";
version = "0.1.0";
src = ./.;
installPhase = ''
mkdir -p $out/bin
chmod +x test.sh
cp test.sh $out/bin/test.sh
'';
buildInputs = with pkgs; [
bash
python313
];
};
}
);
}
My test.sh
#!/bin/bash
python --version || :
python3 --version || :
python3.13 --version || :
Why can’t my script find Python 3.13? It is right there in the buildInputs
section! Am I doing something wrong? The example doesn’t get any more minimal than that and I still don’t see the issue.
Output of the script:
Python 3.10.12
Python 3.10.12
/nix/store/6r6bqzbvw9q5dd55cl52dizb99y7cc80-test.sh-0.1.0/bin/test.sh: line 5: python3.13: command not found