From 9acb7928a34273d5f3c27bceaa6986618835864f Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 6 Jan 2024 15:39:36 +0100 Subject: [PATCH 1/3] flake/packages: exclude docs from packages on darwin --- flake-modules/checks.nix | 45 +++++++++++++++++--------------------- flake-modules/packages.nix | 4 +++- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/flake-modules/checks.nix b/flake-modules/checks.nix index bb168bf809..b6ffeff892 100644 --- a/flake-modules/checks.nix +++ b/flake-modules/checks.nix @@ -6,33 +6,28 @@ makeNixvimWithModule, ... }: { - checks = - { - tests = import ../tests { - inherit pkgs; - inherit (pkgs) lib; - makeNixvim = configuration: - makeNixvimWithModuleUnfree { - module = { - config = configuration; - }; + checks = { + tests = import ../tests { + inherit pkgs; + inherit (pkgs) lib; + makeNixvim = configuration: + makeNixvimWithModuleUnfree { + module = { + config = configuration; }; - }; + }; + }; - extra-args-tests = import ../tests/extra-args.nix { - inherit pkgs; - inherit makeNixvimWithModule; - }; + extra-args-tests = import ../tests/extra-args.nix { + inherit pkgs; + inherit makeNixvimWithModule; + }; - lib-tests = import ../tests/lib-tests.nix { - inherit pkgs; - inherit (pkgs) lib; - }; - } - # Do not check if documentation builds fine on darwin as it fails: - # > sandbox-exec: pattern serialization length 69298 exceeds maximum (65535) - // (pkgs.lib.optionalAttrs (!pkgs.stdenv.isDarwin) { - inherit (config.packages) docs; - }); + lib-tests = import ../tests/lib-tests.nix { + inherit pkgs; + inherit (pkgs) lib; + }; + docs = config.packages.docs ? null; + }; }; } diff --git a/flake-modules/packages.nix b/flake-modules/packages.nix index dc3a777624..23b9d1aa64 100644 --- a/flake-modules/packages.nix +++ b/flake-modules/packages.nix @@ -7,7 +7,9 @@ ... }: { packages = let - docs = { + # Do not check if documentation builds fine on darwin as it fails: + # > sandbox-exec: pattern serialization length 69298 exceeds maximum (65535) + docs = pkgs.lib.optionalAttrs (!pkgs.stdenv.isDarwin) { docs = pkgsUnfree.callPackage (import ../docs) { inherit modules; }; From 79683b3aa29cd114530408054af15266147c3d80 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 6 Jan 2024 15:55:29 +0100 Subject: [PATCH 2/3] flake/packages: test all packages by default --- flake-modules/checks.nix | 1 - flake-modules/packages.nix | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/flake-modules/checks.nix b/flake-modules/checks.nix index b6ffeff892..48b55865fc 100644 --- a/flake-modules/checks.nix +++ b/flake-modules/checks.nix @@ -27,7 +27,6 @@ inherit pkgs; inherit (pkgs) lib; }; - docs = config.packages.docs ? null; }; }; } diff --git a/flake-modules/packages.nix b/flake-modules/packages.nix index 23b9d1aa64..8d85505a54 100644 --- a/flake-modules/packages.nix +++ b/flake-modules/packages.nix @@ -22,5 +22,8 @@ in docs // man-docs; + + # Test that all packages build fine when running `nix flake check`. + checks = config.packages; }; } From b96b3ac0e9fd89890e31328c20567ced2b33db55 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 6 Jan 2024 15:55:50 +0100 Subject: [PATCH 3/3] flake: checks.nix -> tests.nix --- flake-modules/default.nix | 2 +- flake-modules/{checks.nix => tests.nix} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename flake-modules/{checks.nix => tests.nix} (100%) diff --git a/flake-modules/default.nix b/flake-modules/default.nix index 2e8997c3cd..057d6dff72 100644 --- a/flake-modules/default.nix +++ b/flake-modules/default.nix @@ -1,6 +1,5 @@ {inputs, ...}: { imports = [ - ./checks.nix ./dev.nix ./lib.nix ./legacy-packages.nix @@ -8,6 +7,7 @@ ./overlays.nix ./packages.nix ./templates.nix + ./tests.nix ./wrappers.nix ]; diff --git a/flake-modules/checks.nix b/flake-modules/tests.nix similarity index 100% rename from flake-modules/checks.nix rename to flake-modules/tests.nix