add basic python

This commit is contained in:
2026-07-03 10:21:35 +01:00
parent 4f2a047eb4
commit 547d252ad2
3 changed files with 48 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
{
description = "Python spaghetti from samw";
inputs = {
treefmt-nix.url = "github:numtide/treefmt-nix";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{
self,
nixpkgs,
treefmt-nix,
...
}:
let
systems = [
"aarch64-darwin"
"x86_64-linux"
];
eachSystem = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
treefmtEval = eachSystem (pkgs: treefmt-nix.lib.evalModule pkgs ./treefmt.nix);
in
{
devShells = eachSystem (pkgs: {
default = pkgs.mkShellNoCC {
buildInputs = with pkgs; [
uv
ty
];
};
});
formatter = eachSystem (pkgs: treefmtEval.${pkgs.stdenv.hostPlatform.system}.config.build.wrapper);
# for `nix flake check`
checks = eachSystem (pkgs: {
formatting = treefmtEval.${pkgs.system}.config.build.check self;
});
};
}
+5
View File
@@ -0,0 +1,5 @@
{ pkgs, ... }: {
projectRootFile = "flake.nix";
programs.nixfmt.enable = true;
programs.ruff.enable = true;
}