diff options
| author | Seth Flynn <[email protected]> | 2025-01-29 13:52:32 -0500 |
|---|---|---|
| committer | Seth Flynn <[email protected]> | 2025-01-29 13:52:32 -0500 |
| commit | 8126a8ab097699269a558d5972a0e0dd6f2c98d2 (patch) | |
| tree | 2eff0c4d1c75abdc5f1dd067b7510986d357f4d1 /flake.nix | |
| parent | 46f1cf5b41e06a833c2521a3eb2b71c6fcbc2f46 (diff) | |
firefox-addons: initfirefox-addons
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 29 |
1 files changed, 19 insertions, 10 deletions
@@ -52,16 +52,25 @@ getchpkgs = import ./default.nix { inherit pkgs; }; - getchpkgs' = lib.filterAttrs (lib.const ( - deriv: - let - isCross = deriv.stdenv.buildPlatform != deriv.stdenv.hostPlatform; - availableOnHost = lib.meta.availableOn pkgs.stdenv.hostPlatform deriv; - # `nix flake check` doesn't like broken packages - isBroken = deriv.meta.broken or false; - in - isCross || availableOnHost && (!isBroken) - )) getchpkgs; + getchpkgs' = + # Find valid installables + lib.filterAttrs + (lib.const ( + deriv: + let + isCross = deriv.stdenv.buildPlatform != deriv.stdenv.hostPlatform; + availableOnHost = lib.meta.availableOn pkgs.stdenv.hostPlatform deriv; + # `nix flake check` doesn't like broken packages + isBroken = deriv.meta.broken or false; + isFunction = lib.isFunction deriv; + in + (!isFunction) && (isCross || availableOnHost) && (!isBroken) + )) + # Flatten `firefox-addons` package set + ( + lib.removeAttrs getchpkgs [ "firefox-addons" ] + // lib.mapAttrs' (name: lib.nameValuePair "firefox-addons-${name}") getchpkgs.firefox-addons + ); in getchpkgs' // { default = getchpkgs'.treefetch or pkgs.emptyFile; } |
