mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-11-09 16:18:34 +01:00
For known security vulnerabilities. Converts `pkgs/top-level/ruby-packages.nix` to a minimal `Gemfile.lock` for `bundler-audit`.
16 lines
513 B
Nix
16 lines
513 B
Nix
let
|
|
pkgs = import ../../.. { };
|
|
lockFileBody = pkgs.lib.concatStringsSep "\n" (
|
|
pkgs.lib.mapAttrsToList (name: props: " ${name} (${props.version})") (
|
|
pkgs.lib.filterAttrs (name: _props: name != "recurseForDerivations") pkgs.rubyPackages
|
|
)
|
|
);
|
|
in
|
|
pkgs.runCommand "bundle-audit" { } ''
|
|
mkdir "$out"
|
|
echo 'GEM' > "$out/Gemfile.lock"
|
|
echo ' remote: https://rubygems.org/' >> "$out/Gemfile.lock"
|
|
echo ' specs:' >> "$out/Gemfile.lock"
|
|
echo '${lockFileBody}' >> "$out/Gemfile.lock"
|
|
''
|