nixpkgs/pkgs/os-specific/linux/sinit/default.nix
Alexis Hildebrandt 755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00

32 lines
1.1 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=";
rev = "refs/tags/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";
};
}