nix-config/pkgs/formats/default.nix
Greg Burd 86706b1fc7 wimpy-ified
inspired by wimpysworld nix-config
2023-09-25 14:05:07 -04:00

17 lines
371 B
Nix

{ 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;
};
}