1 { lib, stdenv, fetchgit, rcinit ? null, rcshutdown ? null, rcreboot ? null }:
3 stdenv.mkDerivation rec {
8 url = "https://git.suckless.org/sinit/";
9 sha256 = "sha256-VtXkgixgElKKOT26uKN9feXDVjjtSgTWvcgk5o5MLmw=";
10 rev = "refs/tags/v${version}";
13 (lib.getOutput "static" stdenv.cc.libc)
15 makeFlags = [ "PREFIX=$(out)" ];
17 + (lib.optionalString (rcinit != null) ''sed -re 's@(rcinitcmd[^"]*")[^"]*"@\1${rcinit}"@' -i config.def.h; '')
18 + (lib.optionalString (rcshutdown != null) ''sed -re 's@(rc(reboot|poweroff)cmd[^"]*")[^"]*"@\1${rcshutdown}"@' -i config.def.h; '')
19 + (lib.optionalString (rcreboot != null) ''sed -re 's@(rc(reboot)cmd[^"]*")[^"]*"@\1${rcreboot}"@' -i config.def.h; '')
23 description = "Very minimal Linux init implementation from suckless.org";
24 mainProgram = "sinit";
25 license = licenses.mit;
26 maintainers = with maintainers; [ raskin ];
27 platforms = platforms.linux;
28 homepage = "https://tools.suckless.org/sinit";
29 downloadPage = "https://git.suckless.org/sinit";