Add Ruby env

This commit is contained in:
Luc Perkins 2022-07-31 22:18:29 +02:00
parent 056f6f7068
commit 2fcdc9353f
No known key found for this signature in database
GPG key ID: 4F102D0C16E232F2
5 changed files with 99 additions and 0 deletions

View file

@ -29,6 +29,7 @@ Once your preferred template has been initialized, you can use the provided shel
| Language/framework/tool | Template |
| :----------------------- | :------------------------ |
| [Cue] | [`cue`](./cue/) |
| [Dhall] | [`dhall`](./dhall/) |
| [Elixir] | [`elixir`](./elixir/) |
| [Gleam] | [`gleam`](./gleam/) |
@ -37,10 +38,12 @@ Once your preferred template has been initialized, you can use the provided shel
| [Hashicorp] tools | [`hashi`](./hashi/) |
| [Java] | [`java`](./java/) |
| [Kotlin] | [`kotlin`](./kotlin/) |
| [Nim] | [`nim`](./nim/) |
| [Nix] | [`nix`](./nix/) |
| [Node.js][node] | [`node`](./node/) |
| [Open Policy Agent][opa] | [`opa`](./opa) |
| [Protobuf] | [`protobuf`](./protobuf/) |
| [Ruby] | [`ruby`](./ruby/) |
| [Rust] | [`rust`](./rust/) |
| [Scala] | [`scala`](./scala/) |
| [Zig] | [`zig`](./zig/) |
@ -149,6 +152,10 @@ The sections below list what each template includes. In all cases, you're free t
- The [Buf CLI][buf] 1.7.0
- [protoc][protobuf] 3.19.4
### [`ruby`](./ruby/)
- [Ruby] 3.1.2p20, plus the standard Ruby tools (`bundle`, `gem`, etc.)
### [`rust`](./rust/)
- [Rust], including [cargo], [Clippy], and the other standard tools. The Rust version is determined as follows, in order:
@ -216,6 +223,7 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T
[phoenix]: https://phoenixframework.org
[pnpm]: https://pnpm.io
[protobuf]: https://developers.google.com/protocol-buffers
[ruby]: https://ruby-lang.org
[rust]: https://rust-lang.org
[scala]: https://scala-lang.org
[statix]: https://github.com/nerdypepper/statix

View file

@ -130,6 +130,11 @@
description = "Protobuf development environment";
};
ruby = {
path = ./ruby;
description = "Ruby development environment";
};
rust = {
path = ./rust;
description = "Rust development environment";

1
ruby/.envrc Normal file
View file

@ -0,0 +1 @@
use flake .

60
ruby/flake.lock Normal file
View file

@ -0,0 +1,60 @@
{
"nodes": {
"dev": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1659297620,
"narHash": "sha256-Uvb9YfBbnF4j+yA2y2EPWZapEdMwORPtsWFj3XpNYko=",
"owner": "the-nix-way",
"repo": "dev-templates",
"rev": "677e040123767876901e808ed6fb515b024558f5",
"type": "github"
},
"original": {
"owner": "the-nix-way",
"repo": "dev-templates",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1656928814,
"narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1659295566,
"narHash": "sha256-ICqvf+Y782V3G2XHe6m43dBkTzv0Y1DPgXcffoNqa2Q=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "33ab71dafbaa6674243830e29b11e8b674f49a70",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"dev": "dev"
}
}
},
"root": "root",
"version": 7
}

25
ruby/flake.nix Normal file
View file

@ -0,0 +1,25 @@
{
description = "A Nix-flake-based Protobuf development environment";
inputs = { dev.url = "github:the-nix-way/dev-templates"; };
outputs = { self, dev }:
let inherit (dev.lib) flake-utils nixpkgs;
in flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) mkShell;
ruby = pkgs.ruby_3_1;
in {
devShells = {
default = mkShell {
buildInputs = [ ruby ];
shellHook = ''
${ruby}/bin/ruby --version
'';
};
};
});
}