Christoph Heiss
649c08429a
All checks were successful
flake / build (push) Successful in 2m54s
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
32 lines
673 B
Nix
32 lines
673 B
Nix
_:
|
|
{ lib, perl, perlPackages, writeTextFile, ... }:
|
|
|
|
{
|
|
buildPerlApplication = { name, text, perlInputs ? (_: [ ])
|
|
, runtimeInputs ? [ ], derivationArgs ? { } }:
|
|
writeTextFile {
|
|
inherit name derivationArgs;
|
|
executable = true;
|
|
destination = "/bin/${name}";
|
|
|
|
checkPhase = ''
|
|
runHook preCheck
|
|
${lib.getExe perlPackages.PerlCritic} $target
|
|
runHook postCheck
|
|
'';
|
|
|
|
text = ''
|
|
#!${lib.getExe (perl.withPackages perlInputs)}
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
$ENV{PATH} = "${lib.makeBinPath runtimeInputs}:$ENV{PATH}";
|
|
|
|
${text}
|
|
'';
|
|
|
|
meta.mainProgram = name;
|
|
};
|
|
}
|