mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
maintainers/scripts/build.nix: script to build all maintainer packages
This commit is contained in:
parent
d4c2f1ab5d
commit
d0c3e7bedb
43
maintainers/scripts/build.nix
Normal file
43
maintainers/scripts/build.nix
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
{ maintainer }:
|
||||||
|
|
||||||
|
# based on update.nix
|
||||||
|
# nix-build build.nix --argstr maintainer <yourname>
|
||||||
|
|
||||||
|
let
|
||||||
|
pkgs = import ./../../default.nix {};
|
||||||
|
maintainer_ = pkgs.lib.maintainers.${maintainer};
|
||||||
|
packagesWith = cond: return: set:
|
||||||
|
(pkgs.lib.flatten
|
||||||
|
(pkgs.lib.mapAttrsToList
|
||||||
|
(name: pkg:
|
||||||
|
let
|
||||||
|
result = builtins.tryEval
|
||||||
|
(
|
||||||
|
if pkgs.lib.isDerivation pkg && cond name pkg
|
||||||
|
then [ (return name pkg) ]
|
||||||
|
else if pkg.recurseForDerivations or false || pkg.recurseForRelease or false
|
||||||
|
then packagesWith cond return pkg
|
||||||
|
else [ ]
|
||||||
|
);
|
||||||
|
in
|
||||||
|
if result.success then result.value
|
||||||
|
else [ ]
|
||||||
|
)
|
||||||
|
set
|
||||||
|
)
|
||||||
|
);
|
||||||
|
in
|
||||||
|
packagesWith
|
||||||
|
(name: pkg:
|
||||||
|
(
|
||||||
|
if builtins.hasAttr "maintainers" pkg.meta
|
||||||
|
then (
|
||||||
|
if builtins.isList pkg.meta.maintainers
|
||||||
|
then builtins.elem maintainer_ pkg.meta.maintainers
|
||||||
|
else maintainer_ == pkg.meta.maintainers
|
||||||
|
)
|
||||||
|
else false
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(name: pkg: pkg)
|
||||||
|
pkgs
|
Loading…
Reference in New Issue
Block a user