nixpkgs/pkgs/by-name/mo/monit/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

56 lines
1.4 KiB
Nix

{ lib
, stdenv
, fetchurl
, darwin
, bison
, flex
, zlib
, libxcrypt
, usePAM ? stdenv.hostPlatform.isLinux
, pam
, useSSL ? true
, openssl
}:
stdenv.mkDerivation rec {
pname = "monit";
version = "5.34.2";
src = fetchurl {
url = "https://mmonit.com/monit/dist/monit-${version}.tar.gz";
sha256 = "sha256-KRyj2JjptCW20MF2hyj+zWwc9MJox52xX9omKFrVuDI=";
};
nativeBuildInputs = [ bison flex ] ++
lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.DiskArbitration
darwin.apple_sdk.frameworks.System
];
buildInputs = [ zlib.dev libxcrypt ] ++
lib.optionals useSSL [ openssl ] ++
lib.optionals usePAM [ pam ];
configureFlags = [
(lib.withFeature usePAM "pam")
] ++ (if useSSL then [
"--with-ssl-incl-dir=${openssl.dev}/include"
"--with-ssl-lib-dir=${lib.getLib openssl}/lib"
] else [
"--without-ssl"
]) ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
# will need to check both these are true for musl
"libmonit_cv_setjmp_available=yes"
"libmonit_cv_vsnprintf_c99_conformant=yes"
];
meta = {
homepage = "https://mmonit.com/monit/";
description = "Monitoring system";
license = lib.licenses.agpl3Plus;
maintainers = with lib.maintainers; [ raskin wmertens ryantm ];
platforms = lib.platforms.linux ++ lib.platforms.darwin;
mainProgram = "monit";
};
}