aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArslaan Pathan <[email protected]>2026-06-08 19:10:07 +1200
committerArslaan Pathan <[email protected]>2026-06-08 19:10:07 +1200
commit0bc407c91f304edbccd75636de2f257043021893 (patch)
tree5db6351274dff4566c4706b4b0106f2e4dc2ce22
parent38eb0e193eae5d3fff21dcc497e11ac2ab30fcd3 (diff)
downloadyerbalinux-0bc407c91f304edbccd75636de2f257043021893.tar.xz
yerbalinux-0bc407c91f304edbccd75636de2f257043021893.zip
Just wrap prebuilt busybox, i cant be bothered to fight with the Illegal instruction that i cant even FIX
-rw-r--r--flake.nix6
-rw-r--r--nix/busybox.nix34
2 files changed, 21 insertions, 19 deletions
diff --git a/flake.nix b/flake.nix
index 64058c0..e08e760 100644
--- a/flake.nix
+++ b/flake.nix
@@ -6,7 +6,7 @@
outputs = { self, nixpkgs }: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
- pkgsMusl = nixpkgs.legacyPackages.${system}.pkgsMusl;
+ pkgsStatic = nixpkgs.legacyPackages.${system}.pkgsStatic;
in {
devShells.${system}.default = pkgs.mkShell {
buildInputs = with pkgs; [ gcc clang gnumake xorriso cpio ];
@@ -14,7 +14,9 @@
packages.${system} = {
kernel = pkgs.callPackage ./nix/kernel.nix {};
- busybox = pkgsMusl.callPackage ./nix/busybox.nix {};
+ busybox = pkgs.callPackage ./nix/busybox.nix {
+ inherit (pkgs) pkgsStatic;
+ };
limine = pkgs.callPackage ./nix/limine.nix {};
initramfs = pkgs.callPackage ./nix/initramfs.nix {
inherit (self.packages.${system}) kernel busybox;
diff --git a/nix/busybox.nix b/nix/busybox.nix
index 7fbceda..04d1a36 100644
--- a/nix/busybox.nix
+++ b/nix/busybox.nix
@@ -1,22 +1,22 @@
-{ stdenv, fetchgit, linuxHeaders, buildPackages }:
+{ stdenv, pkgsStatic }:
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
+ buildCommand = ''
+ mkdir -p $out/_install/bin $out/_install/sbin
+
+ cp ${pkgsStatic.busybox}/bin/busybox $out/_install/bin
+ chmod +x $out/_install/bin/busybox
+
+ cd $out/_install/bin
+ for prog in $(./busybox --list); do
+ ln -s busybox $prog
+ done
+
+
+ cd $out/_install/sbin
+ for prog in $(./busybox --list); do
+ ln -s ../bin/busybox $prog
+ done
'';
}