templates/python-uv: simplify flakes using nix-exprs

This commit is contained in:
Lu Wang 2024-11-28 19:34:38 +08:00
parent a5973d50b8
commit 84428b7b9d
Signed by: rebmit
SSH key fingerprint: SHA256:3px8QV1zEerIrEWHaqtH5rR9kjetyRST5EipOPrd+bU

View file

@ -1,15 +1,13 @@
{ {
outputs = outputs =
inputs@{ flake-parts, ... }: inputs@{ flake-parts, rebmit, ... }:
flake-parts.lib.mkFlake { inherit inputs; } { flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ inherit (rebmit.lib) systems;
"x86_64-linux"
"aarch64-linux"
];
imports = [ imports = [
inputs.devshell.flakeModule inputs.devshell.flakeModule
inputs.git-hooks-nix.flakeModule inputs.git-hooks-nix.flakeModule
inputs.treefmt-nix.flakeModule inputs.treefmt-nix.flakeModule
inputs.rebmit.flakeModule
]; ];
perSystem = perSystem =
{ {
@ -73,34 +71,22 @@
inputs = { inputs = {
# flake-parts # flake-parts
flake-parts = { flake-parts.follows = "rebmit/flake-parts";
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
# nixpkgs # nixpkgs
nixpkgs.follows = "nixpkgs-unstable"; nixpkgs.follows = "rebmit/nixpkgs";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs-unstable.follows = "rebmit/nixpkgs-unstable";
# flake modules # flake modules
devshell = { devshell.follows = "rebmit/devshell";
url = "github:numtide/devshell"; git-hooks-nix.follows = "rebmit/git-hooks-nix";
inputs.nixpkgs.follows = "nixpkgs"; treefmt-nix.follows = "rebmit/treefmt-nix";
};
git-hooks-nix = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-stable.follows = "nixpkgs";
};
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# libraries # libraries
rebmit.url = "github:rebmit/nix-exprs";
pyproject-nix = { pyproject-nix = {
url = "github:pyproject-nix/pyproject.nix"; url = "github:pyproject-nix/pyproject.nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";