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

1
ruby/.envrc Normal file
View file

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

60
ruby/flake.lock generated 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
'';
};
};
});
}