nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 asciidoctor,
3 fetchFromGitHub,
4 lib,
5 stdenv,
6}:
7stdenv.mkDerivation (finalAttrs: {
8 pname = "zzz";
9 version = "0.2.0";
10
11 src = fetchFromGitHub {
12 owner = "jirutka";
13 repo = "zzz";
14 tag = "v${finalAttrs.version}";
15 hash = "sha256-gm/fzhgGM2kns051PKY223uesctvMj9LmLc4btUsTt8=";
16 };
17
18 postPatch = ''
19 substituteInPlace zzz.c --replace-fail \
20 'setenv("PATH", "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", 1);' 'setenv("PATH", "/run/wrappers/bin:/run/current-system/sw/bin", 1);'
21 '';
22
23 nativeBuildInputs = [ asciidoctor ];
24
25 makeFlags = [
26 "prefix=$(out)"
27 "sysconfdir=$(out)/etc"
28 ];
29
30 meta = {
31 description = "Simple program to suspend or hibernate your computer";
32 mainProgram = "zzz";
33 homepage = "https://github.com/jirutka/zzz";
34 license = lib.licenses.mit;
35 maintainers = with lib.maintainers; [ aanderse ];
36 platforms = lib.platforms.linux;
37 };
38})