Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
base: e9526907cc36
Choose a base ref
...
head repository: NixOS/nixpkgs
compare: 788f61cf3ec5
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Apr 19, 2020

  1. meta: expose availability flags in derivation metadata

    Currently it's not possible to determine the reason why a package is
    unavailable without evaluating nixpkgs multiple times with different
    settings. eg.
    
        nix-repl> :p android-studio.meta
        { available = false; broken = false; unfree = true; unsupported = true; ... }
    
    The following snippet is an example that uses this information to query
    the availability information of all packages in nixpkgs, giving an
    overview of all the packages currently marked as broken, etc.
    
        { pkgs }:
    
        with import <nixpkgs/lib>;
    
        let
    
          mapPkgs =
            let mapPkgs' = path: f: mapAttrs (n: v:
              let result = builtins.tryEval (v ? meta); in
              if !result.success then {} else
              if isDerivation v then f (path ++ [n]) v else
              if isAttrs v && v.recurseForDerivations or false then mapPkgs' (path ++ [n]) f v else
              {}
            );
            in mapPkgs' [];
    
          getMeta = path: drv:
            if drv.meta ? available then
              let meta = {
                pkg = concatStringsSep "." path;
                inherit (drv.meta) broken unfree unsupported insecure;
              };
              in builtins.trace meta.pkg meta
              else {};
    
          metaToList = attrs: flatten (map (v: if v ? pkg then v else metaToList v) (attrValues attrs));
    
        in metaToList (mapPkgs getMeta pkgs)
    LnL7 committed Apr 19, 2020
    Copy the full SHA
    950ac2b View commit details
    Browse the repository at this point in the history

Commits on Nov 28, 2020

  1. Merge pull request #85545 from LnL7/meta-available-flags

    meta: expose availability flags in derivation metadata
    LnL7 committed Nov 28, 2020
    Copy the full SHA
    788f61c View commit details
    Browse the repository at this point in the history