Skip to content

Commit

Permalink
chore: add a minimal nix flake (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
matifali committed Apr 30, 2024
1 parent 6d1b736 commit 3cc9802
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Expand Up @@ -4,6 +4,17 @@ Terraform provider for [Coder](https://github.com/coder/coder).

### Developing

#### Prerequisites

- [Go](https://golang.org/doc/install)
- [Terraform](https://learn.hashicorp.com/tutorials/terraform/install-cli)

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.

Alternatively, you can install the dependencies manually.

#### Building

Follow the instructions outlined in the [Terraform documentation](https://developer.hashicorp.com/terraform/cli/config/config-file#development-overrides-for-provider-developers)
to setup your local Terraform to use your local version rather than the registry version.

Expand Down
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions flake.nix
@@ -0,0 +1,29 @@
{
description = "Terraform provider for Coder";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
};
in
{
devShell = pkgs.mkShell {
name = "devShell";
buildInputs = with pkgs; [
terraform
go_1_20
];
};
}
);
}

0 comments on commit 3cc9802

Please sign in to comment.