This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

machines.pixel8: init with test image

+344 -67
+29 -67
flake.lock
··· 39 39 "treefmt-nix": "treefmt-nix" 40 40 }, 41 41 "locked": { 42 - "lastModified": 1770312651, 43 - "narHash": "sha256-zTKBWCRzeFeO3SSgXXnD3e8Li6k+/ybDZvFAhtSVuy4=", 42 + "lastModified": 1770670054, 43 + "narHash": "sha256-usUGqo0LtHa69ovqharjnGN1U0Ghcv25J6t8ZUhWcXw=", 44 44 "ref": "refs/heads/main", 45 - "rev": "33bf2786d8c1077187790166e2a23fa4e5553834", 46 - "revCount": 12772, 45 + "rev": "1830ea04658b6234f6268bb66ab2c328bf8e700c", 46 + "revCount": 12873, 47 47 "type": "git", 48 48 "url": "https://git.clan.lol/clan/clan-core" 49 49 }, ··· 68 68 ] 69 69 }, 70 70 "locked": { 71 - "lastModified": 1770222022, 72 - "narHash": "sha256-IfQsvunBPaMs9Bc5oI1sMLCn9yVw7MqmkqdtSvATgpQ=", 73 - "rev": "514b5411fa3afa8f6250c0bdf1d7cc19229b2234", 71 + "lastModified": 1770580383, 72 + "narHash": "sha256-fEpF46+YO+jz4X+kahCbgLpRzWRB8wlPiw3lzDcWFpI=", 73 + "rev": "f6d0b3d4685c9f44e2c4f479e8fcac17ea923abb", 74 74 "type": "tarball", 75 - "url": "https://git.clan.lol/api/v1/repos/clan/data-mesher/archive/514b5411fa3afa8f6250c0bdf1d7cc19229b2234.tar.gz" 75 + "url": "https://git.clan.lol/api/v1/repos/clan/data-mesher/archive/f6d0b3d4685c9f44e2c4f479e8fcac17ea923abb.tar.gz" 76 76 }, 77 77 "original": { 78 78 "type": "tarball", ··· 191 191 ] 192 192 }, 193 193 "locked": { 194 - "lastModified": 1768135262, 195 - "narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=", 194 + "lastModified": 1769996383, 195 + "narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=", 196 196 "owner": "hercules-ci", 197 197 "repo": "flake-parts", 198 - "rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac", 198 + "rev": "57928607ea566b5db3ad13af0e57e921e6b12381", 199 199 "type": "github" 200 200 }, 201 201 "original": { ··· 268 268 "treefmt-nix": "treefmt-nix_3" 269 269 }, 270 270 "locked": { 271 - "lastModified": 1770325891, 272 - "narHash": "sha256-7ipAUiPb798BRdV56+3bxa71fdleMxlS/XvIGUYO1qI=", 271 + "lastModified": 1770647950, 272 + "narHash": "sha256-5IBnmc6yMO4p26kJfHQylCJEci8X8vhp5AYG41yjNU8=", 273 273 "owner": "numtide", 274 274 "repo": "llm-agents.nix", 275 - "rev": "54aeaa16a2f836142fba98a455e0373e3f464ac5", 275 + "rev": "752fd7ca23ccbe5f5b00c0c65db9d8dbb755e119", 276 276 "type": "github" 277 277 }, 278 278 "original": { ··· 370 370 }, 371 371 "nix-rosetta-builder": { 372 372 "inputs": { 373 - "nixos-generators": "nixos-generators", 374 373 "nixpkgs": [ 375 374 "nixpkgs" 376 375 ] 377 376 }, 378 377 "locked": { 379 - "lastModified": 1756177999, 380 - "narHash": "sha256-aSbB7/jrt7ujiJ55f2uGhOo+usGxVSkqbAMVgg2jDls=", 378 + "lastModified": 1770491098, 379 + "narHash": "sha256-ZfhynJqgV3A9hEivcgOEZa+TZnJPc26lIUjzKsSchgI=", 381 380 "owner": "cpick", 382 381 "repo": "nix-rosetta-builder", 383 - "rev": "ebb7162a975074fb570a2c3ac02bc543ff2e9df4", 382 + "rev": "50e6070082e0b4fbaf67dd8f346892a1a9ed685c", 384 383 "type": "github" 385 384 }, 386 385 "original": { ··· 424 423 "url": "https://cgit.krebsco.de/nix-writers" 425 424 } 426 425 }, 427 - "nixlib": { 428 - "locked": { 429 - "lastModified": 1736643958, 430 - "narHash": "sha256-tmpqTSWVRJVhpvfSN9KXBvKEXplrwKnSZNAoNPf/S/s=", 431 - "owner": "nix-community", 432 - "repo": "nixpkgs.lib", 433 - "rev": "1418bc28a52126761c02dd3d89b2d8ca0f521181", 434 - "type": "github" 435 - }, 436 - "original": { 437 - "owner": "nix-community", 438 - "repo": "nixpkgs.lib", 439 - "type": "github" 440 - } 441 - }, 442 426 "nixos-facter": { 443 427 "locked": { 444 428 "lastModified": 1766558141, ··· 454 438 "type": "github" 455 439 } 456 440 }, 457 - "nixos-generators": { 458 - "inputs": { 459 - "nixlib": "nixlib", 460 - "nixpkgs": [ 461 - "nix-rosetta-builder", 462 - "nixpkgs" 463 - ] 464 - }, 465 - "locked": { 466 - "lastModified": 1737057290, 467 - "narHash": "sha256-3Pe0yKlCc7EOeq1X/aJVDH0CtNL+tIBm49vpepwL1MQ=", 468 - "owner": "nix-community", 469 - "repo": "nixos-generators", 470 - "rev": "d002ce9b6e7eb467cd1c6bb9aef9c35d191b5453", 471 - "type": "github" 472 - }, 473 - "original": { 474 - "owner": "nix-community", 475 - "repo": "nixos-generators", 476 - "type": "github" 477 - } 478 - }, 479 441 "nixos-hardware": { 480 442 "locked": { 481 - "lastModified": 1769302137, 482 - "narHash": "sha256-QEDtctEkOsbx8nlFh4yqPEOtr4tif6KTqWwJ37IM2ds=", 443 + "lastModified": 1770631810, 444 + "narHash": "sha256-b7iK/x+zOXbjhRqa+XBlYla4zFvPZyU5Ln2HJkiSnzc=", 483 445 "owner": "nixos", 484 446 "repo": "nixos-hardware", 485 - "rev": "a351494b0e35fd7c0b7a1aae82f0afddf4907aa8", 447 + "rev": "2889685785848de940375bf7fea5e7c5a3c8d502", 486 448 "type": "github" 487 449 }, 488 450 "original": { ··· 493 455 }, 494 456 "nixpkgs": { 495 457 "locked": { 496 - "lastModified": 1770197578, 497 - "narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=", 458 + "lastModified": 1770562336, 459 + "narHash": "sha256-ub1gpAONMFsT/GU2hV6ZWJjur8rJ6kKxdm9IlCT0j84=", 498 460 "owner": "nixos", 499 461 "repo": "nixpkgs", 500 - "rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2", 462 + "rev": "d6c71932130818840fc8fe9509cf50be8c64634f", 501 463 "type": "github" 502 464 }, 503 465 "original": { ··· 516 478 "systems": "systems_4" 517 479 }, 518 480 "locked": { 519 - "lastModified": 1770025103, 520 - "narHash": "sha256-Qlb19PP0n6s+v1MywVjROV5XwsCvA58XXiXHk0Govb4=", 481 + "lastModified": 1770630823, 482 + "narHash": "sha256-5SEmOnJ61vmbap39vzWEsCX5UQ+3Ul8J4mXWKdqSn3w=", 521 483 "owner": "nix-community", 522 484 "repo": "nixvim", 523 - "rev": "31c3b3687dc85e3fbbf5c44728a5ee231608f8a9", 485 + "rev": "6acc964664ac916c64fe4e394edd467af4d90790", 524 486 "type": "github" 525 487 }, 526 488 "original": { ··· 579 541 ] 580 542 }, 581 543 "locked": { 582 - "lastModified": 1770145881, 583 - "narHash": "sha256-ktjWTq+D5MTXQcL9N6cDZXUf9kX8JBLLBLT0ZyOTSYY=", 544 + "lastModified": 1770526836, 545 + "narHash": "sha256-xbvX5Ik+0inJcLJtJ/AajAt7xCk6FOCrm5ogpwwvVDg=", 584 546 "owner": "Mic92", 585 547 "repo": "sops-nix", 586 - "rev": "17eea6f3816ba6568b8c81db8a4e6ca438b30b7c", 548 + "rev": "d6e0e666048a5395d6ea4283143b7c9ac704720d", 587 549 "type": "github" 588 550 }, 589 551 "original": {
+2
flake.nix
··· 181 181 ./wrapperModules/flake-module.nix 182 182 ./skills/flake-module.nix 183 183 ./games/flake-module.nix 184 + ./machines/pixel8/flake-module.nix 184 185 ] 185 186 ++ ( 186 187 # Auto-import all flake-module.nix files from tools subdirectories ··· 206 207 machineName: _: builtins.pathExists ./machines/${machineName}/container.nix 207 208 ) (builtins.readDir ./machines) 208 209 ); 210 + 209 211 perSystem = 210 212 { 211 213 lib,
+75
machines/pixel8/boot-img.nix
··· 1 + { 2 + lib, 3 + stdenvNoCC, 4 + callPackage, 5 + }: 6 + 7 + let 8 + kernel = callPackage ./kernel.nix { }; 9 + initramfs = callPackage ./initramfs.nix { }; 10 + mkbootimg = callPackage ./mkbootimg.nix { }; 11 + in 12 + stdenvNoCC.mkDerivation { 13 + pname = "pixel8-boot-img"; 14 + version = "0.1.0"; 15 + 16 + dontUnpack = true; 17 + 18 + nativeBuildInputs = [ mkbootimg ]; 19 + 20 + buildPhase = '' 21 + runHook preBuild 22 + 23 + # Create boot.img for Pixel 8 24 + # Using boot header version 4 for Android 12+ devices 25 + mkbootimg \ 26 + --kernel ${kernel}/kernel/Image \ 27 + --ramdisk ${initramfs}/initrd \ 28 + --header_version 4 \ 29 + --os_version 14.0.0 \ 30 + --os_patch_level 2024-01 \ 31 + --pagesize 4096 \ 32 + --output boot.img 33 + 34 + runHook postBuild 35 + ''; 36 + 37 + installPhase = '' 38 + runHook preInstall 39 + 40 + mkdir -p $out 41 + cp boot.img $out/ 42 + 43 + # Also provide the components separately for debugging 44 + mkdir -p $out/components 45 + ln -s ${kernel} $out/components/kernel 46 + ln -s ${initramfs}/initrd $out/components/initrd 47 + ln -s ${kernel}/dtbo.img $out/dtbo.img 48 + 49 + # Create a flash script 50 + cat > $out/flash.sh << 'EOF' 51 + #!/bin/sh 52 + set -e 53 + echo "Flashing Pixel 8 boot image..." 54 + echo "Make sure device is in fastboot mode (power + volume down)" 55 + echo "" 56 + echo "To flash temporarily (will revert on reboot):" 57 + echo " fastboot boot ${placeholder "out"}/boot.img" 58 + echo "" 59 + echo "To flash permanently (DANGER - can brick device):" 60 + echo " fastboot flash boot ${placeholder "out"}/boot.img" 61 + echo "" 62 + echo "To flash DTBO (may be needed):" 63 + echo " fastboot flash dtbo ${placeholder "out"}/dtbo.img" 64 + EOF 65 + chmod +x $out/flash.sh 66 + 67 + runHook postInstall 68 + ''; 69 + 70 + meta = with lib; { 71 + description = "Minimal NixOS boot image for Google Pixel 8"; 72 + license = licenses.gpl2Only; 73 + platforms = platforms.all; 74 + }; 75 + }
+23
machines/pixel8/flake-module.nix
··· 1 + { ... }: 2 + { 3 + perSystem = 4 + { 5 + pkgs, 6 + ... 7 + }: 8 + { 9 + packages = { 10 + # GrapheneOS prebuilt kernel for Pixel 8 11 + pixel8-kernel = pkgs.callPackage ./kernel.nix { }; 12 + 13 + # Android boot image tools 14 + mkbootimg = pkgs.callPackage ./mkbootimg.nix { }; 15 + 16 + # Minimal initramfs with debug shell 17 + pixel8-initramfs = pkgs.callPackage ./initramfs.nix { }; 18 + 19 + # Complete boot image ready to flash 20 + pixel8-boot-img = pkgs.callPackage ./boot-img.nix { }; 21 + }; 22 + }; 23 + }
+93
machines/pixel8/initramfs.nix
··· 1 + { 2 + pkgsCross, 3 + makeInitrdNG, 4 + writeScript, 5 + callPackage, 6 + }: 7 + 8 + let 9 + # Use aarch64 cross-compiled packages 10 + aarch64 = pkgsCross.aarch64-multiplatform; 11 + 12 + kernel = callPackage ./kernel.nix { }; 13 + 14 + # Modules needed for USB keyboard support 15 + usbModules = [ 16 + "phy-exynos-usbdrd-eusb-super.ko" 17 + "eusb_repeater.ko" 18 + "dwc3-exynos-usb.ko" 19 + "xhci-exynos.ko" 20 + "xhci-goog-dma.ko" 21 + ]; 22 + 23 + # Minimal init script that loads USB modules and drops to shell 24 + initScript = writeScript "init" '' 25 + #!/bin/busybox sh 26 + 27 + # Mount essential filesystems 28 + /bin/busybox mkdir -p /proc /sys /dev /tmp /run /lib/modules 29 + /bin/busybox mount -t proc proc /proc 30 + /bin/busybox mount -t sysfs sys /sys 31 + /bin/busybox mount -t devtmpfs dev /dev 32 + /bin/busybox mount -t tmpfs tmp /tmp 33 + 34 + # Setup busybox symlinks early 35 + /bin/busybox --install -s /bin 36 + 37 + # Print banner 38 + echo "" 39 + echo "=====================================" 40 + echo " NixOS Mobile - Pixel 8 Debug Shell" 41 + echo "=====================================" 42 + echo "" 43 + 44 + # Load USB modules for keyboard support 45 + echo "Loading USB modules..." 46 + for mod in ${builtins.concatStringsSep " " usbModules}; do 47 + if [ -f "/lib/modules/$mod" ]; then 48 + echo " Loading $mod" 49 + insmod "/lib/modules/$mod" 2>/dev/null || echo " (failed or already loaded)" 50 + fi 51 + done 52 + 53 + echo "" 54 + echo "Kernel: $(uname -r)" 55 + echo "" 56 + echo "USB keyboard should work if connected via OTG adapter." 57 + echo "If no input works, try connecting via USB serial/ADB." 58 + echo "" 59 + 60 + # Try to get a console - attempt multiple TTYs 61 + for console in /dev/console /dev/tty0 /dev/tty1 /dev/ttyGS0; do 62 + if [ -e "$console" ]; then 63 + echo "Attempting shell on $console" 64 + exec setsid sh -c "exec sh <$console >$console 2>&1" 65 + fi 66 + done 67 + 68 + # Fallback - just exec shell 69 + exec /bin/sh 70 + ''; 71 + 72 + # Create module directory structure 73 + moduleContents = map (mod: { 74 + source = "${kernel}/modules/${mod}"; 75 + target = "/lib/modules/${mod}"; 76 + }) usbModules; 77 + 78 + in 79 + makeInitrdNG { 80 + compressor = "gzip"; 81 + 82 + contents = [ 83 + { 84 + # Use statically-linked aarch64 busybox 85 + source = "${aarch64.busybox-sandbox-shell}"; 86 + target = "/bin/busybox"; 87 + } 88 + { 89 + source = initScript; 90 + target = "/init"; 91 + } 92 + ] ++ moduleContents; 93 + }
+62
machines/pixel8/kernel.nix
··· 1 + { 2 + lib, 3 + stdenvNoCC, 4 + fetchFromGitHub, 5 + lz4, 6 + }: 7 + 8 + stdenvNoCC.mkDerivation rec { 9 + pname = "pixel8-kernel-grapheneos"; 10 + version = "6.1-16-qpr2"; 11 + 12 + src = fetchFromGitHub { 13 + owner = "GrapheneOS"; 14 + repo = "device_google_shusky-kernels_6.1"; 15 + rev = "16-qpr2"; 16 + hash = "sha256-bFYP0gdPQiQEf4wjwGyE8ocfKeYOWPLSBtkif3SDvzM="; 17 + }; 18 + 19 + nativeBuildInputs = [ lz4 ]; 20 + 21 + installPhase = '' 22 + runHook preInstall 23 + 24 + mkdir -p $out/{kernel,dtbs,modules} 25 + 26 + # Decompress kernel 27 + lz4 -d grapheneos/Image.lz4 $out/kernel/Image 28 + 29 + # Copy DTBs 30 + cp grapheneos/*.dtb $out/dtbs/ 31 + 32 + # Copy DTBO image 33 + cp grapheneos/dtbo.img $out/ 34 + 35 + # Copy all modules 36 + cp grapheneos/*.ko $out/modules/ 37 + 38 + # Copy module loading configuration 39 + cp grapheneos/modules.load $out/ 40 + cp grapheneos/init.insmod.shiba.cfg $out/ 41 + cp grapheneos/vendor_kernel_boot.modules.load $out/ 42 + 43 + # Copy System.map for debugging 44 + cp grapheneos/System.map $out/ 45 + 46 + runHook postInstall 47 + ''; 48 + 49 + # No compilation, just file copies - can build on any platform 50 + dontStrip = true; 51 + dontPatchELF = true; 52 + dontFixup = true; 53 + 54 + meta = with lib; { 55 + description = "GrapheneOS prebuilt kernel for Google Pixel 8 (shiba)"; 56 + homepage = "https://github.com/GrapheneOS/device_google_shusky-kernels_6.1"; 57 + license = licenses.gpl2Only; 58 + # Contains aarch64 binaries, but can be unpacked on any platform 59 + platforms = lib.platforms.all; 60 + maintainers = [ ]; 61 + }; 62 + }
+60
machines/pixel8/mkbootimg.nix
··· 1 + { 2 + lib, 3 + stdenvNoCC, 4 + fetchgit, 5 + python3, 6 + }: 7 + 8 + stdenvNoCC.mkDerivation { 9 + pname = "mkbootimg"; 10 + version = "2025-02-10"; 11 + 12 + src = fetchgit { 13 + url = "https://android.googlesource.com/platform/system/tools/mkbootimg"; 14 + rev = "d2bb0af5ba6d3198a3e99529c97eda1be0b5a093"; 15 + hash = "sha256-z7KklKf0dTyt7ZoUiZrMYRzU3h+WuLnc355LRtFMs2s="; 16 + }; 17 + 18 + nativeBuildInputs = [ python3 ]; 19 + 20 + installPhase = '' 21 + runHook preInstall 22 + 23 + mkdir -p $out/bin $out/lib/mkbootimg 24 + 25 + # Copy Python scripts and modules 26 + cp mkbootimg.py unpack_bootimg.py repack_bootimg.py $out/lib/mkbootimg/ 27 + cp -r gki $out/lib/mkbootimg/ 28 + 29 + # Create wrapper scripts with PYTHONPATH set 30 + cat > $out/bin/mkbootimg << EOF 31 + #!/bin/sh 32 + export PYTHONPATH="$out/lib/mkbootimg:\$PYTHONPATH" 33 + exec ${python3}/bin/python3 $out/lib/mkbootimg/mkbootimg.py "\$@" 34 + EOF 35 + chmod +x $out/bin/mkbootimg 36 + 37 + cat > $out/bin/unpack_bootimg << EOF 38 + #!/bin/sh 39 + export PYTHONPATH="$out/lib/mkbootimg:\$PYTHONPATH" 40 + exec ${python3}/bin/python3 $out/lib/mkbootimg/unpack_bootimg.py "\$@" 41 + EOF 42 + chmod +x $out/bin/unpack_bootimg 43 + 44 + cat > $out/bin/repack_bootimg << EOF 45 + #!/bin/sh 46 + export PYTHONPATH="$out/lib/mkbootimg:\$PYTHONPATH" 47 + exec ${python3}/bin/python3 $out/lib/mkbootimg/repack_bootimg.py "\$@" 48 + EOF 49 + chmod +x $out/bin/repack_bootimg 50 + 51 + runHook postInstall 52 + ''; 53 + 54 + meta = with lib; { 55 + description = "Android boot image creation tool from AOSP"; 56 + homepage = "https://android.googlesource.com/platform/system/tools/mkbootimg"; 57 + license = licenses.asl20; 58 + platforms = platforms.all; 59 + }; 60 + }