From 2b86faa7fe27a2cab45d9ba9e577b79a0efc35e5 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Tue, 9 Jul 2024 11:12:55 -0500 Subject: [PATCH] Template --- templates/nix-flake/flake.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/templates/nix-flake/flake.nix b/templates/nix-flake/flake.nix index 408d4f2..86a9be5 100644 --- a/templates/nix-flake/flake.nix +++ b/templates/nix-flake/flake.nix @@ -1,4 +1,6 @@ { + inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; + inputs.pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; inputs.pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs"; @@ -10,8 +12,8 @@ }: let systems = ["aarch64-linux" "aarch64-darwin" "x86_64-darwin" "x86_64-linux"]; forSystems = nixpkgs.lib.genAttrs systems; - pkgsFor = system: import nixpkgs {inherit system;}; - genPkgs = f: (f (forSystems pkgsFor)); + pkgsFor = system: (import nixpkgs {inherit system;}); + genPkgs = func: (forSystems (system: func (pkgsFor system))); in { formatter = genPkgs (pkgs: pkgs.alejandra); @@ -26,7 +28,7 @@ devShells = genPkgs (pkgs: { nix = pkgs.mkShell { - buildInputs = with pkgs; [nil alejandra]; + packages = with pkgs; [nil alejandra]; inherit (self.outputs.checks.${pkgs.system}.pre-commit-check) shellHook; };