don't create packages for targets that are null

This commit is contained in:
Mitchell Hashimoto 2022-08-22 19:41:08 -07:00
parent 5ce840257e
commit 0e4d9404dd
No known key found for this signature in database
GPG key ID: 523D5DC389D273BC
2 changed files with 23 additions and 20 deletions

View file

@ -26,7 +26,9 @@ let
# The packages that are tagged releases
taggedPackages = lib.attrsets.mapAttrs
(k: v: mkBinaryInstall { inherit (v.${system}) version url sha256; })
(builtins.removeAttrs sources ["master"]);
(lib.attrsets.filterAttrs
(k: v: (builtins.hasAttr system v) && (v.${system}.url != null))
(builtins.removeAttrs sources ["master"]));
# The master packages
masterPackages = lib.attrsets.mapAttrs'

View file

@ -10,7 +10,7 @@
# List of systems where binaries are provided.
let
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];
in flake-utils.lib.eachSystem systems (system:
outputs = flake-utils.lib.eachSystem systems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in rec {
# The packages exported by the Flake:
@ -26,11 +26,12 @@
default = apps.zig;
zig = flake-utils.lib.mkApp { drv = packages.default; };
};
});
in outputs // {
# Overlay that can be imported so you can access the packages
# using zigpkgs.master.latest or whatever you'd like.
overlay = final: prev: {
zigpkgs = packages.${prev.system};
overlays.default = final: prev: {
zigpkgs = outputs.packages.${prev.system};
};
};
});
}