[Linux-only] basically bloxstap for sober

add nix package

+120
+55
bun.nix
···
··· 1 + # Set of Bun packages to install 2 + { 3 + "@ocbwoy3/libocbwoy3" = { 4 + out_path = "@ocbwoy3/libocbwoy3"; 5 + name = "@ocbwoy3/libocbwoy3@0.0.5"; 6 + url = "https://registry.npmjs.org/@ocbwoy3/libocbwoy3/-/libocbwoy3-0.0.5.tgz"; 7 + hash = "sha512-zDm11Z5xzmOgsDg/E8Z9UFlMYjKdkUg28YE/Fwb0+NoVx5gKyj3D9eSbvBAOfTISTKkI3X2FTWHg3ehvyLz1Fg=="; 8 + }; 9 + "@types/bun" = { 10 + out_path = "@types/bun"; 11 + name = "@types/bun@1.2.20"; 12 + url = "https://registry.npmjs.org/@types/bun/-/bun-1.2.20.tgz"; 13 + hash = "sha512-dX3RGzQ8+KgmMw7CsW4xT5ITBSCrSbfHc36SNT31EOUg/LA9JWq0VDdEXDRSe1InVWpd2yLUM1FUF/kEOyTzYA=="; 14 + }; 15 + "@types/node" = { 16 + out_path = "@types/node"; 17 + name = "@types/node@24.2.1"; 18 + url = "https://registry.npmjs.org/@types/node/-/node-24.2.1.tgz"; 19 + hash = "sha512-DRh5K+ka5eJic8CjH7td8QpYEV6Zo10gfRkjHCO3weqZHWDtAaSTFtl4+VMqOJ4N5jcuhZ9/l+yy8rVgw7BQeQ=="; 20 + }; 21 + "@types/react" = { 22 + out_path = "@types/react"; 23 + name = "@types/react@19.1.10"; 24 + url = "https://registry.npmjs.org/@types/react/-/react-19.1.10.tgz"; 25 + hash = "sha512-EhBeSYX0Y6ye8pNebpKrwFJq7BoQ8J5SO6NlvNwwHjSj6adXJViPQrKlsyPw7hLBLvckEMO1yxeGdR82YBBlDg=="; 26 + }; 27 + "bun-types" = { 28 + out_path = "bun-types"; 29 + name = "bun-types@1.2.20"; 30 + url = "https://registry.npmjs.org/bun-types/-/bun-types-1.2.20.tgz"; 31 + hash = "sha512-pxTnQYOrKvdOwyiyd/7sMt9yFOenN004Y6O4lCcCUoKVej48FS5cvTw9geRaEcB9TsDZaJKAxPTVvi8tFsVuXA=="; 32 + }; 33 + "csstype" = { 34 + out_path = "csstype"; 35 + name = "csstype@3.1.3"; 36 + url = "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz"; 37 + hash = "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="; 38 + }; 39 + "typescript" = { 40 + out_path = "typescript"; 41 + binaries = { 42 + "tsc" = "../typescript/bin/tsc"; 43 + "tsserver" = "../typescript/bin/tsserver"; 44 + }; 45 + name = "typescript@5.9.2"; 46 + url = "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz"; 47 + hash = "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A=="; 48 + }; 49 + "undici-types" = { 50 + out_path = "undici-types"; 51 + name = "undici-types@7.10.0"; 52 + url = "https://registry.npmjs.org/undici-types/-/undici-types-7.10.0.tgz"; 53 + hash = "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag=="; 54 + }; 55 + }
+8
default.nix
···
··· 1 + { mkBunDerivation, ... }: 2 + 3 + mkBunDerivation { 4 + packageJson = ./package.json; 5 + src = ./.; 6 + bunNix = ./bun.nix; 7 + index = "src/index.ts"; 8 + }
+57
flake.nix
···
··· 1 + { 2 + description = "Bun2Nix minimal sample"; 3 + 4 + inputs = { 5 + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; 6 + systems.url = "github:nix-systems/default"; 7 + 8 + bun2nix = { 9 + url = "github:baileyluTCD/bun2nix"; 10 + inputs.nixpkgs.follows = "nixpkgs"; 11 + inputs.systems.follows = "systems"; 12 + } 13 + }; 14 + 15 + nixConfig = { 16 + extra-substituters = [ 17 + "https://cache.nixos.org" 18 + "https://cache.garnix.io" 19 + ]; 20 + extra-trusted-public-keys = [ 21 + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" 22 + "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" 23 + ]; 24 + }; 25 + 26 + outputs = 27 + { 28 + nixpkgs, 29 + systems, 30 + bun2nix, 31 + ... 32 + }: 33 + let 34 + eachSystem = nixpkgs.lib.genAttrs (import systems); 35 + pkgsFor = eachSystem (system: import nixpkgs { inherit system; }); 36 + in 37 + { 38 + packages = eachSystem (system: { 39 + default = pkgsFor.${system}.callPackage ./default.nix { 40 + inherit (bun2nix.lib.${system}) mkBunDerivation; 41 + }; 42 + }); 43 + 44 + devShells = eachSystem (system: { 45 + default = pkgsFor.${system}.mkShell { 46 + packages = with pkgsFor.${system}; [ 47 + bun 48 + bun2nix.packages.${system}.default 49 + ]; 50 + 51 + shellHook = '' 52 + bun install --frozen-lockfile 53 + ''; 54 + }; 55 + }); 56 + }; 57 + }