-
-
Save msteen/a40d5b16d0b283c903f230b98ec9df63 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
json=$(nix eval --json '( | |
with builtins; | |
with import <nixpkgs/nixos> { }; | |
with pkgs.lib; | |
let try = x: default: let res = tryEval x; in if res.success then res.value else default; in | |
groupBy | |
(x: x.meta.license.shortName) | |
(concatMap (pkg: | |
try ( | |
let x = map (pkg: { inherit (pkg) name; meta = { inherit (pkg.meta) license; }; }) | |
(filter (pkg: pkg.meta ? license && pkg.meta.license ? shortName) [ pkg ]); | |
in deepSeq x x) [] | |
) config.environment.systemPackages) | |
)') && jq '.' <<< "$json" > packages.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment