nixos-config/pkgs/build-support.nix
Christoph Heiss 649c08429a
All checks were successful
flake / build (push) Successful in 2m54s
pkgs: build-support: remove unneeded prefix
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
2024-08-25 23:23:03 +02:00

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