aboutsummaryrefslogtreecommitdiff
path: root/default.nix
blob: 3732baeaf8c8de8899be356e67bf032021632685 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ pkgs }:
self: super:
let
  default-derivation = { name, version-prefix, version, check-inputs, ... }:
    pkgs.stdenv.mkDerivation rec {
      inherit name version;

      checkInputs = map (p: pkgs."${p}") check-inputs;
      doCheck = true;

      src = fetchTarball {
        url =
          "https://git.euandreh.xyz/${name}/snapshot/${name}-${version-prefix}${version}.tar.gz";
      };
      makeFlags = [
        # This shouldn't be necessary, but
        # the `stdenv.mkDerivation' environment doesn't provide a c99 variable
        "CC=cc"
      ];

      meta = with pkgs.lib; {
        description = readFile "${src}/description";
        longDescription = readFile "${src}/long-description";
        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 = pkgs.lib.fold ({ name, ... }@project:
    acc:
    acc // {
      "${name}" = default-derivation project;
    }) { } (builtins.fromJSON (builtins.readFile ./packages.json)).packages;
}