This repository has no description
0

Configure Feed

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

add packages

+376 -1
+1 -1
.gitignore
··· 1 1 .* 2 2 !.gitignore 3 - result*/ 3 + result*
+63
all-packages.nix
··· 1 + { 2 + lib, 3 + inputs, 4 + currentSystem, 5 + hostpkgs ? { }, 6 + }: 7 + 8 + let 9 + mkRun = 10 + path: args: command: 11 + let 12 + setup = 13 + if args ? src then 14 + '' 15 + mkdir src 16 + cd src 17 + cp -r ${args.src}/* . 18 + chmod -R u+w . 19 + '' 20 + else 21 + ""; 22 + in 23 + derivation ( 24 + { 25 + system = currentSystem; 26 + builder = "${pkgs.busybox}/bin/ash"; 27 + args = [ 28 + "-euc" 29 + '' 30 + if [ 0 -eq "$NIX_BUILD_CORES" ]; then 31 + NIX_BUILD_CORES=$(${pkgs.busybox}/bin/nproc) 32 + fi 33 + exec ${pkgs.busybox}/bin/ash -eux $commandPath 34 + '' 35 + ]; 36 + PATH = lib.makeBinPath ((args.path or [ ]) ++ path); 37 + command = setup + "\n" + command; 38 + passAsFile = [ "command" ]; 39 + } 40 + // (removeAttrs args [ "srcPath" ]) 41 + ); 42 + 43 + run0 = mkRun [ pkgs.busybox ]; 44 + 45 + wasmpkgs = 46 + { 47 + inherit lib inputs; 48 + sh = run0 { name = "sh"; } '' 49 + mkdir -p $out/bin 50 + ln -s ${pkgs.busybox}/bin/ash $out/bin/sh 51 + ''; 52 + run = mkRun [ 53 + pkgs.busybox 54 + pkgs.sh 55 + ]; 56 + } 57 + // lib.packagesFromDirectoryRecursive { 58 + callPackage = lib.callPackageWith pkgs; 59 + directory = ./packages; 60 + }; 61 + pkgs = wasmpkgs // hostpkgs; 62 + in 63 + wasmpkgs
+71
flake.lock
··· 1 1 { 2 2 "nodes": { 3 + "busybox": { 4 + "flake": false, 5 + "locked": { 6 + "lastModified": 1736261867, 7 + "narHash": "sha256-Sbuibax0P/sz+Pwn5BNASsbzF1iFeo19meO3EFhJZzA=", 8 + "owner": "tombl", 9 + "repo": "busybox", 10 + "rev": "e98330a3b04a0237e1741254b556b709911af8bc", 11 + "type": "github" 12 + }, 13 + "original": { 14 + "owner": "tombl", 15 + "repo": "busybox", 16 + "type": "github" 17 + } 18 + }, 3 19 "flake-compat": { 4 20 "flake": false, 5 21 "locked": { ··· 93 109 "type": "github" 94 110 } 95 111 }, 112 + "linux": { 113 + "flake": false, 114 + "locked": { 115 + "lastModified": 1736261539, 116 + "narHash": "sha256-cqa+eme6Uy985DNv83KmzOT7bLst82zYyfrEGVxWZ2c=", 117 + "owner": "tombl", 118 + "repo": "linux", 119 + "rev": "9aeee3fd5749953ed147c4dadb26660f322d9f68", 120 + "type": "github" 121 + }, 122 + "original": { 123 + "owner": "tombl", 124 + "ref": "args", 125 + "repo": "linux", 126 + "type": "github" 127 + } 128 + }, 129 + "llvm": { 130 + "flake": false, 131 + "locked": { 132 + "lastModified": 1736765684, 133 + "narHash": "sha256-R1XaHsJR2GlUnIuS/rjQGeB6EGAtgGHWax9UrDzX7iE=", 134 + "owner": "llvm", 135 + "repo": "llvm-project", 136 + "rev": "61c9f970b88710c8292cc32b92c1db723fcfff22", 137 + "type": "github" 138 + }, 139 + "original": { 140 + "owner": "llvm", 141 + "ref": "release/19.x", 142 + "repo": "llvm-project", 143 + "type": "github" 144 + } 145 + }, 96 146 "make-shell": { 97 147 "inputs": { 98 148 "flake-compat": "flake-compat_2" ··· 111 161 "type": "github" 112 162 } 113 163 }, 164 + "musl": { 165 + "flake": false, 166 + "locked": { 167 + "lastModified": 1736261761, 168 + "narHash": "sha256-cZX+YcBL7O1TwZU+/vvD9zDE6r9Kwl4cZL3LRq5twGg=", 169 + "owner": "tombl", 170 + "repo": "musl", 171 + "rev": "9a99dba423852dbaffeb9f9bedad63cefed6e065", 172 + "type": "github" 173 + }, 174 + "original": { 175 + "owner": "tombl", 176 + "ref": "args", 177 + "repo": "musl", 178 + "type": "github" 179 + } 180 + }, 114 181 "nixpkgs": { 115 182 "locked": { 116 183 "lastModified": 1735412871, ··· 141 208 }, 142 209 "root": { 143 210 "inputs": { 211 + "busybox": "busybox", 144 212 "flake-parts": "flake-parts", 145 213 "git-hooks": "git-hooks", 214 + "linux": "linux", 215 + "llvm": "llvm", 146 216 "make-shell": "make-shell", 217 + "musl": "musl", 147 218 "nixpkgs": "nixpkgs", 148 219 "treefmt-nix": "treefmt-nix" 149 220 }
+31
flake.nix
··· 19 19 inputs.nixpkgs.follows = "nixpkgs"; 20 20 }; 21 21 # keep-sorted end 22 + 23 + # package sources: 24 + # keep-sorted start block=yes 25 + busybox = { 26 + url = "github:tombl/busybox"; 27 + flake = false; 28 + }; 29 + linux = { 30 + url = "github:tombl/linux/args"; 31 + flake = false; 32 + }; 33 + llvm = { 34 + url = "github:llvm/llvm-project/release/19.x"; 35 + flake = false; 36 + }; 37 + musl = { 38 + url = "github:tombl/musl/args"; 39 + flake = false; 40 + }; 41 + # keep-sorted end 22 42 }; 23 43 outputs = 24 44 inputs: ··· 37 57 "x86_64-darwin" 38 58 "aarch64-darwin" 39 59 ]; 60 + 61 + perSystem = 62 + { pkgs, system, ... }: 63 + { 64 + packages = import ./all-packages.nix { 65 + inherit (inputs.nixpkgs) lib; 66 + inherit inputs; 67 + currentSystem = system; 68 + hostpkgs = import ./host-packages.nix { inherit pkgs; }; 69 + }; 70 + }; 40 71 }; 41 72 }
+26
host-packages.nix
··· 1 + # basic build dependencies from nixpkgs for cross compilation 2 + 3 + { pkgs }: 4 + 5 + let 6 + llvm = pkgs.llvmPackages_19; 7 + in 8 + 9 + { 10 + clang = llvm.clang-unwrapped; 11 + clang-host = llvm.clang; 12 + inherit (llvm) lld; 13 + inherit (pkgs) 14 + bc 15 + bison 16 + busybox 17 + esbuild 18 + findutils 19 + flex 20 + gnumake 21 + perl 22 + rsync 23 + wabt 24 + ; 25 + llvm = llvm.libllvm; 26 + }
+59
packages/busybox/package.nix
··· 1 + { 2 + inputs, 3 + run, 4 + 5 + clang-host ? clang, 6 + clang, 7 + compiler-rt, 8 + gnumake, 9 + linux, 10 + lld, 11 + llvm, 12 + musl, 13 + }: 14 + 15 + run 16 + { 17 + name = "busybox"; 18 + src = inputs.busybox; 19 + path = [ 20 + clang 21 + gnumake 22 + lld 23 + llvm 24 + ]; 25 + } 26 + '' 27 + alias make="make -j$NIX_BUILD_CORES \ 28 + ARCH=wasm32 \ 29 + HOSTCC=${clang-host}/bin/clang \ 30 + CC=${clang}/bin/clang \ 31 + CFLAGS_busybox=\"${musl}/lib/crt1.o -g -Wl,--import-memory\"" 32 + 33 + config() { 34 + sed -i "/CONFIG_$1=/d" .config 35 + sed -i "/CONFIG_$1 is not set/d" .config 36 + case $2 in 37 + y|n) echo "CONFIG_$1=$2" >> .config ;; 38 + *) echo "CONFIG_$1=\"$2\"" >> .config ;; 39 + esac 40 + } 41 + 42 + make defconfig 43 + config STATIC y 44 + config NOMMU y 45 + config STATIC_LIBGCC n 46 + config CROSS_COMPILER_PREFIX llvm- 47 + config SYSROOT ${musl} 48 + config EXTRA_CFLAGS '-nostdlib -isystem ${musl}/include -I${linux.headers}/include' 49 + config EXTRA_LDFLAGS ${compiler-rt}/libclang_rt.builtins-wasm32.a 50 + config EXTRA_LDLIBS c 51 + 52 + cat .config 53 + make oldconfig 54 + 55 + make 56 + 57 + mkdir -p $out/bin 58 + cp busybox $out/bin 59 + ''
packages/compiler-rt/package.nix

This is a binary file and will not be displayed.

+64
packages/linux/package.nix
··· 1 + { 2 + inputs, 3 + run, 4 + 5 + bc, 6 + bison, 7 + clang-host ? clang, 8 + clang, 9 + esbuild, 10 + findutils, 11 + flex, 12 + gnumake, 13 + lld, 14 + llvm, 15 + perl, 16 + rsync, 17 + wabt, 18 + 19 + enableDebug ? false, 20 + }: 21 + 22 + run 23 + { 24 + name = "linux"; 25 + src = inputs.linux; 26 + path = [ 27 + bc 28 + bison 29 + clang 30 + esbuild 31 + findutils 32 + flex 33 + gnumake 34 + lld 35 + llvm 36 + perl 37 + rsync 38 + wabt 39 + ]; 40 + outputs = [ 41 + "out" 42 + "headers" 43 + ]; 44 + } 45 + '' 46 + alias make="make -j$NIX_BUILD_CORES HOSTCC=${clang-host}/bin/clang TSC=true" 47 + 48 + make defconfig 49 + ${if enableDebug then "make debug.config" else ""} 50 + 51 + # this is a horrible dirty hack but there's some non-deterministic build failure 52 + for i in $(seq 1 3); do 53 + if make -C tools/wasm; then 54 + break 55 + fi 56 + done 57 + 58 + mkdir $out 59 + rm tools/wasm/public/dist 60 + cp tools/wasm/public/* $out/ 61 + cp -r tools/wasm/dist $out/dist 62 + 63 + make headers_install INSTALL_HDR_PATH=$headers 64 + ''
+33
packages/musl/package.nix
··· 1 + { 2 + inputs, 3 + run, 4 + 5 + clang, 6 + gnumake, 7 + lld, 8 + llvm, 9 + }: 10 + 11 + run 12 + { 13 + name = "musl"; 14 + src = inputs.musl; 15 + path = [ 16 + clang 17 + gnumake 18 + lld 19 + llvm 20 + ]; 21 + # TODO: split for size, only relevant for dynamic linking 22 + # outputs = [ "out" "dev" ]; 23 + } 24 + '' 25 + cat >config.mak <<EOF 26 + ARCH=wasm32 27 + prefix=$out 28 + syslibdir=$out 29 + EOF 30 + 31 + mkdir $out 32 + make -j$NIX_BUILD_CORES install-libs install-headers 33 + ''
+28
todo.md
··· 1 + - split these into separate packages: 2 + - the kernel 3 + - the js host library 4 + - the deno runner 5 + - the web ui 6 + - musl 7 + - patch/wrap/configure clang to include libc.a and crt1.o 8 + - busybox 9 + - generate initramfs 10 + - generate bundle of kernel+lib+ui+initramfs 11 + - make 12 + - gnu coreutils 13 + - util-linux 14 + - bash 15 + - cmake 16 + - cpio 17 + - ninja 18 + - llvm/clang/wasm-ld 19 + - go 20 + - esbuild 21 + - kernel 22 + - perl, bc, bison, flex 23 + - cpython 24 + - meson 25 + - apk-tools 26 + - distribute nix built packages as apk packages 27 + - pkg-config, glib 28 + - ncurses