diff --git a/.envrc b/.envrc index 10eba288e..25799a3cc 100644 --- a/.envrc +++ b/.envrc @@ -1,5 +1,5 @@ # If we are a computer with nix-shell available, then use that to setup # the build environment with exactly what we need. if has nix-shell; then - use nix + use flake fi diff --git a/flake.lock b/flake.lock index 5f3798d66..08eaaf59f 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1685518550, - "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "lastModified": 1689068808, + "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", "owner": "numtide", "repo": "flake-utils", - "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", "type": "github" }, "original": { @@ -20,16 +20,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1685573264, - "narHash": "sha256-Zffu01pONhs/pqH07cjlF10NnMDLok8ix5Uk4rhOnZQ=", + "lastModified": 1691016377, + "narHash": "sha256-Vvi49vIL2CzX5bsfE3qovcmzJpkfMo/Mx/coCbu5Jeo=", "owner": "nixos", "repo": "nixpkgs", - "rev": "380be19fbd2d9079f677978361792cb25e8a3635", + "rev": "ad73028def6716978adaec5b0b7706edc611a83e", "type": "github" }, "original": { "owner": "nixos", - "ref": "release-22.05", + "ref": "release-23.05", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 673021aad..05b241820 100644 --- a/flake.nix +++ b/flake.nix @@ -1,22 +1,18 @@ { description = "HashiCorp Vagrant project"; - inputs.nixpkgs.url = "github:nixos/nixpkgs/release-22.05"; - inputs.flake-utils.url = "github:numtide/flake-utils"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/release-23.05"; + flake-utils.url = "github:numtide/flake-utils"; + }; outputs = { self, nixpkgs, flake-utils }: - let - localOverlay = import ./nix/overlay.nix; - overlays = [ localOverlay ]; - in flake-utils.lib.eachDefaultSystem (system: - let pkgs = import nixpkgs { inherit system overlays; }; - in { - legacyPackages = pkgs; - inherit (pkgs) devShell; - }) // { - # platform independent attrs - overlay = final: prev: - (nixpkgs.lib.composeManyExtensions overlays) final prev; - inherit overlays; - }; + flake-utils.lib.eachDefaultSystem (system: + let + localOverlay = import ./nix/overlay.nix; + pkgs = import nixpkgs { + system = "${system}"; + overlays = [ localOverlay ]; + }; + in { inherit (pkgs) devShells; }); } diff --git a/nix/go-mockery.nix b/nix/go-mockery.nix deleted file mode 100644 index 92d711abd..000000000 --- a/nix/go-mockery.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ buildGoModule, fetchFromGitHub }: - -buildGoModule rec { - pname = "go-mockery"; - version = "2.12.3"; - - src = fetchFromGitHub { - owner = "vektra"; - repo = "mockery"; - rev = "v${version}"; - sha256 = "sha256-3SF8vNYG0PrZhP3zcn9mV85ByQtGDumUcxglf35/eD0"; - }; - - buildFlagsArray = '' - -ldflags= - -s -w -X github.com/vektra/mockery/v2/pkg/config.SemVer=${version} - ''; - - modSha256 = "sha256-/ha6DCJ+vSOmfFJ+rjN6rfQ3GHZF19OQnmHjYRtSY2g="; - vendorSha256 = "sha256-/ha6DCJ+vSOmfFJ+rjN6rfQ3GHZF19OQnmHjYRtSY2g="; - - subPackages = ["."]; -} diff --git a/nix/go-protobuf.nix b/nix/go-protobuf.nix deleted file mode 100644 index 6ddcbf345..000000000 --- a/nix/go-protobuf.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ buildGoModule, fetchFromGitHub }: - -buildGoModule rec { - pname = "go-protobuf"; - version = "1.5.2"; - - src = fetchFromGitHub { - owner = "golang"; - repo = "protobuf"; - rev = "v${version}"; - sha256 = "1mh5fyim42dn821nsd3afnmgscrzzhn3h8rag635d2jnr23r1zhk"; - }; - - modSha256 = "0lnk2zpl6y9vnq6h3l42ssghq6iqvmixd86g2drpa4z8xxk116wf"; - vendorSha256 = "1qbndn7k0qqwxqk4ynkjrih7f7h56z1jq2yd62clhj95rca67hh9"; - - subPackages = [ "protoc-gen-go" ]; -} diff --git a/nix/go-tools.nix b/nix/go-tools.nix deleted file mode 100644 index fa1c3dc58..000000000 --- a/nix/go-tools.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ buildGoModule, fetchFromGitHub }: - -buildGoModule rec { - pname = "go-tools"; - version = "35839b7038afa36a6c000733552daa1f5ce1e838"; - - src = fetchFromGitHub { - owner = "golang"; - repo = "tools"; - rev = "35839b7038afa36a6c000733552daa1f5ce1e838"; - sha256 = "1gnqf62s7arqk807gadp4rd2diz1g0v2khwv9wsb50y8k9k4dfqs"; - }; - - modSha256 = "1pijbkp7a9n2naicg21ydii6xc0g4jm5bw42lljwaks7211ag8k9"; - vendorSha256 = "0i2fhaj2fd8ii4av1qx87wjkngip9vih8v3i9yr3h28hkq68zkm5"; - - subPackages = [ "cmd/stringer" ]; - - # This has to be enabled because the stringer tests recompile itself - # so it needs a valid reference to `go` - allowGoReference = true; -} diff --git a/nix/grpc-tools.nix b/nix/grpc-tools.nix index aa816c808..c146c6631 100644 --- a/nix/grpc-tools.nix +++ b/nix/grpc-tools.nix @@ -4,7 +4,7 @@ buildRubyGem rec { inherit ruby; name = "${gemName}-${version}"; gemName = "grpc-tools"; - version = "1.41.1"; - source.sha256 = "sha256-NlBwd8NRc8niZyOWUheqTgeYs6QP200jDWmEATeBXOE="; + version = "1.56.2"; + source.sha256 = "sha256-DBufMPdsZ3Ae0/uT8fyBNajjUeRsP5+CuGyKf+IpAEk="; nativeBuildInputs = [ autoPatchelfHook ]; } diff --git a/nix/overlay.nix b/nix/overlay.nix index 84c3334b4..3a9a95e91 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -1,20 +1,6 @@ final: prev: rec { - # This is the pinned protoc version we have for this project. - protobufPin = prev.protobuf3_19; - - ruby = final.ruby_3_1; - - devShell = final.callPackage ./vagrant.nix { }; - - go-protobuf = prev.callPackage ./go-protobuf.nix { }; - - go-protobuf-json = prev.callPackage ./go-protobuf-json.nix { }; - - go-tools = prev.callPackage ./go-tools.nix { }; - - grpc-tools = prev.callPackage ./grpc-tools.nix { }; - - go-mockery = prev.callPackage ./go-mockery.nix { }; - + devShells.default = final.callPackage ./vagrant.nix { }; go-changelog = prev.callPackage ./go-changelog.nix { }; + go-protobuf-json = prev.callPackage ./go-protobuf-json.nix { }; + grpc-tools = prev.callPackage ./grpc-tools.nix { }; } diff --git a/nix/vagrant.nix b/nix/vagrant.nix index addcc5773..660f30006 100644 --- a/nix/vagrant.nix +++ b/nix/vagrant.nix @@ -1,7 +1,7 @@ { lib, stdenv, autoconf, autogen, automake, go, go-bindata, go-changelog -, go-mockery, go-protobuf, go-protobuf-json, go-tools, grpc-tools, grpcurl -, libarchive, libpng, libtool, mkShell, nasm, nodejs-16_x, pkg-config -, protobufPin, protoc-gen-doc, protoc-gen-go-grpc, ruby, sqlite, zlib }: +, go-mockery, go-protobuf, go-protobuf-json, gotools, grpc-tools, grpcurl +, libarchive, libpng, libtool, mkShell, nasm, nodejs_20, pkg-config, protobuf +, protoc-gen-doc, protoc-gen-go-grpc, ruby, sqlite, zlib }: mkShell rec { name = "vagrant"; @@ -10,22 +10,23 @@ mkShell rec { go go-bindata grpcurl - nodejs-16_x + nodejs_20 protoc-gen-doc ruby + protobuf + protoc-gen-go-grpc + go-protobuf + go-protobuf-json + gotools + go-mockery + grpc-tools + # Need bsdtar to run ruby tests libarchive # Custom packages, added to overlay - protobufPin - protoc-gen-go-grpc - go-protobuf - go-protobuf-json - go-tools - go-mockery go-changelog - grpc-tools # Needed for website/ autoconf