From 3aca700003a1f5bdaa85d11dba8e86d00bb5fedd Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Fri, 29 Jul 2022 02:49:09 +0200 Subject: [PATCH] Fix protobuf env --- README.md | 30 ++++++++++++++++-------------- dhall/flake.lock | 6 +++--- elixir/flake.lock | 6 +++--- flake.nix | 5 +++++ gleam/flake.lock | 6 +++--- go1.17/flake.lock | 6 +++--- go1.18/flake.lock | 6 +++--- java/flake.lock | 6 +++--- kotlin/flake.lock | 6 +++--- nix/flake.lock | 6 +++--- node/flake.lock | 6 +++--- protobuf/.envrc | 1 + protobuf/flake.lock | 42 ++++++++++++++++++++++++++++++++++++++++++ protobuf/flake.nix | 26 ++++++++++++++++++++++++++ rust/flake.lock | 6 +++--- scala/flake.lock | 6 +++--- zig/flake.lock | 6 +++--- 17 files changed, 126 insertions(+), 50 deletions(-) create mode 100644 protobuf/.envrc create mode 100644 protobuf/flake.lock create mode 100644 protobuf/flake.nix diff --git a/README.md b/README.md index 83dbc51..e8ad999 100644 --- a/README.md +++ b/README.md @@ -14,20 +14,21 @@ nix flake init --template github:the-nix-way/dev-templates#rust Available templates: -| Language/framework/tool | Template | -| :---------------------- | :-------------------- | -| [Dhall] | [`dhall`](./dhall/) | -| [Elixir] | [`elixir`](./elixir/) | -| [Gleam] | [`gleam`](./gleam/) | -| [Go] 1.17 | [`go1_17`](./go1.17/) | -| [Go] 1.18 | [`go1_18`](./go1.18/) | -| [Java] | [`java`](./java/) | -| [Kotlin] | [`kotlin`](./kotlin/) | -| [Nix] | [`nix`](./nix/) | -| [Node.js][node] | [`node`](./node/) | -| [Rust] | [`rust`](./rust/) | -| [Scala] | [`scala`](./scala/) | -| [Zig] | [`zig`](./zig/) | +| Language/framework/tool | Template | +| :---------------------- | :------------------------ | +| [Dhall] | [`dhall`](./dhall/) | +| [Elixir] | [`elixir`](./elixir/) | +| [Gleam] | [`gleam`](./gleam/) | +| [Go] 1.17 | [`go1_17`](./go1.17/) | +| [Go] 1.18 | [`go1_18`](./go1.18/) | +| [Java] | [`java`](./java/) | +| [Kotlin] | [`kotlin`](./kotlin/) | +| [Nix] | [`nix`](./nix/) | +| [Node.js][node] | [`node`](./node/) | +| [Protobuf] | [`protobuf`](./protobuf/) | +| [Rust] | [`rust`](./rust/) | +| [Scala] | [`scala`](./scala/) | +| [Zig] | [`zig`](./zig/) | [dhall]: https://dhall-lang.org [elixir]: https://elixir-lang.org @@ -37,6 +38,7 @@ Available templates: [kotlin]: https://kotlinlang.org [nix]: https://nixos.org [node]: https://nodejs.org +[protobuf]: https://developers.google.com/protocol-buffers [rust]: https://rust-lang.org [scala]: https://scala-lang.org [zig]: https://ziglang.org diff --git a/dhall/flake.lock b/dhall/flake.lock index de0c2f4..352d841 100644 --- a/dhall/flake.lock +++ b/dhall/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659054591, - "narHash": "sha256-Ae4s4jHi1BHcowaS1VLXAdNlWUiAkY/GhZwuevWbgb4=", + "lastModified": 1659055503, + "narHash": "sha256-xav158P+xCxV01Nw0cHvvkGtw1qkxbivwdCk1nQb798=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0d3888a5213362bbeb04f9c83ff6856c8f8a4ff2", + "rev": "acc7ae948ffaaa9335ca58e3bc1e70626b53a733", "type": "github" }, "original": { diff --git a/elixir/flake.lock b/elixir/flake.lock index de0c2f4..352d841 100644 --- a/elixir/flake.lock +++ b/elixir/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659054591, - "narHash": "sha256-Ae4s4jHi1BHcowaS1VLXAdNlWUiAkY/GhZwuevWbgb4=", + "lastModified": 1659055503, + "narHash": "sha256-xav158P+xCxV01Nw0cHvvkGtw1qkxbivwdCk1nQb798=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0d3888a5213362bbeb04f9c83ff6856c8f8a4ff2", + "rev": "acc7ae948ffaaa9335ca58e3bc1e70626b53a733", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 6bb9202..f4e967f 100644 --- a/flake.nix +++ b/flake.nix @@ -78,6 +78,11 @@ description = "Node.js development environment"; }; + protobuf = { + path = ./protobuf; + description = "Protobuf development environment"; + }; + rust = { path = ./rust; description = "Rust development environment"; diff --git a/gleam/flake.lock b/gleam/flake.lock index de0c2f4..352d841 100644 --- a/gleam/flake.lock +++ b/gleam/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659054591, - "narHash": "sha256-Ae4s4jHi1BHcowaS1VLXAdNlWUiAkY/GhZwuevWbgb4=", + "lastModified": 1659055503, + "narHash": "sha256-xav158P+xCxV01Nw0cHvvkGtw1qkxbivwdCk1nQb798=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0d3888a5213362bbeb04f9c83ff6856c8f8a4ff2", + "rev": "acc7ae948ffaaa9335ca58e3bc1e70626b53a733", "type": "github" }, "original": { diff --git a/go1.17/flake.lock b/go1.17/flake.lock index de0c2f4..352d841 100644 --- a/go1.17/flake.lock +++ b/go1.17/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659054591, - "narHash": "sha256-Ae4s4jHi1BHcowaS1VLXAdNlWUiAkY/GhZwuevWbgb4=", + "lastModified": 1659055503, + "narHash": "sha256-xav158P+xCxV01Nw0cHvvkGtw1qkxbivwdCk1nQb798=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0d3888a5213362bbeb04f9c83ff6856c8f8a4ff2", + "rev": "acc7ae948ffaaa9335ca58e3bc1e70626b53a733", "type": "github" }, "original": { diff --git a/go1.18/flake.lock b/go1.18/flake.lock index de0c2f4..352d841 100644 --- a/go1.18/flake.lock +++ b/go1.18/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659054591, - "narHash": "sha256-Ae4s4jHi1BHcowaS1VLXAdNlWUiAkY/GhZwuevWbgb4=", + "lastModified": 1659055503, + "narHash": "sha256-xav158P+xCxV01Nw0cHvvkGtw1qkxbivwdCk1nQb798=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0d3888a5213362bbeb04f9c83ff6856c8f8a4ff2", + "rev": "acc7ae948ffaaa9335ca58e3bc1e70626b53a733", "type": "github" }, "original": { diff --git a/java/flake.lock b/java/flake.lock index de0c2f4..352d841 100644 --- a/java/flake.lock +++ b/java/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659054591, - "narHash": "sha256-Ae4s4jHi1BHcowaS1VLXAdNlWUiAkY/GhZwuevWbgb4=", + "lastModified": 1659055503, + "narHash": "sha256-xav158P+xCxV01Nw0cHvvkGtw1qkxbivwdCk1nQb798=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0d3888a5213362bbeb04f9c83ff6856c8f8a4ff2", + "rev": "acc7ae948ffaaa9335ca58e3bc1e70626b53a733", "type": "github" }, "original": { diff --git a/kotlin/flake.lock b/kotlin/flake.lock index de0c2f4..352d841 100644 --- a/kotlin/flake.lock +++ b/kotlin/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659054591, - "narHash": "sha256-Ae4s4jHi1BHcowaS1VLXAdNlWUiAkY/GhZwuevWbgb4=", + "lastModified": 1659055503, + "narHash": "sha256-xav158P+xCxV01Nw0cHvvkGtw1qkxbivwdCk1nQb798=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0d3888a5213362bbeb04f9c83ff6856c8f8a4ff2", + "rev": "acc7ae948ffaaa9335ca58e3bc1e70626b53a733", "type": "github" }, "original": { diff --git a/nix/flake.lock b/nix/flake.lock index de0c2f4..352d841 100644 --- a/nix/flake.lock +++ b/nix/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659054591, - "narHash": "sha256-Ae4s4jHi1BHcowaS1VLXAdNlWUiAkY/GhZwuevWbgb4=", + "lastModified": 1659055503, + "narHash": "sha256-xav158P+xCxV01Nw0cHvvkGtw1qkxbivwdCk1nQb798=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0d3888a5213362bbeb04f9c83ff6856c8f8a4ff2", + "rev": "acc7ae948ffaaa9335ca58e3bc1e70626b53a733", "type": "github" }, "original": { diff --git a/node/flake.lock b/node/flake.lock index de0c2f4..352d841 100644 --- a/node/flake.lock +++ b/node/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659054591, - "narHash": "sha256-Ae4s4jHi1BHcowaS1VLXAdNlWUiAkY/GhZwuevWbgb4=", + "lastModified": 1659055503, + "narHash": "sha256-xav158P+xCxV01Nw0cHvvkGtw1qkxbivwdCk1nQb798=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0d3888a5213362bbeb04f9c83ff6856c8f8a4ff2", + "rev": "acc7ae948ffaaa9335ca58e3bc1e70626b53a733", "type": "github" }, "original": { diff --git a/protobuf/.envrc b/protobuf/.envrc new file mode 100644 index 0000000..a5dbbcb --- /dev/null +++ b/protobuf/.envrc @@ -0,0 +1 @@ +use flake . diff --git a/protobuf/flake.lock b/protobuf/flake.lock new file mode 100644 index 0000000..352d841 --- /dev/null +++ b/protobuf/flake.lock @@ -0,0 +1,42 @@ +{ + "nodes": { + "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": 1659055503, + "narHash": "sha256-xav158P+xCxV01Nw0cHvvkGtw1qkxbivwdCk1nQb798=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "acc7ae948ffaaa9335ca58e3bc1e70626b53a733", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/protobuf/flake.nix b/protobuf/flake.nix new file mode 100644 index 0000000..28ecf8c --- /dev/null +++ b/protobuf/flake.nix @@ -0,0 +1,26 @@ +{ + description = "A Nix-flake-based Protobuf development environment"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + inherit (pkgs) buf protobuf; + in { + devShells = { + default = pkgs.mkShell { + buildInputs = [ buf protobuf ]; + + shellHook = '' + echo "buf `${buf}/bin/buf --version`" + ${protobuf}/bin/protoc --version + ''; + }; + }; + }); +} diff --git a/rust/flake.lock b/rust/flake.lock index 5039e49..7867194 100644 --- a/rust/flake.lock +++ b/rust/flake.lock @@ -32,11 +32,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659054591, - "narHash": "sha256-Ae4s4jHi1BHcowaS1VLXAdNlWUiAkY/GhZwuevWbgb4=", + "lastModified": 1659055503, + "narHash": "sha256-xav158P+xCxV01Nw0cHvvkGtw1qkxbivwdCk1nQb798=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0d3888a5213362bbeb04f9c83ff6856c8f8a4ff2", + "rev": "acc7ae948ffaaa9335ca58e3bc1e70626b53a733", "type": "github" }, "original": { diff --git a/scala/flake.lock b/scala/flake.lock index de0c2f4..352d841 100644 --- a/scala/flake.lock +++ b/scala/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659054591, - "narHash": "sha256-Ae4s4jHi1BHcowaS1VLXAdNlWUiAkY/GhZwuevWbgb4=", + "lastModified": 1659055503, + "narHash": "sha256-xav158P+xCxV01Nw0cHvvkGtw1qkxbivwdCk1nQb798=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0d3888a5213362bbeb04f9c83ff6856c8f8a4ff2", + "rev": "acc7ae948ffaaa9335ca58e3bc1e70626b53a733", "type": "github" }, "original": { diff --git a/zig/flake.lock b/zig/flake.lock index de0c2f4..352d841 100644 --- a/zig/flake.lock +++ b/zig/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659054591, - "narHash": "sha256-Ae4s4jHi1BHcowaS1VLXAdNlWUiAkY/GhZwuevWbgb4=", + "lastModified": 1659055503, + "narHash": "sha256-xav158P+xCxV01Nw0cHvvkGtw1qkxbivwdCk1nQb798=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0d3888a5213362bbeb04f9c83ff6856c8f8a4ff2", + "rev": "acc7ae948ffaaa9335ca58e3bc1e70626b53a733", "type": "github" }, "original": {