pkgs: automation-shell: convert to new buildPerlApplication helper

Signed-off-by: Christoph Heiss <christoph@c8h4.io>
This commit is contained in:
Christoph Heiss 2024-08-22 20:55:42 +02:00
parent ae13670a64
commit fa12895af3
Signed by: c8h4
GPG key ID: 6817E9C75C0785D7
2 changed files with 7 additions and 25 deletions

View file

@ -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();

View file

@ -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";
}