diff --git a/default.nix b/default.nix index e372095..1070930 100644 --- a/default.nix +++ b/default.nix @@ -52,7 +52,7 @@ let borderVmConf ]; }).config.system; -in { +in rec { inherit evalModules; outputs = config.system.outputs // { @@ -90,4 +90,16 @@ in { lua ]; }; + + try-nand = pkgs.pkgsBuildBuild.writeShellScriptBin "try-nand.sh" '' + rootfs=$(mktemp) + cp ${outputs.default}/rootfs $rootfs + ${pkgs.pkgsBuildBuild.qemuLim}/bin/qemu-system-mips \ + -M malta -echr 16 -m 272 \ + -device nand,chip_id=0x59,id=nand -drive format=raw,file=''${rootfs},if=mtd,id=nand \ + -serial mon:stdio -kernel ${outputs.default}/vmlinux \ + -append "root=/dev/mtdblock0 console=ttyS0,115200 panic=10 oops=panic init=/bin/init loglevel=8 root=/dev/mtdblock0 rootfstype=squashfs fw_devlink=off mem=256M liminix mtdparts=phram0:16M(rootfs) phram.phram=phram0,0x90000000,16Mi,65536" \ + -display none + rm $rootfs + ''; }