about summary refs log tree commit diff
path: root/pkgs/development/python-modules/homf/tests.nix
blob: a883334ce40dc49ded7a96c0a328fb0489351f88 (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
38
39
40
41
42
43
{
  lib,
  runCommand,
  testers,

  cacert,
  homf,
}:
let
  # runs homf, putting the fetched artefacts in the drv output
  Homf =
    subcommand:
    {
      pkgName,
      version,
      hash,
    }:
    # testers.runCommand ensures we have an FOD, so the command has network access,
    #  yet the test is rerun whenever one of its inputs changes.
    testers.runCommand {
      name = "homf-${subcommand}-${pkgName}";
      script = "homf ${subcommand} --directory $out ${pkgName} ${version}";
      nativeBuildInputs = [
        cacert
        homf
      ];
      inherit hash;
    };
in

lib.mapAttrs Homf {
  pypi = {
    pkgName = "homf";
    version = "1.1.1"; # pinned so updating homf won't invalidate hashes
    hash = "sha256-zpdt7+zTaGkLG6xYoTZVw/kUek0/MrCqvljfLxNB94A=";
  };

  github = {
    pkgName = "duckinator/homf";
    version = "v1.1.1";
    hash = "sha256-NeEz8wZqDWYUnrgsknXWHzhWdk8cPW8mknKS3+/dngQ=";
  };
}