forked from extern/flakelight
Remove checking of meta.platforms
Previously, meta.platforms would be checked for each package when generating package attributes for a system, so that unsupported packages would not have an output attribute. This commit removes that behavior. Now `nix flake show` will succeed even if packages fail to evaluate on other platforms. `nix flake show --all-systems` will still fail though.
This commit is contained in:
parent
fe5916eb40
commit
3a364f9cdd
@ -4,10 +4,9 @@
|
||||
|
||||
{ config, lib, flakelight, genSystems, moduleArgs, ... }:
|
||||
let
|
||||
inherit (lib) filterAttrs functionArgs mapAttrs mkIf mkMerge mkOption;
|
||||
inherit (lib) functionArgs mapAttrs mkIf mkMerge mkOption;
|
||||
inherit (lib.types) coercedTo lazyAttrsOf lines listOf
|
||||
package str submoduleWith;
|
||||
inherit (flakelight) supportedSystem;
|
||||
inherit (flakelight.types) function nullable optCallWith optFunctionTo;
|
||||
|
||||
devShellModule.options = {
|
||||
@ -82,8 +81,7 @@ in
|
||||
|
||||
(mkIf (config.devShells != { }) {
|
||||
outputs.devShells = genSystems (pkgs:
|
||||
filterAttrs (_: supportedSystem pkgs)
|
||||
(mapAttrs (_: v: genDevShell pkgs (v pkgs)) config.devShells));
|
||||
mapAttrs (_: v: genDevShell pkgs (v pkgs)) config.devShells);
|
||||
})
|
||||
];
|
||||
}
|
||||
|
@ -5,10 +5,9 @@
|
||||
{ config, lib, inputs, flakelight, genSystems, moduleArgs, ... }:
|
||||
let
|
||||
inherit (builtins) hasAttr parseDrvName tryEval;
|
||||
inherit (lib) filterAttrs findFirst functionArgs mapAttrs' mapAttrs mkIf
|
||||
mkMerge mkOption nameValuePair optionalAttrs;
|
||||
inherit (lib) findFirst functionArgs mapAttrs' mapAttrs mkIf mkMerge mkOption
|
||||
nameValuePair optionalAttrs;
|
||||
inherit (lib.types) lazyAttrsOf str uniq;
|
||||
inherit (flakelight) supportedSystem;
|
||||
inherit (flakelight.types) nullable optCallWith overlay packageDef;
|
||||
|
||||
genPkg = final: prev: name: pkg:
|
||||
@ -90,8 +89,7 @@ in
|
||||
|
||||
outputs = rec {
|
||||
packages = genSystems (pkgs:
|
||||
filterAttrs (_: supportedSystem pkgs)
|
||||
(mapAttrs (k: _: pkgs.${k}) config.packages));
|
||||
mapAttrs (k: _: pkgs.${k}) config.packages);
|
||||
|
||||
checks = mapAttrs
|
||||
(_: mapAttrs' (n: nameValuePair ("packages-" + n)))
|
||||
|
@ -37,8 +37,7 @@ let
|
||||
};
|
||||
|
||||
flakelight = {
|
||||
inherit autoImport autoImportArgs importDir mkFlake selectAttr
|
||||
supportedSystem types;
|
||||
inherit autoImport autoImportArgs importDir mkFlake selectAttr types;
|
||||
};
|
||||
|
||||
types = rec {
|
||||
@ -154,9 +153,6 @@ let
|
||||
};
|
||||
};
|
||||
|
||||
supportedSystem = { lib, stdenv, ... }:
|
||||
lib.meta.availableOn stdenv.hostPlatform;
|
||||
|
||||
importDir = path: genAttrs
|
||||
(pipe (readDir path) [
|
||||
attrNames
|
||||
|
Loading…
Reference in New Issue
Block a user