logoalt Hacker News

tom_alexander • today at 4:05 AM • 1 reply • view on HN

> Ask nixpkgs a question in a loop. Interrogate and explore nixpkgs in a REPL

  nix repl --expr 'builtins.getFlake "github:NixOS/nixpkgs/nixos-unstable"'

  nix-repl> builtins.filter (name: lib.licenses."${name}" ? spdxId && lib.strings.hasPrefix "GPL" lib.licenses."${name}".spdxId) (builtins.attrNames lib.licenses)
  [
    "gpl1Only"
    "gpl1Plus"
    "gpl2"
    "gpl2Only"
    "gpl2Plus"
    "gpl3"
    "gpl3Only"
    "gpl3Plus"
  ]

Replies