pr-status-pl/flake.nix

66 lines
1.9 KiB
Nix
Raw Normal View History

2023-05-22 19:12:52 -06:00
{
2023-05-22 19:39:52 -06:00
description =
"pr-status: a tool to query NixOS/nixpkgs pull request status as they move along the build chain";
2023-05-22 19:12:52 -06:00
inputs.nixpkgs.url = "nixpkgs/nixos-22.11";
outputs = { self, nixpkgs }:
let
supportedSystems =
[ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in {
2023-05-22 19:39:52 -06:00
overlay = final: prev: {
pr-status = self.packages.${prev.system}.pr-status;
};
nixosModule = import ./module.nix;
2023-05-22 19:12:52 -06:00
packages = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in {
2023-05-22 19:39:52 -06:00
pr-status = pkgs.perlPackages.buildPerlPackage {
2023-05-22 19:12:52 -06:00
pname = "pr-status";
version = "v0.0.1";
src = ./.;
2023-05-22 21:02:09 -06:00
buildInputs = with pkgs; [ makeWrapper ];
2023-05-22 19:12:52 -06:00
propagatedBuildInputs = with pkgs.perlPackages; [
Mojolicious
JSON
Git
];
2023-05-22 20:58:57 -06:00
postInstall = ''
2023-05-22 21:02:09 -06:00
wrapProgram $out/bin/pr-status.pl --prefix PATH : ${
nixpkgs.lib.makeBinPath [ pkgs.git pkgs.perl ]
}
2023-05-22 20:58:57 -06:00
'';
2023-05-22 19:12:52 -06:00
outputs = [ "out" "dev" ];
};
});
2023-05-22 19:39:52 -06:00
defaultPackage =
forAllSystems (system: self.packages.${system}.pr-status);
2023-05-22 19:12:52 -06:00
devShells = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in {
default = pkgs.mkShell {
shellHook = ''
PS1='\u@\h:\@; '
nix flake run github:qbit/xin#flake-warn
echo "Perl `${pkgs.perl}/bin/perl --version`"
'';
buildInputs = with pkgs.perlPackages; [
Git
JSON
Mojolicious
perl
PerlCritic
PerlTidy
];
};
});
};
}