1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/os-specific/linux/sinit/default.nix

38 lines
1.3 KiB
Nix
Raw Normal View History

2021-01-15 14:45:37 +00:00
{lib, stdenv, fetchgit, rcinit ? null, rcshutdown ? null, rcreboot ? null}:
2014-12-08 06:11:39 +00:00
let
s = # Generated upstream information
rec {
baseName="sinit";
version="1.0";
2014-12-08 06:11:39 +00:00
name="${baseName}-${version}";
url="https://git.suckless.org/sinit/";
sha256="0cf8yylgrrj1wxm5v6jdlbnxpx97m38yxrc9nmv1l8hldjqsj9pc";
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
];
in
stdenv.mkDerivation {
inherit (s) name version;
inherit buildInputs;
src = fetchgit {
inherit (s) url sha256 rev;
2014-12-08 06:11:39 +00:00
};
makeFlags = ["PREFIX=$(out)"];
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; '')
2014-12-08 06:11:39 +00:00
;
meta = {
inherit (s) version;
description = "A very minimal Linux init implementation from suckless.org";
2021-01-15 14:45:37 +00:00
license = lib.licenses.mit ;
maintainers = [lib.maintainers.raskin];
platforms = lib.platforms.linux;
homepage = "https://tools.suckless.org/sinit";
downloadPage = "https://git.suckless.org/sinit";
2014-12-08 06:11:39 +00:00
};
}