diff --git a/flake.lock b/flake.lock index e48dcf3..9457803 100644 --- a/flake.lock +++ b/flake.lock @@ -223,6 +223,27 @@ } }, "flake-parts_3": { + "inputs": { + "nixpkgs-lib": [ + "nix-fast-build", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1722555600, + "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8471fe90ad337a8074e957b69ca4d0089218391d", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_4": { "inputs": { "nixpkgs-lib": "nixpkgs-lib_2" }, @@ -240,7 +261,7 @@ "type": "github" } }, - "flake-parts_4": { + "flake-parts_5": { "inputs": { "nixpkgs-lib": [ "nixThePlanet", @@ -398,7 +419,7 @@ }, "hercules-ci-effects": { "inputs": { - "flake-parts": "flake-parts_4", + "flake-parts": "flake-parts_5", "nixpkgs": "nixpkgs_6" }, "locked": { @@ -622,6 +643,28 @@ "type": "github" } }, + "nix-fast-build": { + "inputs": { + "flake-parts": "flake-parts_3", + "nixpkgs": [ + "nixpkgs" + ], + "treefmt-nix": "treefmt-nix_2" + }, + "locked": { + "lastModified": 1730278911, + "narHash": "sha256-CrbqsC+lEA3w6gLfpqfDMDEKoEta2sl4sbQK6Z/gXak=", + "owner": "Mic92", + "repo": "nix-fast-build", + "rev": "8e7c9d76979381441facb8888f21408312cf177a", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "nix-fast-build", + "type": "github" + } + }, "nix-formatter-pack": { "inputs": { "nixpkgs": [ @@ -712,7 +755,7 @@ }, "nixThePlanet": { "inputs": { - "flake-parts": "flake-parts_3", + "flake-parts": "flake-parts_4", "hercules-ci-effects": "hercules-ci-effects", "nixpkgs": [ "nixpkgs" @@ -1119,12 +1162,13 @@ "lix-eval-jobs": "lix-eval-jobs", "lix-module": "lix-module", "mobile-nixos": "mobile-nixos", + "nix-fast-build": "nix-fast-build", "nix-on-droid": "nix-on-droid", "nixDarwin": "nixDarwin", "nixThePlanet": "nixThePlanet", "nixosHardware": "nixosHardware", "nixpkgs": "nixpkgs_7", - "treefmt-nix": "treefmt-nix_2", + "treefmt-nix": "treefmt-nix_3", "vscode-server": "vscode-server" } }, @@ -1254,6 +1298,27 @@ } }, "treefmt-nix_2": { + "inputs": { + "nixpkgs": [ + "nix-fast-build", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1723808491, + "narHash": "sha256-rhis3qNuGmJmYC/okT7Dkc4M8CeUuRCSvW6kC2f3hBc=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "1d07739554fdc4f8481068f1b11d6ab4c1a4167a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "treefmt-nix_3": { "inputs": { "nixpkgs": [ "nixpkgs" diff --git a/flake.nix b/flake.nix index de2ff34..e42bff9 100644 --- a/flake.nix +++ b/flake.nix @@ -62,6 +62,10 @@ }; catppuccin.url = "github:catppuccin/nix"; emacs-overlay.url = "github:nix-community/emacs-overlay"; + nix-fast-build = { + url = "github:Mic92/nix-fast-build"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = diff --git a/modules/nix/default.nix b/modules/nix/default.nix index 84e36c4..a46e84e 100644 --- a/modules/nix/default.nix +++ b/modules/nix/default.nix @@ -2,17 +2,23 @@ config, lib, fleetFlake, + pkgs, ... }: { nixpkgs.overlays = [ (final: _: { + nix-fast-build = fleetFlake.inputs.nix-fast-build.packages.${final.system}.nix-fast-build // { + nix = final.nix; + }; nix-eval-job = fleetFlake.inputs.lix-eval-jobs.packages.${final.system}.nix-eval-jobs // { nix = final.nix; }; }) ]; + environment.systemPackages = [ pkgs.nix-fast-build ]; + nix = { optimise.automatic = true;