let pkgs = import ../../../clones/nixpkgs { }; lib = pkgs.lib; dbFile = builtins.storePath ; dbJson = pkgs.runCommand "json" { } '' ${lib.getExe pkgs.sqlite} ${dbFile} '.mode json' " SELECT package, system, json_group_array(name) AS names FROM Programs WHERE system = 'x86_64-linux' GROUP BY package, system; " > $out ''; programs = lib.importJSON dbJson; # the channel is older than nixpkgs master, so some attributes may no longer exist # (but we edit on master, hence need that for e.g. positions) stillExists = row: lib.hasAttrByPath (lib.splitString "." row.package) pkgs; programs2 = lib.filter stillExists programs; getPackage = e: lib.getAttrFromPath (lib.splitString "." e) pkgs; isTrivial = row: builtins.length (builtins.fromJSON row.names) == 1 && !((getPackage row.package).meta ? "mainProgram"); missing = lib.filter isTrivial programs2; in pkgs.writeText "missing" (builtins.toJSON (map (row: { pos = (getPackage row.package).meta.position or null; name = builtins.head (builtins.fromJSON row.names); }) missing))