From 5bcff37bc172020c3fa26f6ba4bab537c8949133 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 30 Oct 2022 06:58:53 -0400 Subject: [PATCH] checks: Use mkTransposedPerSystemModule --- modules/checks.nix | 43 ++++++++++--------------------------------- 1 file changed, 10 insertions(+), 33 deletions(-) diff --git a/modules/checks.nix b/modules/checks.nix index 4fbb0af..12dde09 100644 --- a/modules/checks.nix +++ b/modules/checks.nix @@ -1,44 +1,21 @@ { config, lib, flake-parts-lib, ... }: let inherit (lib) - filterAttrs - mapAttrs mkOption - optionalAttrs types ; inherit (flake-parts-lib) - mkSubmoduleOptions - mkPerSystemOption + mkTransposedPerSystemModule ; in -{ - options = { - flake = mkSubmoduleOptions { - checks = mkOption { - type = types.lazyAttrsOf (types.lazyAttrsOf types.package); - default = { }; - description = '' - Derivations to be built by nix flake check. - ''; - }; - }; - - perSystem = mkPerSystemOption ({ config, system, ... }: { - _file = ./checks.nix; - options = { - checks = mkOption { - type = types.lazyAttrsOf types.package; - default = { }; - description = '' - Derivations to be built by nix flake check. - ''; - }; - }; - }); - - }; - config = { - transposition.checks = { }; +mkTransposedPerSystemModule { + name = "checks"; + option = mkOption { + type = types.lazyAttrsOf types.package; + default = { }; + description = '' + Derivations to be built by nix flake check. + ''; }; + file = ./checks.nix; }