mirror of
https://github.com/wlcx/nix-templates.git
synced 2026-07-04 02:53:12 +01:00
add basic python
This commit is contained in:
parent
4f2a047eb4
commit
547d252ad2
@ -21,6 +21,10 @@
|
||||
path = ./devshell;
|
||||
description = "A basic devshell setup";
|
||||
};
|
||||
python = {
|
||||
path = ./python;
|
||||
description = "A basic python setup";
|
||||
};
|
||||
};
|
||||
}
|
||||
// utils.lib.eachDefaultSystem (system: let
|
||||
|
||||
39
python/flake.nix
Normal file
39
python/flake.nix
Normal 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
python/treefmt.nix
Normal file
5
python/treefmt.nix
Normal file
@ -0,0 +1,5 @@
|
||||
{ pkgs, ... }: {
|
||||
projectRootFile = "flake.nix";
|
||||
programs.nixfmt.enable = true;
|
||||
programs.ruff.enable = true;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user