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