openbsd.app/flake.nix
2022-09-28 15:09:05 -06:00

58 lines
1.6 KiB
Nix

{
description = "openbsd.app: a tool to search OpenBSD packages";
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
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 {
packages = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in {
thing = pkgs.stdenv.mkDerivation {
pname = "openbsd.app";
version = "v0.0.1";
src = ./.;
nativeBuildInputs = with pkgs.perlPackages; [
perl
Mojolicious
MojoSQLite
TextMarkdown
pkgs.minisign
];
buildInputs = with pkgs; [ perl ];
installPhase = ''
mkdir -p $out/bin
install -t openbsd.app.pl $out/bin
'';
};
});
defaultPackage = forAllSystems (system: self.packages.${system}.thing);
devShells = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in {
default = pkgs.mkShell {
shellHook = ''
PS1='\u@\h:\@; '
echo "Perl `${pkgs.perl}/bin/perl --version`"
'';
buildInputs = with pkgs.perlPackages; [ PerlTidy pkgs.sqlite ];
nativeBuildInputs = with pkgs.perlPackages; [
perl
Mojolicious
MojoSQLite
TextMarkdown
pkgs.minisign
];
};
});
};
}