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

24 lines
395 B
Perl
Raw Normal View History

2008-11-25 11:01:42 +00:00
package Hydra::View::NixClosure;
2008-11-18 14:48:40 +00:00
use strict;
use base qw/Catalyst::View/;
use IO::Pipe;
sub process {
2009-02-25 14:34:29 +00:00
my ($self, $c) = @_;
2013-01-22 14:41:02 +01:00
2008-11-18 14:48:40 +00:00
$c->response->content_type('application/x-nix-export');
2009-02-25 14:34:29 +00:00
my @storePaths = @{$c->stash->{storePaths}};
2008-11-18 14:48:40 +00:00
my $fh = new IO::Handle;
2013-01-22 14:41:02 +01:00
open $fh, "nix-store --export `nix-store -qR @storePaths` | gzip |";
2008-11-18 14:48:40 +00:00
$c->response->body($fh);
2013-01-22 14:41:02 +01:00
2008-11-18 14:48:40 +00:00
return 1;
}
1;