Skip to content

Commit 3cc9802

Browse files
authored
chore: add a minimal nix flake (#216)
1 parent 6d1b736 commit 3cc9802

File tree

3 files changed

+101
-0
lines changed

3 files changed

+101
-0
lines changed

Diff for: README.md

+11
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ Terraform provider for [Coder](https://github.com/coder/coder).
44

55
### Developing
66

7+
#### Prerequisites
8+
9+
- [Go](https://golang.org/doc/install)
10+
- [Terraform](https://learn.hashicorp.com/tutorials/terraform/install-cli)
11+
12+
We recommend using [`nix`](https://nixos.org/download.html) to manage your development environment. If you have `nix` installed, you can run `nix develop` to enter a shell with all the necessary dependencies.
13+
14+
Alternatively, you can install the dependencies manually.
15+
16+
#### Building
17+
718
Follow the instructions outlined in the [Terraform documentation](https://developer.hashicorp.com/terraform/cli/config/config-file#development-overrides-for-provider-developers)
819
to setup your local Terraform to use your local version rather than the registry version.
920

Diff for: flake.lock

+61
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: flake.nix

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
description = "Terraform provider for Coder";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = { self, nixpkgs, flake-utils, ... }:
10+
flake-utils.lib.eachDefaultSystem (system:
11+
let
12+
pkgs = import nixpkgs {
13+
inherit system;
14+
config = {
15+
allowUnfree = true;
16+
};
17+
};
18+
in
19+
{
20+
devShell = pkgs.mkShell {
21+
name = "devShell";
22+
buildInputs = with pkgs; [
23+
terraform
24+
go_1_20
25+
];
26+
};
27+
}
28+
);
29+
}

0 commit comments

Comments
 (0)