mirror of
https://github.com/mitchellh/zig-overlay.git
synced 2025-05-08 18:46:02 +03:00
add an overlay, clean up package names for nix flake check
This commit is contained in:
parent
de6bcff2cf
commit
5ce840257e
3 changed files with 37 additions and 20 deletions
29
default.nix
29
default.nix
|
@ -23,25 +23,26 @@ let
|
|||
'';
|
||||
};
|
||||
|
||||
# The packages that are tagged releases
|
||||
taggedPackages = lib.attrsets.mapAttrs
|
||||
(k: v: mkBinaryInstall { inherit (v.${system}) version url sha256; })
|
||||
(builtins.removeAttrs sources ["master"]);
|
||||
|
||||
# The master packages
|
||||
masterPackages = lib.attrsets.mapAttrs'
|
||||
(k: v: lib.attrsets.nameValuePair
|
||||
(if k == "latest" then "master" else ("master-" + k))
|
||||
(mkBinaryInstall { inherit (v.${system}) version url sha256; })
|
||||
)
|
||||
sources.master;
|
||||
|
||||
# This determines the latest /released/ version.
|
||||
latest = lib.lists.last (
|
||||
builtins.sort
|
||||
(x: y: (builtins.compareVersions x y) < 0)
|
||||
(builtins.filter (x: x != "master") (builtins.attrNames sources))
|
||||
(builtins.attrNames taggedPackages)
|
||||
);
|
||||
|
||||
# This is the full list of packages
|
||||
packages = lib.attrsets.mapAttrs (k: v:
|
||||
if k == "master" then
|
||||
lib.attrsets.mapAttrs (k: v: (mkBinaryInstall {
|
||||
inherit (v.${system}) version url sha256;
|
||||
})) v
|
||||
else
|
||||
mkBinaryInstall {
|
||||
inherit (v.${system}) version url sha256;
|
||||
})
|
||||
sources;
|
||||
in
|
||||
# We want the packages but also add a "default" that just points to the
|
||||
# latest released version.
|
||||
packages // { "default" = packages.${latest}; }
|
||||
taggedPackages // masterPackages // { "default" = taggedPackages.${latest}; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue