dev-templates/python/flake.nix
2022-08-20 15:54:34 +03:00

38 lines
837 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
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ python machNix virtualenv ] ++
(with pkgs.python311Packages; [ pip ]);
shellHook = ''
${pkgs.python}/bin/python --version
'';
};
});
}