forked from lix-project/hydra
Merge pull request #377 from domenkozar/pixz
Use pixz instead of bzip2 for compressing nars
This commit is contained in:
commit
7b3dfe8363
|
@ -225,6 +225,7 @@ in
|
||||||
base_uri ${cfg.hydraURL}
|
base_uri ${cfg.hydraURL}
|
||||||
notification_sender ${cfg.notificationSender}
|
notification_sender ${cfg.notificationSender}
|
||||||
max_servers 25
|
max_servers 25
|
||||||
|
compress_num_threads 0
|
||||||
${optionalString (cfg.logo != null) ''
|
${optionalString (cfg.logo != null) ''
|
||||||
hydra_logo ${cfg.logo}
|
hydra_logo ${cfg.logo}
|
||||||
''}
|
''}
|
||||||
|
|
|
@ -134,7 +134,7 @@ rec {
|
||||||
];
|
];
|
||||||
|
|
||||||
hydraPath = lib.makeBinPath (
|
hydraPath = lib.makeBinPath (
|
||||||
[ libxslt sqlite subversion openssh nix coreutils findutils
|
[ libxslt sqlite subversion openssh nix coreutils findutils pixz
|
||||||
gzip bzip2 lzma gnutar unzip git gitAndTools.topGit mercurial darcs gnused bazaar
|
gzip bzip2 lzma gnutar unzip git gitAndTools.topGit mercurial darcs gnused bazaar
|
||||||
] ++ lib.optionals stdenv.isLinux [ rpm dpkg cdrkit ] );
|
] ++ lib.optionals stdenv.isLinux [ rpm dpkg cdrkit ] );
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ sub process {
|
||||||
my $info;
|
my $info;
|
||||||
$info .= "StorePath: $storePath\n";
|
$info .= "StorePath: $storePath\n";
|
||||||
$info .= "URL: nar/" . basename $storePath. "\n";
|
$info .= "URL: nar/" . basename $storePath. "\n";
|
||||||
$info .= "Compression: bzip2\n";
|
$info .= "Compression: xz\n";
|
||||||
$info .= "NarHash: $narHash\n";
|
$info .= "NarHash: $narHash\n";
|
||||||
$info .= "NarSize: $narSize\n";
|
$info .= "NarSize: $narSize\n";
|
||||||
$info .= "References: " . join(" ", map { basename $_ } @{$refs}) . "\n";
|
$info .= "References: " . join(" ", map { basename $_ } @{$refs}) . "\n";
|
||||||
|
|
|
@ -8,12 +8,14 @@ sub process {
|
||||||
my ($self, $c) = @_;
|
my ($self, $c) = @_;
|
||||||
|
|
||||||
my $storePath = $c->stash->{storePath};
|
my $storePath = $c->stash->{storePath};
|
||||||
|
my $numThreads = $c->config->{'compress_num_threads'};
|
||||||
|
my $pParam = ($numThreads > 0) ? "-p$numThreads" : "";
|
||||||
|
|
||||||
$c->response->content_type('application/x-nix-archive'); # !!! check MIME type
|
$c->response->content_type('application/x-nix-archive'); # !!! check MIME type
|
||||||
|
|
||||||
my $fh = new IO::Handle;
|
my $fh = new IO::Handle;
|
||||||
|
|
||||||
open $fh, "nix-store --dump '$storePath' | bzip2 |";
|
open $fh, "nix-store --dump '$storePath' | pixz -0 $pParam |";
|
||||||
|
|
||||||
setCacheHeaders($c, 365 * 24 * 60 * 60);
|
setCacheHeaders($c, 365 * 24 * 60 * 60);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue