Add OPA dev

This commit is contained in:
Luc Perkins 2022-07-31 21:59:08 +02:00
parent 5a77cf829a
commit 26edc7b80b
No known key found for this signature in database
GPG key ID: 4F102D0C16E232F2
5 changed files with 114 additions and 16 deletions

View file

@ -27,22 +27,23 @@ Once your preferred template has been initialized, you can use the provided shel
## Available templates ## Available templates
| Language/framework/tool | Template | | Language/framework/tool | Template |
| :---------------------- | :------------------------ | | :----------------------- | :------------------------ |
| [Dhall] | [`dhall`](./dhall/) | | [Dhall] | [`dhall`](./dhall/) |
| [Elixir] | [`elixir`](./elixir/) | | [Elixir] | [`elixir`](./elixir/) |
| [Gleam] | [`gleam`](./gleam/) | | [Gleam] | [`gleam`](./gleam/) |
| [Go] 1.17 | [`go1_17`](./go1.17/) | | [Go] 1.17 | [`go1_17`](./go1.17/) |
| [Go] 1.18 | [`go1_18`](./go1.18/) | | [Go] 1.18 | [`go1_18`](./go1.18/) |
| [Hashicorp] tools | [`hashi`](./hashi/) | | [Hashicorp] tools | [`hashi`](./hashi/) |
| [Java] | [`java`](./java/) | | [Java] | [`java`](./java/) |
| [Kotlin] | [`kotlin`](./kotlin/) | | [Kotlin] | [`kotlin`](./kotlin/) |
| [Nix] | [`nix`](./nix/) | | [Nix] | [`nix`](./nix/) |
| [Node.js][node] | [`node`](./node/) | | [Node.js][node] | [`node`](./node/) |
| [Protobuf] | [`protobuf`](./protobuf/) | | [Open Policy Agent][opa] | [`opa`](./opa) |
| [Rust] | [`rust`](./rust/) | | [Protobuf] | [`protobuf`](./protobuf/) |
| [Scala] | [`scala`](./scala/) | | [Rust] | [`rust`](./rust/) |
| [Zig] | [`zig`](./zig/) | | [Scala] | [`scala`](./scala/) |
| [Zig] | [`zig`](./zig/) |
## Template contents ## Template contents
@ -138,6 +139,11 @@ The sections below list what each template includes. In all cases, you're free t
- [pnpm] 7.3.0 - [pnpm] 7.3.0
- [Yarn] 1.22.19 - [Yarn] 1.22.19
### [`opa`](./opa/)
- [Open Policy Agent][opa] 0.43.0
- [Conftest] 0.33.2
### [`protobuf`](./protobuf/) ### [`protobuf`](./protobuf/)
- The [Buf CLI][buf] 1.7.0 - The [Buf CLI][buf] 1.7.0
@ -205,6 +211,7 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T
[nomad]: https://nomadproject.io [nomad]: https://nomadproject.io
[nomad-autoscaler]: TOhttps://github.com/hashicorp/nomad-autoscaler [nomad-autoscaler]: TOhttps://github.com/hashicorp/nomad-autoscaler
[nomad-pack]: https://github.com/hashicorp/nomad-pack [nomad-pack]: https://github.com/hashicorp/nomad-pack
[opa]: https://openpolicyagent.org
[packer]: https://packer.io [packer]: https://packer.io
[phoenix]: https://phoenixframework.org [phoenix]: https://phoenixframework.org
[pnpm]: https://pnpm.io [pnpm]: https://pnpm.io

View file

@ -109,6 +109,11 @@
description = "Node.js development environment"; description = "Node.js development environment";
}; };
opa = {
path = ./opa;
description = "Open Policy Agent development environment";
};
protobuf = { protobuf = {
path = ./protobuf; path = ./protobuf;
description = "Protobuf development environment"; description = "Protobuf development environment";

1
opa/.envrc Normal file
View file

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

60
opa/flake.lock Normal file
View file

@ -0,0 +1,60 @@
{
"nodes": {
"dev": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1659291915,
"narHash": "sha256-W1on31THSVnqFf/eC8wxP+oGu1jRpFb7K419w21ijNc=",
"owner": "the-nix-way",
"repo": "dev-templates",
"rev": "41e9f202186994255e28bfa4c518e0c9ffce2bb5",
"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": 1659291823,
"narHash": "sha256-8GrIQYelrtzEAXDWdfHpAodwrjL08mVES7nRDXSF9fE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4a778d9b98941fe28f0ac4b8400749a16dbb03fe",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"dev": "dev"
}
}
},
"root": "root",
"version": 7
}

25
opa/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) conftest mkShell open-policy-agent;
opaTools = [ conftest open-policy-agent ];
in {
devShells = {
default = mkShell {
buildInputs = opaTools;
shellHook = ''
${open-policy-agent}/bin/opa version
'';
};
};
});
}