2009-02-19 23:43:08 +00:00
|
|
|
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
|
|
|
|
2009-02-19 23:43:08 +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
|
|
|
|
2009-03-11 14:44:34 +00:00
|
|
|
open $fh, "nix-store --dump '$storePath' | bzip2 |";
|
2009-02-19 23:43:08 +00:00
|
|
|
|
|
|
|
$c->response->body($fh);
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|