mirror of
https://github.com/gburd/nix-config.git
synced 2024-09-09 11:26:12 +00:00
18 lines
369 B
Nix
18 lines
369 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"
|
||
|
'')
|
||
|
{ };
|
||
|
|
||
|
type = (pkgs.formats.json { }).type;
|
||
|
};
|
||
|
}
|