From 06f4ddf962b04f382b8abf9ad55a76e57ffae3c0 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Mon, 8 Dec 2014 09:11:39 +0300 Subject: [PATCH] Add suckless.org sinit for experiments --- pkgs/os-specific/linux/sinit/default.nix | 36 ++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 5 ++++ 2 files changed, 41 insertions(+) create mode 100644 pkgs/os-specific/linux/sinit/default.nix diff --git a/pkgs/os-specific/linux/sinit/default.nix b/pkgs/os-specific/linux/sinit/default.nix new file mode 100644 index 000000000000..03529ea0f2ea --- /dev/null +++ b/pkgs/os-specific/linux/sinit/default.nix @@ -0,0 +1,36 @@ +{stdenv, fetchurl, rcinit ? null, rcshutdown ? null, rcreboot ? null}: +let + s = # Generated upstream information + rec { + baseName="sinit"; + version="0.9.2"; + name="${baseName}-${version}"; + url="http://git.suckless.org/sinit/snapshot/sinit-0.9.2.tar.gz"; + sha256="0dv4d20q93iffykf5gg8mlg2qfs3nmfrwdar73kg5xwka96c2523"; + }; + buildInputs = [ + ]; +in +stdenv.mkDerivation { + inherit (s) name version; + inherit buildInputs; + src = fetchurl { + inherit (s) url sha256; + }; + makeFlags = ["PREFIX=$(out)"]; + preConfigure = "" + + (stdenv.lib.optionalString (rcinit != null) ''sed -re 's@(rcinitcmd[^"]*")[^"]*"@\1${rcinit}"@' -i config.def.h; '') + + (stdenv.lib.optionalString (rcshutdown != null) ''sed -re 's@(rc(reboot|poweroff)cmd[^"]*")[^"]*"@\1${rcshutdown}"@' -i config.def.h; '') + + (stdenv.lib.optionalString (rcreboot != null) ''sed -re 's@(rc(reboot)cmd[^"]*")[^"]*"@\1${rcreboot}"@' -i config.def.h; '') + ; + meta = { + inherit (s) version; + description = ''A very minimal Linux init implementation from suckless.org''; + license = stdenv.lib.licenses.mit ; + maintainers = [stdenv.lib.maintainers.raskin]; + platforms = stdenv.lib.platforms.linux; + homepage = "http://tools.suckless.org/sinit"; + downloadPage = "http://git.suckless.org/sinit"; + updateWalker = true; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 31a47f7d2b1e..142587634aeb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8589,6 +8589,11 @@ let shadow = callPackage ../os-specific/linux/shadow { }; + sinit = callPackage ../os-specific/linux/sinit { + rcinit = "/etc/rc.d/rc.init"; + rcshutdown = "/etc/rc.d/rc.shutdown"; + }; + smem = callPackage ../os-specific/linux/smem { }; statifier = builderDefsPackage (import ../os-specific/linux/statifier) { };