2 Nixpkgs unfree+redistributable packages.
4 NOTE: This file is used by the sister nix-community project.
6 The official Hydra instance only builds and provides binary caches for free
7 packages (as in OSI-approved).
9 Some unfree packages such as MongoDB, ZeroTier, ... take a while to be
10 built. While their license is not free, they allow redistribution of
13 The sister project nix-community will build and distribute those packages
14 for a subset of the channels to <https://nix-community.cachix.org>.
18 * <https://hydra.nix-community.org/jobset/nixpkgs/unfree-redistributable>
19 * <https://github.com/nix-community/infra/pull/1406>
21 Test for example like this:
23 $ hydra-eval-jobs pkgs/top-level/release-unfree-redistributable.nix -I .
27 # The platforms for which we build Nixpkgs.
32 # Attributes passed to nixpkgs.
41 # We only build the full package set on infrequently releasing channels.
46 release-lib = import ./release-lib.nix {
47 inherit supportedSystems nixpkgsArgs;
56 # similar to release-lib.packagePlatforms, but also includes some condition for which package to pick
62 attrPath = if prefix == "" then name else "${prefix}.${name}";
63 res = builtins.tryEval (
64 if lib.isDerivation value then
65 lib.optionals (cond attrPath value) (
66 # logic copied from release-lib packagePlatforms
67 value.meta.hydraPlatforms
68 or (lib.subtractLists (value.meta.badPlatforms or [ ]) (value.meta.platforms or [ "x86_64-linux" ]))
71 value.recurseForDerivations or false
72 || value.recurseForRelease or false
73 || value.__recurseIntoDerivationForReleaseJobs or false
76 packagesWith attrPath cond value
81 lib.optionals res.success res.value
84 # Unfree is any license not OSI-approved.
85 isUnfree = pkg: lib.lists.any (l: !(l.free or true)) (lib.lists.toList (pkg.meta.license or [ ]));
87 # Whenever the license allows re-distribution of the binaries
89 pkg: lib.lists.any (l: l.redistributable or false) (lib.lists.toList (pkg.meta.license or [ ]));
92 pkg: !lib.lists.any (x: !(x.isSource)) (lib.lists.toList (pkg.meta.sourceProvenance or [ ]));
95 attrPath: !(lib.hasPrefix "linuxKernel" attrPath || lib.hasPrefix "linuxPackages" attrPath);
97 # This is handled by release-cuda.nix
98 isNotCudaPackage = attrPath: !(lib.hasPrefix "cuda" attrPath);
102 # requireFile don't allow using substituters and are therefor skipped
103 pkg.src.allowSubstitutes or true;
108 && (isRedistributable pkg)
110 && (canSubstituteSrc pkg)
114 # We only build these heavy packages on releases
115 ((isNotCudaPackage attrPath) && (isNotLinuxKernel attrPath))
118 packages = packagesWith "" cond pkgs;
120 jobs = mapTestOn packages;