nix-templates/python/flake.nix
2026-07-03 10:21:35 +01:00

40 lines
976 B
Nix

{
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;
});
};
}