dev-templates/python/flake.nix
2023-03-06 13:28:29 +02:00

39 lines
858 B
Nix

{
description = "A Nix-flake-based Python development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-22.11";
flake-utils.url = "github:numtide/flake-utils";
mach-nix.url = "github:/DavHau/mach-nix";
};
outputs =
{ self
, nixpkgs
, flake-utils
, mach-nix
}:
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 {
packages = with pkgs; [ python machNix virtualenv ] ++
(with pkgs.python311Packages; [ pip ]);
shellHook = ''
${pkgs.python}/bin/python --version
'';
};
});
}