dev-templates/python/flake.nix
2022-10-12 16:42:34 -05:00

38 lines
846 B
Nix

{
description = "A Nix-flake-based Python development environment";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
mach-nix.url = "github:/DavHau/mach-nix";
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs =
{ self
, flake-utils
, mach-nix
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [
(self: super: {
machNix = mach-nix.defaultPackage.${system};
python = super.python311;
})
];
pkgs = import nixpkgs { inherit overlays system; };
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [ python machNix virtualenv ] ++
(with pkgs.python311Packages; [ pip ]);
shellHook = ''
${pkgs.python}/bin/python --version
'';
};
});
}