nix-config/pkgs/formats/default.nix

18 lines
371 B
Nix
Raw Permalink Normal View History

{ pkgs }:
{
gzipJson = _: {
generate = name: value: pkgs.callPackage
({ runCommand, gzip }: runCommand name
{
nativeBuildInputs = [ gzip ];
value = builtins.toJSON value;
passAsFile = [ "value" ];
} ''
gzip "$valuePath" -c > "$out"
'')
{ };
inherit ((pkgs.formats.json { })) type;
};
}