hydra/src/lib/Hydra/View/NixClosure.pm
2013-01-22 14:41:02 +01:00

24 lines
395 B
Perl

package Hydra::View::NixClosure;
use strict;
use base qw/Catalyst::View/;
use IO::Pipe;
sub process {
my ($self, $c) = @_;
$c->response->content_type('application/x-nix-export');
my @storePaths = @{$c->stash->{storePaths}};
my $fh = new IO::Handle;
open $fh, "nix-store --export `nix-store -qR @storePaths` | gzip |";
$c->response->body($fh);
return 1;
}
1;