Add nix devshell

This commit is contained in:
Abel Luck 2025-06-03 13:25:51 +02:00
parent 3702fc3acb
commit 1c7de4fc91
4 changed files with 88 additions and 0 deletions

3
.envrc Normal file
View file

@ -0,0 +1,3 @@
if has nix; then
use flake
fi

1
.gitignore vendored
View file

@ -37,3 +37,4 @@ terraform-provider-tor
dev/
CLAUDE.md
extra
.direnv

25
flake.lock generated Normal file
View file

@ -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
}

59
flake.nix Normal file
View file

@ -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;
};
}
);
};
}