at master 44 lines 1.2 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchgit, 5 rcinit ? null, 6 rcshutdown ? null, 7 rcreboot ? null, 8}: 9 10stdenv.mkDerivation rec { 11 pname = "sinit"; 12 version = "1.1"; 13 14 src = fetchgit { 15 url = "https://git.suckless.org/sinit/"; 16 sha256 = "sha256-VtXkgixgElKKOT26uKN9feXDVjjtSgTWvcgk5o5MLmw="; 17 tag = "v${version}"; 18 }; 19 buildInputs = [ 20 (lib.getOutput "static" stdenv.cc.libc) 21 ]; 22 makeFlags = [ "PREFIX=$(out)" ]; 23 preConfigure = 24 "" 25 + (lib.optionalString ( 26 rcinit != null 27 ) ''sed -re 's@(rcinitcmd[^"]*")[^"]*"@\1${rcinit}"@' -i config.def.h; '') 28 + (lib.optionalString ( 29 rcshutdown != null 30 ) ''sed -re 's@(rc(reboot|poweroff)cmd[^"]*")[^"]*"@\1${rcshutdown}"@' -i config.def.h; '') 31 + (lib.optionalString ( 32 rcreboot != null 33 ) ''sed -re 's@(rc(reboot)cmd[^"]*")[^"]*"@\1${rcreboot}"@' -i config.def.h; ''); 34 35 meta = with lib; { 36 description = "Very minimal Linux init implementation from suckless.org"; 37 mainProgram = "sinit"; 38 license = licenses.mit; 39 maintainers = with maintainers; [ raskin ]; 40 platforms = platforms.linux; 41 homepage = "https://tools.suckless.org/sinit"; 42 downloadPage = "https://git.suckless.org/sinit"; 43 }; 44}