Add custom zcat wrapper which adds an ETA progress

Useful when importing large database dumps.
This commit is contained in:
Daniel Siepmann 2023-08-17 11:26:41 +02:00
parent c5c9648033
commit 467ce2fdde
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
2 changed files with 19 additions and 0 deletions

View file

@ -9,6 +9,7 @@
(callPackage ./nextcloud-sync/from-local.nix { })
(callPackage ./nextcloud-sync/from-remote.nix { })
(callPackage ./typo3-documentation-rendering { })
(callPackage ./zcat-progress { })
(callPackage ./project {
inherit ownLib;
})

View file

@ -0,0 +1,18 @@
{
writeShellApplication
, pv
, gzip
}:
writeShellApplication {
name = "custom-zcat-with-progress";
runtimeInputs = [
pv
gzip
];
text = ''
zcat "$1" | pv -s "$(gzip -dc "$1" | wc -c)"
'';
}