diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-04-27 16:34:27 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-04-27 16:34:27 +0900 |
| commit | 939f02ceab3cecf66a399e50e72af46e4d277bd1 (patch) | |
| tree | 9e44341e8e4eab3911d8285ed5b0d3529a158c9c /ci.nix | |
| parent | f37e8e6866204551eae29aff5cecf706e8167edb (diff) | |
| download | nur-packages-939f02ceab3cecf66a399e50e72af46e4d277bd1.tar.gz nur-packages-939f02ceab3cecf66a399e50e72af46e4d277bd1.tar.zst nur-packages-939f02ceab3cecf66a399e50e72af46e4d277bd1.zip | |
treefmt
Diffstat (limited to 'ci.nix')
| -rw-r--r-- | ci.nix | 46 |
1 files changed, 29 insertions, 17 deletions
@@ -9,29 +9,42 @@ # then your CI will be able to build and cache only those packages for # which this is possible. -{ pkgs ? import <nixpkgs> { } }: +{ + pkgs ? import <nixpkgs> { }, +}: with builtins; let isReserved = n: n == "lib" || n == "overlays" || n == "modules"; isDerivation = p: isAttrs p && p ? type && p.type == "derivation"; - isBuildable = p: let - licenseFromMeta = p.meta.license or []; - licenseList = if builtins.isList licenseFromMeta then licenseFromMeta else [licenseFromMeta]; - in !(p.meta.broken or false) && builtins.all (license: license.free or true) licenseList; + isBuildable = + p: + let + licenseFromMeta = p.meta.license or [ ]; + licenseList = if builtins.isList licenseFromMeta then licenseFromMeta else [ licenseFromMeta ]; + in + !(p.meta.broken or false) && builtins.all (license: license.free or true) licenseList; isCacheable = p: !(p.preferLocalBuild or false); shouldRecurseForDerivations = p: isAttrs p && p.recurseForDerivations or false; - nameValuePair = n: v: { name = n; value = v; }; + nameValuePair = n: v: { + name = n; + value = v; + }; concatMap = builtins.concatMap or (f: xs: concatLists (map f xs)); - flattenPkgs = s: + flattenPkgs = + s: let - f = p: - if shouldRecurseForDerivations p then flattenPkgs p - else if isDerivation p then [ p ] - else [ ]; + f = + p: + if shouldRecurseForDerivations p then + flattenPkgs p + else if isDerivation p then + [ p ] + else + [ ]; in concatMap f (attrValues s); @@ -39,12 +52,11 @@ let nurAttrs = import ./default.nix { inherit pkgs; }; - nurPkgs = - flattenPkgs - (listToAttrs - (map (n: nameValuePair n nurAttrs.${n}) - (filter (n: !isReserved n) - (attrNames nurAttrs)))); + nurPkgs = flattenPkgs ( + listToAttrs ( + map (n: nameValuePair n nurAttrs.${n}) (filter (n: !isReserved n) (attrNames nurAttrs)) + ) + ); in rec { |
