From 84428b7b9d6b907e0134833e1b4ab0dba4ac4320 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Thu, 28 Nov 2024 19:34:38 +0800 Subject: [PATCH] templates/python-uv: simplify flakes using nix-exprs --- templates/python-uv/flake.nix | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/templates/python-uv/flake.nix b/templates/python-uv/flake.nix index 8ff539b..a003d6b 100644 --- a/templates/python-uv/flake.nix +++ b/templates/python-uv/flake.nix @@ -1,15 +1,13 @@ { outputs = - inputs@{ flake-parts, ... }: + inputs@{ flake-parts, rebmit, ... }: flake-parts.lib.mkFlake { inherit inputs; } { - systems = [ - "x86_64-linux" - "aarch64-linux" - ]; + inherit (rebmit.lib) systems; imports = [ inputs.devshell.flakeModule inputs.git-hooks-nix.flakeModule inputs.treefmt-nix.flakeModule + inputs.rebmit.flakeModule ]; perSystem = { @@ -73,34 +71,22 @@ inputs = { # flake-parts - flake-parts = { - url = "github:hercules-ci/flake-parts"; - inputs.nixpkgs-lib.follows = "nixpkgs"; - }; + flake-parts.follows = "rebmit/flake-parts"; # nixpkgs - nixpkgs.follows = "nixpkgs-unstable"; - nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs.follows = "rebmit/nixpkgs"; + nixpkgs-unstable.follows = "rebmit/nixpkgs-unstable"; # flake modules - devshell = { - url = "github:numtide/devshell"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - 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"; - }; + devshell.follows = "rebmit/devshell"; + git-hooks-nix.follows = "rebmit/git-hooks-nix"; + treefmt-nix.follows = "rebmit/treefmt-nix"; # libraries + rebmit.url = "github:rebmit/nix-exprs"; pyproject-nix = { url = "github:pyproject-nix/pyproject.nix"; inputs.nixpkgs.follows = "nixpkgs";