pkgs: automation-shell: convert to new buildPerlApplication
helper
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
This commit is contained in:
parent
ae13670a64
commit
fa12895af3
|
@ -1,8 +1,3 @@
|
|||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use IO::Interactive qw(is_interactive);
|
||||
|
||||
die "hi, no interactive shell allowed here :)\n" if is_interactive();
|
||||
|
|
|
@ -1,23 +1,10 @@
|
|||
{ stdenv, perl, sudo }:
|
||||
{ c8h4, sudo }:
|
||||
|
||||
let src = ../extra/bin/automation-shell.pl;
|
||||
in stdenv.mkDerivation {
|
||||
pname = "automation-shell";
|
||||
version = "0.1";
|
||||
dontUnpack = true;
|
||||
c8h4.buildPerlApplication {
|
||||
name = "automation-shell";
|
||||
runtimeInputs = [ sudo ];
|
||||
perlInputs = p: with p; [ IOInteractive ];
|
||||
text = builtins.readFile ../extra/bin/automation-shell.pl;
|
||||
|
||||
doCheck = true;
|
||||
checkInputs = [ (perl.withPackages (p: with p; [ PerlCritic ])) ];
|
||||
checkPhase = ''
|
||||
perlcritic ${src}
|
||||
'';
|
||||
|
||||
buildInputs = [ (perl.withPackages (p: with p; [ IOInteractive ])) sudo ];
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/bin
|
||||
install -Dm755 ${src} $out/bin/automation-shell
|
||||
'';
|
||||
|
||||
passthru.shellPath = "/bin/automation-shell";
|
||||
derivationArgs.passthru.shellPath = "/bin/automation-shell";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue