nixos-config/pkgs/automation-shell.nix

24 lines
527 B
Nix
Raw Normal View History

{ stdenv, perl, sudo }:
let src = ../extra/bin/automation-shell.pl;
in stdenv.mkDerivation {
pname = "automation-shell";
version = "0.1";
dontUnpack = true;
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";
}