1
0
Fork 0
mirror of https://github.com/mitchellh/zig-overlay.git synced 2025-05-08 18:46:02 +03:00

Initial commit based on original arqv repository

This commit is contained in:
Mitchell Hashimoto 2022-08-22 15:56:44 -07:00
commit 223a4e3b2c
No known key found for this signature in database
GPG key ID: 523D5DC389D273BC
8 changed files with 2754 additions and 0 deletions

46
default.nix Normal file
View file

@ -0,0 +1,46 @@
{ pkgs ? import <nixpkgs> {},
system ? builtins.currentSystem }:
let inherit (pkgs) lib;
releases = builtins.fromJSON (lib.strings.fileContents ./sources.json);
in lib.attrsets.mapAttrs (k: v:
if k == "master" then
lib.attrsets.mapAttrs (k: v:
(pkgs.stdenv.mkDerivation {
pname = "zig";
inherit (v.${system}) version;
src = pkgs.fetchurl {
inherit (v.${system}) url sha256;
};
dontConfigure = true;
dontBuild = true;
dontFixup = true;
installPhase = ''
mkdir -p $out/{doc,bin,lib}
cp -r docs/* $out/doc
cp -r lib/* $out/lib
cp zig $out/bin/zig
'';
}))
v
else
pkgs.stdenv.mkDerivation {
pname = "zig";
inherit (v.${system}) version;
src = pkgs.fetchurl {
inherit (v.${system}) url sha256;
};
dontConfigure = true;
dontBuild = true;
dontFixup = true;
installPhase = ''
mkdir -p $out/{doc,bin,lib}
cp -r ${if k == "0.6.0" then "doc/*"
else
if k == "0.7.0" then "langref.html"
else "docs/*"} $out/doc
cp -r lib/* $out/lib
cp zig $out/bin/zig
'';
})
releases