diff options
author | EuAndreh <eu@euandre.org> | 2021-02-08 17:13:41 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-02-08 17:13:41 -0300 |
commit | 3a44b4ee83dd9d8ef0497597a8c1391431925564 (patch) | |
tree | e933e06606ee1449820b3388ae866fb6cedde605 | |
parent | default.nix: Remove sha256 from fetchTarball (diff) | |
download | package-repository-3a44b4ee83dd9d8ef0497597a8c1391431925564.tar.gz package-repository-3a44b4ee83dd9d8ef0497597a8c1391431925564.tar.xz |
default.nix: Get package versions from package.json
-rw-r--r-- | default.nix | 30 | ||||
-rw-r--r-- | packages.json | 16 |
2 files changed, 28 insertions, 18 deletions
diff --git a/default.nix b/default.nix index 851d767..142f048 100644 --- a/default.nix +++ b/default.nix @@ -1,12 +1,13 @@ { pkgs }: self: super: let - default-derivation = { pname, version-prefix, version }: + default-derivation = { name, version-prefix, version, ... }: pkgs.stdenv.mkDerivation rec { - inherit pname version; + inherit name version; src = fetchTarball { - url = "https://git.euandreh.xyz/${pname}/snapshot/${pname}-${version-prefix}${version}.tar.gz"; + url = + "https://git.euandreh.xyz/${name}/snapshot/${name}-${version-prefix}${version}.tar.gz"; }; makeFlags = [ # This shouldn't be necessary, but @@ -17,24 +18,17 @@ let meta = with pkgs.lib; { description = readFile "${src}/description"; longDescription = readFile "${src}/long-description"; - homepage = "https://${pname}.euandreh.xyz"; - changelog = "https://${pname}.euandreh.xyz/CHANGELOG.html"; - downloadPage = "https://${pname}.euandreh.xyz/#releases"; + homepage = "https://${name}.euandreh.xyz"; + changelog = "https://${name}.euandreh.xyz/CHANGELOG.html"; + downloadPage = "https://${name}.euandreh.xyz/#releases"; license = licenses.agpl3; platforms = platforms.unix; }; }; in { - xyz-euandreh = { - remembering = default-derivation { - pname = "remembering"; - version-prefix = ""; - version = "cca66c6f53e8bce857faae88368c0b07e6ace9e1"; - }; - autoqemu = default-derivation { - pname = "autoqemu"; - version-prefix = ""; - version = "5c44e0d0fa46ccd35c28e48849fcd5153fe41e5a"; - }; - }; + xyz-euandreh = pkgs.lib.fold ({ name, ... }@project: + acc: + acc // { + "${name}" = default-derivation project; + }) { } (builtins.fromJSON (builtins.readFile ./packages.json)).packages; } diff --git a/packages.json b/packages.json new file mode 100644 index 0000000..2bc4403 --- /dev/null +++ b/packages.json @@ -0,0 +1,16 @@ +{ + "packages": [ + { + "name": "remembering", + "version-prefix": "", + "version": "cca66c6f53e8bce857faae88368c0b07e6ace9e1", + "tarball-sha256": "1b90cpnv9p6p1cggiv6kp2q6v6lqhsv2q1zk6djnylfzzc8hszay" + }, + { + "name": "autoqemu", + "version-prefix": "", + "version": "5c44e0d0fa46ccd35c28e48849fcd5153fe41e5a", + "tarball-sha256": "15zxy86dvahshrghngkb70g6bc0cvz7h547vmh4fkaxgh8zh5ahg" + } + ] +} |