This repository has no description
0

Configure Feed

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

2configs/desktops/sway/eww: add scroll to adjust volume

+214 -83
+2 -2
flake.nix
··· 133 133 }; 134 134 tor-yggdrasil = { 135 135 module.name = "tor"; 136 - roles.client.tags.all = { }; 137 - roles.server.tags.all = { }; 136 + roles.client.tags.nixos = { }; 137 + roles.server.tags.nixos = { }; 138 138 roles.server.settings = { 139 139 secretHostname = false; 140 140 portMapping = [
+1
2configs/exim-smarthost.nix
··· 244 244 "bitpanda@lassul.us" 245 245 "schufa@lassul.us" 246 246 "burger@lassul.us" 247 + "eweka@lassul.us" 247 248 ]; 248 249 249 250 in
+3 -1
5pkgs/gomuks/package.nix
··· 57 57 ]; 58 58 59 59 subPackages = [ 60 + "cmd/gomuks" 60 61 "cmd/gomuks-terminal" 61 62 ]; 62 63 ··· 65 66 ''; 66 67 67 68 postInstall = '' 68 - mv $out/bin/gomuks-terminal $out/bin/gomuks 69 + mv $out/bin/gomuks $out/bin/gomuks-server 70 + mv $out/bin/gomuks-terminal $out/bin/gomuks-tui 69 71 ''; 70 72 71 73 meta = {
+14 -20
machines/pixel8/boot-img.nix
··· 20 20 buildPhase = '' 21 21 runHook preBuild 22 22 23 - # Create boot.img for Pixel 8 24 - # Using boot header version 4 for Android 12+ devices 23 + # Create init_boot.img for Pixel 8 (Android 13+) 24 + # This replaces only the init ramdisk, keeping GrapheneOS kernel + vendor_boot 25 + # Header version 4, no kernel - just our ramdisk with /init 26 + mkbootimg \ 27 + --header_version 4 \ 28 + --ramdisk ${initramfs}/initrd \ 29 + --os_version 14.0.0 \ 30 + --os_patch_level 2024-01 \ 31 + --pagesize 4096 \ 32 + --output init_boot.img 33 + 34 + # Also create full boot.img for reference/testing 25 35 mkbootimg \ 26 36 --kernel ${kernel}/kernel/Image \ 27 37 --ramdisk ${initramfs}/initrd \ ··· 29 39 --os_version 14.0.0 \ 30 40 --os_patch_level 2024-01 \ 31 41 --pagesize 4096 \ 42 + --cmdline "rdinit=/init" \ 32 43 --output boot.img 33 44 34 45 runHook postBuild ··· 38 49 runHook preInstall 39 50 40 51 mkdir -p $out 52 + cp init_boot.img $out/ 41 53 cp boot.img $out/ 42 54 43 55 # Also provide the components separately for debugging ··· 45 57 ln -s ${kernel} $out/components/kernel 46 58 ln -s ${initramfs}/initrd $out/components/initrd 47 59 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 60 67 61 runHook postInstall 68 62 '';
+175 -58
machines/pixel8/initramfs.nix
··· 1 1 { 2 2 pkgsCross, 3 - makeInitrdNG, 3 + stdenvNoCC, 4 4 writeScript, 5 5 callPackage, 6 + cpio, 7 + gzip, 6 8 }: 7 9 8 10 let 9 11 # Use aarch64 cross-compiled packages 10 12 aarch64 = pkgsCross.aarch64-multiplatform; 13 + busybox = aarch64.busybox.override { enableStatic = true; }; 11 14 12 15 kernel = callPackage ./kernel.nix { }; 13 16 14 - # Modules needed for USB keyboard support 17 + # Modules needed for USB (and their full dependency chain) 18 + # Traced via modinfo -F depends, topologically sorted 15 19 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" 20 + # Leaf dependencies (no deps of their own) 21 + "ect_parser" 22 + "eusb_repeater" 23 + "exynos-pd_el3" 24 + "google_tcpci_shim" 25 + "gs-chipid" 26 + "gs_perf_mon" 27 + "gvotable" 28 + "kernel-top" 29 + "logbuffer" 30 + "max77759_helper" 31 + "pixel-suspend-diag" 32 + "sched_tp" 33 + "systrace" 34 + "xhci-goog-dma" 35 + # Level 1 36 + "exynos-pmu-if" 37 + "dss" 38 + "exynos-pd_hsi0" 39 + "usb_psy" 40 + "max77759_contaminant" 41 + "max77779_contaminant" 42 + "pinctrl-exynos-gs" 43 + # Level 2 44 + "gs_acpm" 45 + "max777x9_contaminant" 46 + "bc_max77759" 47 + # Level 3 48 + "cmupmucal" 49 + "vh_sched" 50 + "pixel_metrics" 51 + # Level 4 52 + "exynos_pm_qos" 53 + "exynos-cpupm" 54 + # USB hardware 55 + "phy-exynos-usbdrd-eusb-super" 56 + "dwc3-exynos-usb" 57 + "xhci-exynos" 58 + # Type-C port manager 59 + "tcpci_max77759" 21 60 ]; 22 61 23 - # Minimal init script that loads USB modules and drops to shell 62 + # Init script - with diagnostics written to metadata partition 24 63 initScript = writeScript "init" '' 25 64 #!/bin/busybox sh 26 65 27 - # Mount essential filesystems 28 - /bin/busybox mkdir -p /proc /sys /dev /tmp /run /lib/modules 66 + /bin/busybox mkdir -p /proc /sys /dev /tmp /config /metadata 29 67 /bin/busybox mount -t proc proc /proc 30 68 /bin/busybox mount -t sysfs sys /sys 31 69 /bin/busybox mount -t devtmpfs dev /dev 32 70 /bin/busybox mount -t tmpfs tmp /tmp 33 - 34 - # Setup busybox symlinks early 71 + /bin/busybox mount -t configfs none /config 2>/dev/null 35 72 /bin/busybox --install -s /bin 36 73 37 - # Print banner 38 - echo "" 39 - echo "=====================================" 40 - echo " NixOS Mobile - Pixel 8 Debug Shell" 41 - echo "=====================================" 42 - echo "" 74 + # Open watchdog fd 75 + exec 3>/dev/watchdog 2>/dev/null 43 76 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)" 77 + # Diagnostics written to tmpfs, then dd'd to vendor_boot at offset 60MB 78 + LOG=/tmp/debug.txt 79 + echo "=== NixOS init started ===" > $LOG 2>/dev/null 80 + date >> $LOG 2>/dev/null 81 + echo "=== /dev/block ===" >> $LOG 2>/dev/null 82 + ls -la /dev/block/platform/13200000.ufs/by-name/ >> $LOG 2>/dev/null 83 + echo "=== configfs ===" >> $LOG 2>/dev/null 84 + ls -la /config/ >> $LOG 2>/dev/null 85 + echo "=== usb_gadget exists? ===" >> $LOG 2>/dev/null 86 + ls -la /config/usb_gadget/ >> $LOG 2>/dev/null 87 + echo "=== /sys/class/udc before modules ===" >> $LOG 2>/dev/null 88 + ls -la /sys/class/udc/ >> $LOG 2>/dev/null 89 + 90 + # Load USB modules in dependency order, logging each 91 + ${builtins.concatStringsSep "\n" ( 92 + map (mod: '' 93 + echo "loading ${mod}..." >> $LOG 2>/dev/null 94 + insmod /lib/modules/${mod}.ko >> $LOG 2>&1 95 + '') usbModules 96 + )} 97 + 98 + echo "=== /sys/class/udc after modules ===" >> $LOG 2>/dev/null 99 + ls -la /sys/class/udc/ >> $LOG 2>/dev/null 100 + echo "=== usb_gadget after modules ===" >> $LOG 2>/dev/null 101 + ls -la /config/usb_gadget/ >> $LOG 2>/dev/null 102 + echo "=== dmesg (last 100 lines) ===" >> $LOG 2>/dev/null 103 + dmesg | tail -100 >> $LOG 2>/dev/null 104 + 105 + # Wait for UDC 106 + sleep 3 107 + echo "=== /sys/class/udc after sleep ===" >> $LOG 2>/dev/null 108 + ls -la /sys/class/udc/ >> $LOG 2>/dev/null 109 + 110 + # Set up USB gadget serial (ACM) 111 + if [ -d /config/usb_gadget ]; then 112 + mkdir -p /config/usb_gadget/g1/strings/0x409 113 + echo 0x18d1 > /config/usb_gadget/g1/idVendor 114 + echo 0x4ee7 > /config/usb_gadget/g1/idProduct 115 + echo "NixOS" > /config/usb_gadget/g1/strings/0x409/manufacturer 116 + echo "Pixel8" > /config/usb_gadget/g1/strings/0x409/product 117 + 118 + mkdir -p /config/usb_gadget/g1/configs/c.1/strings/0x409 119 + echo "ACM" > /config/usb_gadget/g1/configs/c.1/strings/0x409/configuration 120 + 121 + mkdir -p /config/usb_gadget/g1/functions/acm.usb0 122 + ln -s /config/usb_gadget/g1/functions/acm.usb0 /config/usb_gadget/g1/configs/c.1/ 123 + 124 + UDC=$(ls /sys/class/udc/ 2>/dev/null | head -1) 125 + echo "UDC=$UDC" >> $LOG 2>/dev/null 126 + [ -n "$UDC" ] && echo "$UDC" > /config/usb_gadget/g1/UDC 2>/dev/null 127 + else 128 + echo "=== /config/usb_gadget NOT FOUND ===" >> $LOG 2>/dev/null 129 + fi 130 + 131 + echo "=== gadget setup done ===" >> $LOG 2>/dev/null 132 + 133 + # Also dump block device info for debugging 134 + echo "=== /proc/partitions ===" >> $LOG 2>/dev/null 135 + cat /proc/partitions >> $LOG 2>/dev/null 136 + echo "=== looking for vendor_boot ===" >> $LOG 2>/dev/null 137 + 138 + # Find vendor_boot block device via sysfs partition names 139 + VB="" 140 + for part in /sys/class/block/sd*/; do 141 + pname=$(cat "''${part}uevent" 2>/dev/null | grep PARTNAME | cut -d= -f2) 142 + devname=$(cat "''${part}uevent" 2>/dev/null | grep DEVNAME | cut -d= -f2) 143 + if echo "$pname" | grep -q "vendor_boot"; then 144 + VB="/dev/$devname" 145 + echo "Found vendor_boot at $VB (partname=$pname)" >> $LOG 2>/dev/null 146 + break 50 147 fi 51 148 done 52 149 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 "" 150 + # Write diagnostics to vendor_boot at offset 60MB 151 + if [ -n "$VB" ] && [ -b "$VB" ]; then 152 + dd if=$LOG of=$VB bs=1 seek=62914560 conv=notrunc 2>/dev/null 153 + echo "DIAG_OK" | dd of=$VB bs=1 seek=62914544 conv=notrunc 2>/dev/null 154 + echo "wrote diagnostics to $VB" >> $LOG 2>/dev/null 155 + else 156 + echo "vendor_boot block device not found" >> $LOG 2>/dev/null 157 + fi 158 + sync 59 159 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 160 + # Spawn shell on USB serial as background process 161 + ( 162 + sleep 2 163 + while true; do 164 + if [ -e /dev/ttyGS0 ]; then 165 + setsid sh -c 'sh </dev/ttyGS0 >/dev/ttyGS0 2>&1' 166 + fi 167 + sleep 1 168 + done 169 + ) & 170 + 171 + # PID 1 - feed watchdog and stay alive 172 + while true; do 173 + echo 1 >&3 2>/dev/null 174 + sleep 2 66 175 done 67 - 68 - # Fallback - just exec shell 69 - exec /bin/sh 70 176 ''; 71 177 72 - # Create module directory structure 73 - moduleContents = map (mod: { 74 - source = "${kernel}/modules/${mod}"; 75 - target = "/lib/modules/${mod}"; 76 - }) usbModules; 77 - 78 178 in 79 - makeInitrdNG { 80 - compressor = "gzip"; 179 + stdenvNoCC.mkDerivation { 180 + name = "pixel8-initramfs"; 81 181 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; 182 + dontUnpack = true; 183 + 184 + nativeBuildInputs = [ 185 + cpio 186 + gzip 187 + ]; 188 + 189 + buildPhase = '' 190 + mkdir -p root/{bin,dev,proc,sys,tmp,run,config,lib/modules} 191 + 192 + cp ${busybox}/bin/busybox root/bin/busybox 193 + chmod 755 root/bin/busybox 194 + 195 + cp ${initScript} root/init 196 + chmod 755 root/init 197 + 198 + # Copy USB modules and dependencies 199 + ${builtins.concatStringsSep "\n" ( 200 + map (mod: " cp ${kernel}/modules/${mod}.ko root/lib/modules/") usbModules 201 + )} 202 + 203 + (cd root && find . | sort | cpio -o -H newc --quiet | gzip -9) > initrd 204 + ''; 205 + 206 + installPhase = '' 207 + mkdir -p $out 208 + cp initrd $out/initrd 209 + ''; 93 210 }
+2
machines/xerxes/config.nix
··· 41 41 documentation.nixos.enable = true; 42 42 programs.steam.enable = true; 43 43 44 + lass.workspace-manager.enable = true; 45 + 44 46 services.ollama = { 45 47 enable = true; 46 48 package = pkgs.ollama-rocm;
+17 -2
2configs/desktops/sway/eww.nix
··· 101 101 (label :text "''${round(power.watts, 1)}W ''${power.charging ? '󰂄' : '󰁹'}")))) 102 102 103 103 (defwidget volume-widget [] 104 - (box :class "volume" :orientation "h" :space-evenly false 105 - (label :text "''${volume.level}% ''${volume.icon}"))) 104 + (eventbox :onscroll "${lib.getExe volumeAdjustScript} {}" 105 + :onclick "${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle" 106 + (box :class "volume" :orientation "h" :space-evenly false 107 + (label :text "''${volume.level}% ''${volume.icon}")))) 106 108 107 109 (defwidget network-widget [] 108 110 (box :class "network" :orientation "h" :space-evenly false ··· 445 447 icon="󰕿" 446 448 fi 447 449 jq -n --arg level "$vol" --arg icon "$icon" '{level: $level, icon: $icon}' 450 + ''; 451 + }; 452 + 453 + volumeAdjustScript = pkgs.writeShellApplication { 454 + name = "eww-volume-adjust"; 455 + runtimeInputs = [ pkgs.pulseaudio ]; 456 + text = '' 457 + direction="$1" 458 + if [ "$direction" = "up" ]; then 459 + pactl set-sink-volume @DEFAULT_SINK@ +5% 460 + else 461 + pactl set-sink-volume @DEFAULT_SINK@ -5% 462 + fi 448 463 ''; 449 464 }; 450 465