diff --git a/README.md b/README.md index 14c1803..927757e 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Once your preferred template has been initialized, you can use the provided shel | Language/framework/tool | Template | | :----------------------- | :---------------------------- | +| [Bun] | [`bun`](./bun/) | | [C]/[C++] | [`c-cpp`](./c-cpp/) | | [Clojure] | [`clojure`](./clojure/) | | [C#][csharp] | [`csharp`](./csharp/) | @@ -65,6 +66,10 @@ Once your preferred template has been initialized, you can use the provided shel The sections below list what each template includes. In all cases, you're free to add and remove packages as you see fit; the templates are just boilerplate. +### [`bun`](./bun/) + +- [bun] 1.1.8 + ### [`c-cpp`](./c-cpp/) - [clang-tools] 17.0.6 @@ -283,6 +288,7 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T [boot]: https://www.boot-clj.com [buf]: https://github.com/bufbuild/buf +[bun]: https://bun.sh/ [C]: https://www.open-std.org/jtc1/sc22/wg14 [C++]: https://isocpp.org [cabal]: https://www.haskell.org/cabal diff --git a/bun/.envrc b/bun/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/bun/.envrc @@ -0,0 +1 @@ +use flake diff --git a/bun/flake.lock b/bun/flake.lock new file mode 100644 index 0000000..b5acb97 --- /dev/null +++ b/bun/flake.lock @@ -0,0 +1,25 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1715787315, + "narHash": "sha256-cYApT0NXJfqBkKcci7D9Kr4CBYZKOQKDYA23q8XNuWg=", + "rev": "33d1e753c82ffc557b4a585c77de43d4c922ebb5", + "revCount": 626834, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.626834%2Brev-33d1e753c82ffc557b4a585c77de43d4c922ebb5/018f8037-433d-77f3-b4bb-e542e48f7fd6/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A.tar.gz" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/bun/flake.nix b/bun/flake.nix new file mode 100644 index 0000000..53b46e4 --- /dev/null +++ b/bun/flake.nix @@ -0,0 +1,25 @@ +{ + description = "A Nix-flake-based Bun development environment"; + + inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz"; + + outputs = { self, nixpkgs }: + let + overlays = [ + (final: prev: rec { + bun = prev.bun; + }) + ]; + supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; + forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f { + pkgs = import nixpkgs { inherit overlays system; }; + }); + in + { + devShells = forEachSupportedSystem ({ pkgs }: { + default = pkgs.mkShell { + packages = with pkgs; [ bun ]; + }; + }); + }; +}