I have below a simple flake that gives me a dev shell with Python:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
};
outputs =
{
self,
nixpkgs,
}:
let
system = "aarch64-darwin";
pkgs = import nixpkgs { inherit system; };
in
{
devShells.${system}.default = pkgs.mkShell {
buildInputs = with pkgs; [
python314
];
};
};
}
and when I run `nix flake show`, I get this (successful) output:
% nix flake show
git+file://<PATH TO FLAKE>
└───devShells
└───aarch64-darwin
└───default: development environment 'nix-shell'
Now I want to make this more cross-platform, so I use flake-utils.lib.eachDefaultSystem:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
in
{
devShells.${system}.default = pkgs.mkShell {
buildInputs = with pkgs; [
python314
];
};
}
);
}
But now when I run `nix flake show` I get this error/output:
% nix flake show
git+file://<PATH TO FLAKE>
└───devShells
├───aarch64-darwin
error: expected a derivation
Why am I getting this error? how do I fix it?