From 32af7c44bce57f23cf18c74705922e04076f81ec Mon Sep 17 00:00:00 2001 From: Seth Flynn Date: Tue, 28 Jan 2025 07:44:51 -0500 Subject: ci: use hydraJobs --- flake.nix | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 7ca0e0c..01fa364 100644 --- a/flake.nix +++ b/flake.nix @@ -15,9 +15,9 @@ inherit (nixpkgs) lib; # Support all systems exported by Nixpkgs - systems = lib.systems.flakeExposed; + systems = lib.intersectLists lib.systems.flakeExposed (with lib.platforms; darwin ++ linux); # But separate our primarily supported systems - tier1Systems = with lib.platforms; lib.intersectLists (aarch64 ++ x86_64) (darwin ++ linux); + tier1Systems = lib.intersectLists systems (with lib.platforms; aarch64 ++ x86_64); forAllSystems = lib.genAttrs systems; forTier1Systems = lib.genAttrs tier1Systems; @@ -32,11 +32,14 @@ mkCheck = name: deps: script: - pkgs.runCommand name { nativeBuildInputs = deps; } script; + pkgs.runCommand name { nativeBuildInputs = deps; } '' + ${script} + touch $out + ''; in { deadnix = mkCheck "check-deadnix" [ pkgs.deadnix ] "deadnix --fail ${self}"; - nixfmt = mkCheck "check-nixfmt" [ pkgs.nixfmt-rfc-style ] "nixfmt --check ${self}"; + nixfmt = mkCheck "check-nixfmt" [ pkgs.nixfmt-rfc-style ] "nixfmt --check ${self}/**.nix"; statix = mkCheck "check-statix" [ pkgs.statix ] "statix check ${self}"; } ); @@ -86,5 +89,11 @@ standard = "Minimal boilerplate for my Flakes"; nixos = "Minimal boilerplate for a Flake-based NixOS configuration"; }; + + hydraJobs = forTier1Systems (system: { + all-packages = nixpkgsFor.${system}.linkFarm "all-packages" ( + lib.mapAttrs (lib.const (deriv: deriv.outPath or deriv)) self.packages.${system} + ); + }); }; } -- cgit v1.2.3