Something went wrong. Try again.
Just a first repo to make sure I have tangled and everything set up correctly. I figured this would be a good way to say hello :)
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546{ description = "TSX (React + TypeScript) dev environment";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs = { self, nixpkgs }: let systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f { pkgs = import nixpkgs { inherit system; }; }); in { devShells = forAllSystems ({ pkgs }: { default = pkgs.mkShell { packages = with pkgs; [ nodejs nodePackages.npm nodePackages.typescript nodePackages.typescript-language-server nodePackages.prettier nodePackages.eslint ]; }; });
apps = forAllSystems ({ pkgs }: { default = { type = "app"; program = toString (pkgs.writeShellScript "typecheck-tsx" '' WORK=$(mktemp -d) trap "rm -rf $WORK" EXIT cp ${./hello.tsx} "$WORK/" cat > "$WORK/tsconfig.json" <<EOF { "compilerOptions": { "jsx": "react-jsx", "strict": true, "noEmit": true } } EOF cd "$WORK" ${pkgs.nodePackages.typescript}/bin/tsc --noEmit 2>&1 || true echo "--- hello.tsx ---" cat ${./hello.tsx} ''); }; }); };}