2022-01-16 15:23:21 +00:00
|
|
|
{ lib, stdenv, fetchgit, rcinit ? null, rcshutdown ? null, rcreboot ? null }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "sinit";
|
|
|
|
version = "1.1";
|
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "https://git.suckless.org/sinit/";
|
|
|
|
sha256 = "sha256-VtXkgixgElKKOT26uKN9feXDVjjtSgTWvcgk5o5MLmw=";
|
2014-12-08 11:49:26 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2014-12-08 06:11:39 +00:00
|
|
|
};
|
|
|
|
buildInputs = [
|
2021-01-15 14:45:37 +00:00
|
|
|
(lib.getOutput "static" stdenv.cc.libc)
|
2014-12-08 06:11:39 +00:00
|
|
|
];
|
2022-01-16 15:23:21 +00:00
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
2014-12-08 06:11:39 +00:00
|
|
|
preConfigure = ""
|
2021-01-15 14:45:37 +00:00
|
|
|
+ (lib.optionalString (rcinit != null) ''sed -re 's@(rcinitcmd[^"]*")[^"]*"@\1${rcinit}"@' -i config.def.h; '')
|
|
|
|
+ (lib.optionalString (rcshutdown != null) ''sed -re 's@(rc(reboot|poweroff)cmd[^"]*")[^"]*"@\1${rcshutdown}"@' -i config.def.h; '')
|
|
|
|
+ (lib.optionalString (rcreboot != null) ''sed -re 's@(rc(reboot)cmd[^"]*")[^"]*"@\1${rcreboot}"@' -i config.def.h; '')
|
2022-01-16 15:23:21 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
meta = with lib; {
|
2021-01-16 04:20:42 +00:00
|
|
|
description = "A very minimal Linux init implementation from suckless.org";
|
2022-01-16 15:23:21 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ raskin ];
|
|
|
|
platforms = platforms.linux;
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://tools.suckless.org/sinit";
|
2018-04-11 13:09:51 +00:00
|
|
|
downloadPage = "https://git.suckless.org/sinit";
|
2014-12-08 06:11:39 +00:00
|
|
|
};
|
|
|
|
}
|