aboutsummaryrefslogtreecommitdiff
path: root/nix/rootfs.nix
diff options
context:
space:
mode:
authorArslaan Pathan <[email protected]>2026-06-11 19:25:19 +1200
committerArslaan Pathan <[email protected]>2026-06-11 19:25:19 +1200
commit673f2563e48a4e1e37af6985d4d18f56bff741ea (patch)
tree7b3aadf32be6f18de9ddf617605352ea78486323 /nix/rootfs.nix
parent3b00ff6e47d219276459fdb66e8497b0d3cd5249 (diff)
downloadyerbalinux-673f2563e48a4e1e37af6985d4d18f56bff741ea.tar.xz
yerbalinux-673f2563e48a4e1e37af6985d4d18f56bff741ea.zip
Another clean slate. I cannot continue to fight Nix and try to make it do what it was never meant to do.
Yocto time!
Diffstat (limited to 'nix/rootfs.nix')
-rw-r--r--nix/rootfs.nix69
1 files changed, 0 insertions, 69 deletions
diff --git a/nix/rootfs.nix b/nix/rootfs.nix
deleted file mode 100644
index a437a48..0000000
--- a/nix/rootfs.nix
+++ /dev/null
@@ -1,69 +0,0 @@
-{ stdenv, fetchgit, busybox, squashfsTools, linuxHeaders, musl, runit }:
-
-stdenv.mkDerivation {
- name = "rootfs-yerba";
- src = ./.;
- buildInputs = [ squashfsTools ];
- nativeBuildInputs = [ squashfsTools linuxHeaders ];
- buildPhase = ''
- # Basic setup start
- mkdir -p rootfs
- mkdir -p rootfs/{bin,sbin,etc,proc,sys,dev,home,var,usr,root,mnt,tmp,lib}
- mkdir -p rootfs/usr/{lib,bin}
- mkdir -p rootfs/etc/runit
- mkdir -p rootfs/etc/service
- mkdir -p rootfs/home/yerba
- chmod -R u+w rootfs
- # Basic setup end
-
- # Musl start
- cp -a ${musl}/lib/* rootfs/usr/lib/
- chmod -R u+w rootfs
- ln -sf /usr/lib/ld-musl-x86_64.so.1 rootfs/lib/ld-musl-x86_64.so.1
- chmod -R u+w rootfs
- ln -sf /usr/lib/libc.so rootfs/lib/libc.so
- # Musl end
-
- # Busybox start
- cp -a ${busybox}/_install/. rootfs/
- # chmod -R u+w rootfs
- # ln -sf /bin/busybox rootfs/init
- # Busybox end
-
- # runit start
- cp -a ${runit}/bin/* rootfs/usr/bin
- chmod -R u+w rootfs
- ln -sf usr/bin/runit-init rootfs/init
- chmod -R u+w rootfs
- rm -f rootfs/sbin/init
- chmod -R u+w rootfs
- ln -sf usr/bin/runit-init rootfs/sbin/init
- cp -a ${../runit}/* rootfs/etc/runit/
- chmod -R u+w rootfs
- ln -sf /etc/runit/sv/getty-tty0 rootfs/etc/service/
- chmod -R u+w rootfs
- ln -sf /etc/runit/sv/getty-ttyS0 rootfs/etc/service/
- # runit end
-
- # Programs start
- # nothing here yet!
- # Programs end
-
- # Basic files setup start
- echo "proc /proc proc defaults 0 0" > rootfs/etc/fstab
- echo "sysfs /sys sysfs defaults 0 0" >> rootfs/etc/fstab
- echo "devtmpfs /dev devtmpfs defaults 0 0" >> rootfs/etc/fstab
- echo "root::0:0:root:/root:/bin/sh" > rootfs/etc/passwd
- echo "yerba::1000:1000:yerba:/home/yerba:/bin/sh" >> rootfs/etc/passwd
- echo "root:x:0:" > rootfs/etc/group
- echo "yerba-live" > rootfs/etc/hostname
- # Basic files setup end
-
- # Squashfs start
- mksquashfs rootfs $out -comp zstd -noappend
- # Squashfs end
- '';
- installPhase = ''
- echo "rootfs built"
- '';
-}