Skyler Grey | e6a8c71 | 2024-06-22 01:41:28 +0000 | [diff] [blame] | 1 | # SPDX-FileCopyrightText: 2024 Clicks Codes |
| 2 | # |
| 3 | # SPDX-License-Identifier: GPL-3.0-only |
| 4 | |
| 5 | { |
| 6 | lib, |
| 7 | inputs, |
| 8 | ... |
| 9 | }: { |
| 10 | checks = pkgs: { |
| 11 | nix-unit = pkgs.stdenv.mkDerivation { |
| 12 | name = "run nix-unit"; |
| 13 | src = ./../..; |
| 14 | buildPhase = let |
| 15 | getSubInputs = prefix: inputs: lib.trivial.pipe inputs [ |
| 16 | (lib.attrsets.mapAttrsToList (name: value: [ |
| 17 | "--override-input ${prefix}${name} ${value.outPath}" |
| 18 | (if value ? inputs |
| 19 | then getSubInputs "${prefix}${name}/" value.inputs |
| 20 | else []) |
| 21 | ])) |
| 22 | lib.lists.flatten |
| 23 | (builtins.concatStringsSep " ") |
| 24 | ]; |
| 25 | inputPathArgs = getSubInputs "" inputs; |
| 26 | in '' |
| 27 | export HOME="$(realpath .)" |
| 28 | ${pkgs.lib.getExe pkgs.nix-unit} \ |
| 29 | --eval-store $HOME \ |
| 30 | --flake \ |
| 31 | --option extra-experimental-features flakes \ |
Skyler Grey | 4d6b6a4 | 2024-08-05 18:08:19 +0000 | [diff] [blame^] | 32 | --show-trace \ |
Skyler Grey | e6a8c71 | 2024-06-22 01:41:28 +0000 | [diff] [blame] | 33 | ${inputPathArgs} \ |
| 34 | .#specs.${pkgs.system} |
| 35 | touch $out |
| 36 | ''; |
| 37 | }; |
| 38 | }; |
| 39 | } |