nix: python devshell

This commit is contained in:
0m.ax 2026-07-18 21:11:24 +02:00
parent c6a295a4e5
commit 3be09c16d0
2 changed files with 64 additions and 0 deletions

27
flake.lock generated Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1759733170,
"narHash": "sha256-TXnlsVb5Z8HXZ6mZoeOAIwxmvGHp1g4Dw89eLvIwKVI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "8913c168d1c56dc49a7718685968f38752171c3b",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

37
flake.nix Normal file
View file

@ -0,0 +1,37 @@
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { self, nixpkgs }: {
devShells.x86_64-linux.default =
let
insecure-package-overlay = final: prev: {
nixpkgs.config.permittedInsecurePackages = [
# Add the full name and version of the package here
"python-2.7.18.8-env"
# "another-insecure-package-2.0"
];
};
pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [insecure-package-overlay];
};
pyenv = pkgs.python3.withPackages (ps: [
ps.gevent # Version 1.2.1 from pinned nixpkgs
ps.pygame # Version 1.9.3 from pinned nixpkgs
ps.numpy # Our custom-versioned NumPy
]);
in
pkgs.mkShell {
buildInputs = [
pyenv
];
};
};
}