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) = @_;
|
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;
|
2009-03-11 14:44:34 +00:00
|
|
|
|
|
|
|
open $fh, "nix-store --export `nix-store -qR @storePaths` | gzip |";
|
2008-11-18 14:48:40 +00:00
|
|
|
|
|
|
|
$c->response->body($fh);
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|