From fdd87732fd8091e8fd7e59572fd70f5c45399ed1 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 17 May 2022 10:10:07 +0200 Subject: [PATCH] Move perSystem.legacyPackages into options --- modules/legacyPackages.nix | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/modules/legacyPackages.nix b/modules/legacyPackages.nix index b2c9381..5263cd4 100644 --- a/modules/legacyPackages.nix +++ b/modules/legacyPackages.nix @@ -9,6 +9,7 @@ let ; inherit (flake-modules-core-lib) mkSubmoduleOptions + mkPerSystemOption ; in { @@ -22,7 +23,20 @@ in ''; }; }; + + perSystem = mkPerSystemOption ({ config, ... }: { + options = { + legacyPackages = mkOption { + type = types.lazyAttrsOf types.anything; + default = { }; + description = '' + An attribute set of anything. This is also used by nix build .#<attrpath>. + ''; + }; + }; + }); }; + config = { flake.legacyPackages = mapAttrs @@ -37,17 +51,5 @@ in legacyPackages = flake.legacyPackages.${system}; }; - perSystem = system: { config, ... }: { - _file = ./legacyPackages.nix; - options = { - legacyPackages = mkOption { - type = types.lazyAttrsOf types.anything; - default = { }; - description = '' - An attribute set of anything. This is also used by nix build .#<attrpath>. - ''; - }; - }; - }; }; }