Files
nixpkgs/pkgs/os-specific/linux/sinit/default.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

45 lines
1.2 KiB
Nix

{
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=";
tag = "v${version}";
};
buildInputs = [
(lib.getOutput "static" stdenv.cc.libc)
];
makeFlags = [ "PREFIX=$(out)" ];
preConfigure =
""
+ (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; '');
meta = with lib; {
description = "Very minimal Linux init implementation from suckless.org";
mainProgram = "sinit";
license = licenses.mit;
maintainers = with maintainers; [ raskin ];
platforms = platforms.linux;
homepage = "https://tools.suckless.org/sinit";
downloadPage = "https://git.suckless.org/sinit";
};
}