nixpkgs/pkgs/os-specific/linux/earlyoom/default.nix
stuebinm ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00

38 lines
957 B
Nix

{ lib, stdenv, fetchFromGitHub, pandoc, installShellFiles, withManpage ? false, nixosTests }:
stdenv.mkDerivation rec {
pname = "earlyoom";
version = "1.7";
src = fetchFromGitHub {
owner = "rfjakob";
repo = "earlyoom";
rev = "v${version}";
sha256 = "sha256-8YcT1TTlAet7F1U9Ginda4IApNqkudegOXqm8rnRGfc=";
};
nativeBuildInputs = lib.optionals withManpage [ pandoc installShellFiles ];
patches = [ ./fix-dbus-path.patch ];
makeFlags = [ "VERSION=${version}" ];
installPhase = ''
install -D earlyoom $out/bin/earlyoom
'' + lib.optionalString withManpage ''
installManPage earlyoom.1
'';
passthru.tests = {
inherit (nixosTests) earlyoom;
};
meta = with lib; {
description = "Early OOM Daemon for Linux";
mainProgram = "earlyoom";
homepage = "https://github.com/rfjakob/earlyoom";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [];
};
}