diff --git a/flake.nix b/flake.nix index 3902010..2996103 100644 --- a/flake.nix +++ b/flake.nix @@ -39,6 +39,20 @@ ]; } // builtins.removeAttrs args [ "modules" ] ); + mkFlake = flakeDef: + let + rewritePerSystem = sectionDef: (forAllSystems (system: + builtins.mapAttrs (name: value: + nixpkgs.legacyPackages.${system}.callPackage value {} + ) sectionDef + )); + in + builtins.mapAttrs (name: value: + if name == "packages" || name == "legacyPackages" || name == "devShells" then + rewritePerSystem value + else + value + ) flakeDef; }); legacyPackages = forAllSystems (system: