hydra/src/lib/Hydra/View/NixNAR.pm

23 lines
379 B
Perl
Raw Normal View History

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