pr-status-pl/flake.nix

78 lines
2.2 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
2024-03-23 08:46:26 -06:00
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
2023-05-22 19:12:52 -06:00
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};
2024-08-01 19:56:27 -06:00
perl' = pkgs.perl.withPackages (pp:
[
pp.Mojolicious
pp.JSON
pp.Git
]);
2023-05-22 19:12:52 -06:00
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";
2023-06-16 14:52:54 -06:00
version = "v0.0.4";
2023-05-22 19:12:52 -06:00
src = ./.;
2023-05-22 21:02:09 -06:00
buildInputs = with pkgs; [ makeWrapper ];
2024-08-01 19:56:27 -06:00
propagatedBuildInputs = [
perl'
2023-05-22 19:12:52 -06:00
];
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};
2024-08-01 19:56:27 -06:00
perl' = pkgs.perl.withPackages (pp: with pp; [
Git
JSON
Mojolicious
PerlTidy
PerlLanguageServer
2024-08-01 19:56:27 -06:00
]);
2023-05-24 15:03:12 -06:00
npPackages = with pkgs; [
elmPackages.elm
elmPackages.elm-test
elmPackages.elm-live
2023-11-15 15:06:14 -07:00
elmPackages.elm-json
2024-08-01 19:56:27 -06:00
perl'
2023-05-24 15:03:12 -06:00
];
2023-05-22 19:12:52 -06:00
in {
default = pkgs.mkShell {
shellHook = ''
PS1='\u@\h:\@; '
2024-04-25 09:16:21 -06:00
nix run github:qbit/xin#flake-warn
2023-05-22 19:12:52 -06:00
echo "Perl `${pkgs.perl}/bin/perl --version`"
'';
2024-08-01 19:56:27 -06:00
buildInputs = [
2023-05-24 15:03:12 -06:00
] ++ npPackages;
2023-05-22 19:12:52 -06:00
};
});
};
}