Skip to content

Commit

Permalink
chore: Setup nix devShell
Browse files Browse the repository at this point in the history
  • Loading branch information
bcyran committed Jul 7, 2024
1 parent 6e25394 commit a0757d9
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
description = "A Nix-flake-based Python development environment";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};

outputs = {
self,
nixpkgs,
}: let
supportedSystems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
forEachSupportedSystem = f:
nixpkgs.lib.genAttrs supportedSystems (system:
f {
pkgs = import nixpkgs {inherit system;};
});
in {
devShells = forEachSupportedSystem ({pkgs}: {
default = pkgs.mkShell {
venvDir = ".venv";
packages = with pkgs;
[
python312
poetry
pyright
]
++ (with pkgs.python312Packages; [
pip
venvShellHook
]);
};
});
};
}

0 comments on commit a0757d9

Please sign in to comment.