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 # The packages that are tagged releases
taggedPackages = lib.attrsets.mapAttrs taggedPackages = lib.attrsets.mapAttrs
(k: v: mkBinaryInstall { inherit (v.${system}) version url sha256; }) (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 # The master packages
masterPackages = lib.attrsets.mapAttrs' masterPackages = lib.attrsets.mapAttrs'

View file

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