From db1b484d986440256b32c898dd44985bf98401c0 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Wed, 16 Oct 2024 08:34:44 -0700 Subject: [PATCH] flake.nix: exclude armv6-linux and riscv64-linux from checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise, `nix flake check --all-systems --json` fails with: error: … while calling the 'head' builtin at /nix/store/0jy5khqx0rfw8avcq6z5zaxaj2ppz8d3-source/lib/attrsets.nix:1575:11: 1574| || pred here (elemAt values 1) (head values) then 1575| head values | ^ 1576| else … while evaluating the attribute 'value' at /nix/store/0jy5khqx0rfw8avcq6z5zaxaj2ppz8d3-source/lib/modules.nix:816:9: 815| in warnDeprecation opt // 816| { value = addErrorContext "while evaluating the option `${showOption loc}':" value; | ^ 817| inherit (res.defsFinal') highestPrio; … while evaluating the option `system.build.toplevel': … while evaluating definitions from `/nix/store/0jy5khqx0rfw8avcq6z5zaxaj2ppz8d3-source/nixos/modules/system/activation/top-level.nix': … while evaluating the option `system.systemBuilderArgs': … while evaluating definitions from `/nix/store/0jy5khqx0rfw8avcq6z5zaxaj2ppz8d3-source/nixos/modules/system/activation/activatable-system.nix': … while evaluating the option `system.activationScripts.etc.text': … while evaluating definitions from `/nix/store/0jy5khqx0rfw8avcq6z5zaxaj2ppz8d3-source/nixos/modules/system/etc/etc-activation.nix': … while evaluating definitions from `/nix/store/0jy5khqx0rfw8avcq6z5zaxaj2ppz8d3-source/nixos/modules/system/etc/etc.nix': … while evaluating the option `environment.etc.dbus-1.source': (stack trace truncated; use '--show-trace' to show the full, detailed trace) error: cannot bootstrap GHC on this platform ('riscv64-linux' with libc 'defaultLibc') --- flake.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 950eb2b5c4d1..f67d2724bce8 100644 --- a/flake.nix +++ b/flake.nix @@ -80,8 +80,17 @@ checks = forAllSystems (system: { tarball = jobs.${system}.tarball; - # Exclude power64 due to "libressl is not available on the requested hostPlatform" with hostPlatform being power64 - } // lib.optionalAttrs (self.legacyPackages.${system}.stdenv.hostPlatform.isLinux && !self.legacyPackages.${system}.targetPlatform.isPower64) { + } // lib.optionalAttrs + ( + self.legacyPackages.${system}.stdenv.hostPlatform.isLinux + # Exclude power64 due to "libressl is not available on the requested hostPlatform" with hostPlatform being power64 + && !self.legacyPackages.${system}.targetPlatform.isPower64 + # Exclude armv6l-linux due to "cannot bootstrap GHC on this platform ('armv6l-linux' with libc 'defaultLibc')" + && system != "armv6l-linux" + # Exclude riscv64-linux due to "cannot bootstrap GHC on this platform ('riscv64-linux' with libc 'defaultLibc')" + && system != "riscv64-linux" + ) + { # Test that ensures that the nixosSystem function can accept a lib argument # Note: prefer not to extend or modify `lib`, especially if you want to share reusable modules # alternatives include: `import` a file, or put a custom library in an option or in `_module.args.`