2022-01-19 23:45:15 +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=";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
};
|
|
|
|
buildInputs = [
|
2021-02-05 17:12:51 +00:00
|
|
|
(lib.getOutput "static" stdenv.cc.libc)
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
2022-01-19 23:45:15 +00:00
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
preConfigure = ""
|
2021-02-05 17:12:51 +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-19 23:45:15 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
meta = with lib; {
|
2021-01-17 00:15:33 +00:00
|
|
|
description = "A very minimal Linux init implementation from suckless.org";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "sinit";
|
2022-01-19 23:45:15 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ raskin ];
|
|
|
|
platforms = platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://tools.suckless.org/sinit";
|
|
|
|
downloadPage = "https://git.suckless.org/sinit";
|
|
|
|
};
|
|
|
|
}
|