runit: optionally build static runit{,-init}

May be useful in initrd along with statically linked busybox.

+6 -2
+6 -2
pkgs/tools/system/runit/default.nix
··· 1 - { stdenv, fetchurl }: 1 + { stdenv, fetchurl 2 + , static ? false 3 + }: 2 4 3 5 stdenv.mkDerivation rec { 4 6 name = "runit-${version}"; ··· 15 17 16 18 doCheck = true; 17 19 18 - postPatch = '' 20 + buildInputs = stdenv.lib.optionals static [ stdenv.cc.libc stdenv.cc.libc.static ]; 21 + 22 + postPatch = stdenv.lib.optionalString (!static) '' 19 23 sed -i 's,-static,,g' src/Makefile 20 24 ''; 21 25