Graham Christensen 7095d00608 perlcritic: make all open() calls three-argument
Two-argument calls end up parsing the second argument to guess what
should happen, three-arg parses ... less?
2021-10-20 13:09:39 -04:00

25 lines
417 B
Perl

package Hydra::View::NixClosure;
use strict;
use warnings;
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 = IO::Handle->new();
open($fh, "-|", "nix-store --export `nix-store -qR @storePaths` | gzip");
$c->response->body($fh);
return 1;
}
1;