1{ lib
2, stdenv
3, fetchFromGitHub
4, fetchpatch
5, cmake
6, ninja
7, pkg-config
8, systemd
9, ncurses
10}:
11
12stdenv.mkDerivation rec {
13 pname = "chkservice";
14 version = "0.3";
15
16 src = fetchFromGitHub {
17 owner = "linuxenko";
18 repo = "chkservice";
19 rev = version;
20 hash = "sha256-ZllO6Ag+OgAkQp6jSv000NUEskXFuhMcCo83A4Wp2zU=";
21 };
22
23 patches = [
24 # Pull fix pending upstream inclusion for gcc-11 support:
25 # https://github.com/linuxenko/chkservice/pull/38
26 (fetchpatch {
27 name = "gcc-11.patch";
28 url = "https://github.com/linuxenko/chkservice/commit/26b12a7918c8a3bc449c92b458e6cd5c2d7b2e05.patch";
29 hash = "sha256-LaJLlqRyn1eoahbW2X+hDSt8iV4lhNRn0j0kLHB+RhM=";
30 })
31 ];
32
33 # Tools needed during build time
34 nativeBuildInputs = [
35 cmake
36 # Makes the build faster, adds less than half a megabyte to the build
37 # dependencies
38 ninja
39 pkg-config
40 ];
41
42 buildInputs = [
43 systemd
44 ncurses
45 ];
46
47 hardeningDisable = [ "format" ];
48
49 meta = {
50 description = "chkservice is a tool for managing systemd units in terminal.";
51 platforms = lib.platforms.all;
52 maintainers = with lib.maintainers; [ infinisil ];
53 license = lib.licenses.gpl3Plus;
54 homepage = "https://github.com/linuxenko/chkservice";
55 };
56}