From 4835e05925b0b6e25ab2fb7b0bd0e012de6c906f Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Fri, 13 May 2022 10:15:21 +0200 Subject: [PATCH] Move perSystem.checks into options --- lib.nix | 2 +- modules/apps.nix | 1 + modules/checks.nix | 27 +++++++++++++++------------ 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/lib.nix b/lib.nix index f2b229e..4a70cfe 100644 --- a/lib.nix +++ b/lib.nix @@ -35,7 +35,7 @@ let shorthandOnlyDefinesConfig = false; }); - mkPerSystemModule = + mkPerSystemOption = module: mkOption { type = flake-modules-core-lib.mkPerSystemType module; diff --git a/modules/apps.nix b/modules/apps.nix index a72b4fe..0002755 100644 --- a/modules/apps.nix +++ b/modules/apps.nix @@ -9,6 +9,7 @@ let ; inherit (flake-modules-core-lib) mkSubmoduleOptions + mkPerSystemOption ; programType = lib.types.coercedTo lib.types.package getExe lib.types.str; diff --git a/modules/checks.nix b/modules/checks.nix index 39f653a..d20fc02 100644 --- a/modules/checks.nix +++ b/modules/checks.nix @@ -9,6 +9,7 @@ let ; inherit (flake-modules-core-lib) mkSubmoduleOptions + mkPerSystemOption ; in { @@ -22,6 +23,20 @@ in ''; }; }; + + 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 = { flake.checks = @@ -37,17 +52,5 @@ in checks = flake.checks.${system}; }; - perSystem = system: { config, ... }: { - _file = ./checks.nix; - options = { - checks = mkOption { - type = types.lazyAttrsOf types.package; - default = { }; - description = '' - Derivations to be built by nix flake check. - ''; - }; - }; - }; }; }