aboutsummaryrefslogtreecommitdiff
path: root/nix/busybox.nix
blob: 7fbcedaa20080aed40b50d336f2ccbbe3ee384ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{ stdenv, fetchgit, linuxHeaders, buildPackages }:

stdenv.mkDerivation {
	name = "busybox-yerba";
	src = fetchgit {
		url = "https://git.eaguru.guru/mirrors/busybox.git"; # change this to the official git.busybox.net/busybox when their SSL comes back
		rev = "1_33_2";
		hash = "sha256-0/WbonvSRa57p6sEnY82h2u10WGJRb9IwFSTIJSyzlk=";
	};
	buildInputs = [ linuxHeaders ];
	nativeBuildInputs = [ linuxHeaders ];
	preConfigure = ''
		make defconfig
		echo "CONFIG_STATIC=y" >> .config
	'';
	buildPhase = ''
		make -j$NIX_BUILD_CORES CROSS_COMPILE=${stdenv.cc.targetPrefix} HOSTCC=${buildPackages.stdenv.cc}/bin/gcc
	'';
	installPhase = ''
		make install CONFIG_PREFIX=$out/_install
	'';
}