collab/polyglot-riscv-arm
what if the same machine code was valid riscv and arm asm
git clone https://git.julia.blue/collab/polyglot-riscv-arm
9692cf7
main
1{ 2inputs = { 3nixpkgs . url = "github:NixOS/nixpkgs/nixos-unstable" ; 4flake-utils . url = "github:numtide/flake-utils" ; 5}; 6outputs = { self , nixpkgs , flake-utils } : 7flake-utils . lib . eachDefaultSystem ( system : 8let 9pkgs = import nixpkgs { inherit system ; }; 10npmDepsHash = "sha256-etm87fsOnQc6KFl/yaLUtDyw4gc4rL27Zzpr4w5ndMU=" ; 11 12nativeBuildInputs = with pkgs ; [ 13cargo 14rustc 15lld 16]; 17buildInputs = with pkgs ; [ nodejs wasm-pack ]; 18 19dev = with pkgs ; 20writeScriptBin "dev" '' 21npx rollup --config --watch 22'' ; 23prefetch = with pkgs ; 24writeScriptBin "prefetch" '' 25nix run nixpkgs#prefetch-npm-deps package-lock.json 26'' ; 27nerdfonts = 28pkgs . nerdfonts . override { fonts = [ "NerdFontsSymbolsOnly" ]; }; 29in 30with pkgs ; rec { 31packages = rec { 32website = pkgs . buildNpmPackage { 33name = "polyglot-riscv-arm" ; 34version = "22-05-2024" ; 35src = ./. ; 36inherit nativeBuildInputs buildInputs npmDepsHash ; 37configurePhase = '' 38mkdir -p ./dist/fonts 39ln -sf ${ nerdfonts } /share/fonts/truetype/NerdFonts/* ./dist/fonts/ 40ln -sf ${ pkgs . fira } /share/fonts/opentype/* ./dist/fonts/ 41ln -sf ${ pkgs . jetbrains-mono } /share/fonts/truetype/* ./dist/fonts/ 42ln -sf ${ pkgs . fira-mono } /share/fonts/opentype/* ./dist/fonts/ 43'' ; 44buildPhase = '' 45npx rollup --config 46'' ; 47installPhase = '' 48cp -pr dist $ out / 49'' ; 50}; 51default = website ; 52}; 53devShells . default = mkShell { 54buildInputs = buildInputs ++ [ prefetch ]; 55inherit nativeBuildInputs ; 56packages = with pkgs ; [ 57lychee 58dev 59rust-analyzer 60]; 61shellHook = packages . website . configurePhase ; 62}; 63}); 64}