2022-03-24 08:34:09 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, pandoc, installShellFiles, withManpage ? false, nixosTests }:
|
2017-02-24 06:31:23 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-04-12 11:09:57 +02:00
|
|
|
pname = "earlyoom";
|
2022-03-06 06:36:40 +01:00
|
|
|
version = "1.7";
|
2017-02-24 06:31:23 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rfjakob";
|
|
|
|
repo = "earlyoom";
|
2020-04-12 11:09:57 +02:00
|
|
|
rev = "v${version}";
|
2022-03-06 06:36:40 +01:00
|
|
|
sha256 = "sha256-8YcT1TTlAet7F1U9Ginda4IApNqkudegOXqm8rnRGfc=";
|
2017-02-24 06:31:23 +01:00
|
|
|
};
|
|
|
|
|
2021-01-15 15:45:37 +01:00
|
|
|
nativeBuildInputs = lib.optionals withManpage [ pandoc installShellFiles ];
|
2020-04-12 11:09:57 +02:00
|
|
|
|
2020-05-25 17:13:55 +02:00
|
|
|
patches = [ ./fix-dbus-path.patch ];
|
|
|
|
|
2020-04-12 11:09:57 +02:00
|
|
|
makeFlags = [ "VERSION=${version}" ];
|
|
|
|
|
2017-02-24 06:31:23 +01:00
|
|
|
installPhase = ''
|
2018-09-10 14:22:24 +02:00
|
|
|
install -D earlyoom $out/bin/earlyoom
|
2021-01-15 15:45:37 +01:00
|
|
|
'' + lib.optionalString withManpage ''
|
2020-04-12 11:09:57 +02:00
|
|
|
installManPage earlyoom.1
|
2017-02-24 06:31:23 +01:00
|
|
|
'';
|
|
|
|
|
2022-03-24 08:34:09 +01:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) earlyoom;
|
|
|
|
};
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2017-02-24 06:31:23 +01:00
|
|
|
description = "Early OOM Daemon for Linux";
|
2020-04-12 11:09:57 +02:00
|
|
|
homepage = "https://github.com/rfjakob/earlyoom";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [];
|
2017-02-24 06:31:23 +01:00
|
|
|
};
|
|
|
|
}
|