1{ maintainer }:
2let
3 pkgs = import ./../../default.nix {
4 config.allowAliases = false;
5 };
6 inherit (pkgs) lib;
7 maintainer_ = pkgs.lib.maintainers.${maintainer};
8 packagesWith =
9 cond: return: prefix: set:
10 (lib.flatten (
11 lib.mapAttrsToList (
12 name: pkg:
13 let
14 result = builtins.tryEval (
15 if lib.isDerivation pkg && cond name pkg then
16 # Skip packages whose closure fails on evaluation.
17 # This happens for pkgs like `python27Packages.djangoql`
18 # that have disabled Python pkgs as dependencies.
19 builtins.seq pkg.outPath [ (return "${prefix}${name}") ]
20 else if
21 pkg.recurseForDerivations or false || pkg.recurseForRelease or false
22 # then packagesWith cond return pkg
23 then
24 packagesWith cond return "${name}." pkg
25 else
26 [ ]
27 );
28 in
29 if result.success then result.value else [ ]
30 ) set
31 ));
32
33 packages = packagesWith (
34 name: pkg:
35 (
36 if builtins.hasAttr "meta" pkg && builtins.hasAttr "maintainers" pkg.meta then
37 (
38 if builtins.isList pkg.meta.maintainers then
39 builtins.elem maintainer_ pkg.meta.maintainers
40 else
41 maintainer_ == pkg.meta.maintainers
42 )
43 else
44 false
45 )
46 ) (name: name) "" pkgs;
47
48in
49pkgs.stdenv.mkDerivation {
50 name = "nixpkgs-update-script";
51 buildInputs = [ pkgs.hydra-check ];
52 buildCommand = ''
53 echo ""
54 echo "----------------------------------------------------------------"
55 echo ""
56 echo "nix-shell maintainers/scripts/check-hydra-by-maintainer.nix --argstr maintainer SuperSandro2000"
57 echo ""
58 echo "----------------------------------------------------------------"
59 exit 1
60 '';
61 shellHook = ''
62 unset shellHook # do not contaminate nested shells
63 echo "Please stand by"
64 echo nix-shell -p hydra-check --run "hydra-check ${builtins.concatStringsSep " " packages}"
65 nix-shell -p hydra-check --run "hydra-check ${builtins.concatStringsSep " " packages}"
66 exit $?
67 '';
68}