diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..988d72b --- /dev/null +++ b/.envrc @@ -0,0 +1,3 @@ +if has nix; then + use flake +fi diff --git a/.gitignore b/.gitignore index 127b4dd..fd58f0b 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ terraform-provider-tor dev/ CLAUDE.md extra +.direnv diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..b1e78e6 --- /dev/null +++ b/flake.lock @@ -0,0 +1,25 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1748693115, + "narHash": "sha256-StSrWhklmDuXT93yc3GrTlb0cKSS0agTAxMGjLKAsY8=", + "rev": "910796cabe436259a29a72e8d3f5e180fc6dfacc", + "revCount": 808478, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.808478%2Brev-910796cabe436259a29a72e8d3f5e180fc6dfacc/01972ad6-3b3d-7826-b788-216d339063fe/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.1" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..8b5a7d7 --- /dev/null +++ b/flake.nix @@ -0,0 +1,59 @@ +{ + description = "terraform-provider-tor"; + inputs = { + nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1"; # tracks nixpkgs unstable branch + }; + outputs = + inputs: + let + supportedSystems = [ + "x86_64-linux" + ]; + forEachSupportedSystem = + f: + inputs.nixpkgs.lib.genAttrs supportedSystems ( + system: + f { + pkgs = import inputs.nixpkgs { + inherit system; + overlays = [ + inputs.self.overlays.default + ]; + }; + pkgs-mine = import inputs.nixpkgs-mine { + inherit system; + overlays = [ + inputs.self.overlays.default + ]; + }; + } + ); + in + { + overlays.default = + final: prev: + { + }; + + devShells = forEachSupportedSystem ( + { pkgs, pkgs-mine }: + let + libraries = [ + ]; + in + { + default = pkgs.mkShell { + packages = [ + pkgs.go + pkgs.golangci-lint + pkgs.obfs4 + ]; + buildInputs = libraries; + inputsFrom = libraries; + nativeBuildInputs = [ pkgs.pkg-config ]; + env.LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath libraries; + }; + } + ); + }; +}