hydra/src/lib/Hydra/View/NixNAR.pm
Eelco Dolstra fe030331b5 Revert "Don't compress already-compressed files."
This reverts commit 190bffd846f044a13c239513f8ef1ea45ee8a1f2.
2013-07-01 18:46:18 +02:00

23 lines
379 B
Perl

package Hydra::View::NixNAR;
use strict;
use base qw/Catalyst::View/;
sub process {
my ($self, $c) = @_;
my $storePath = $c->stash->{storePath};
$c->response->content_type('application/x-nix-archive'); # !!! check MIME type
my $fh = new IO::Handle;
open $fh, "nix-store --dump '$storePath' | bzip2 |";
$c->response->body($fh);
return 1;
}
1;