diff --git a/.envrc b/.envrc new file mode 100644 index 000000000..10eba288e --- /dev/null +++ b/.envrc @@ -0,0 +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 +fi diff --git a/.gitignore b/.gitignore index 968c4d843..7079af96f 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ pkg/* test/tmp/ /exec .ruby-bundle +vendor/bundle # Documentation _site/* diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..197a6184c --- /dev/null +++ b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1634851050, + "narHash": "sha256-N83GlSGPJJdcqhUxSCS/WwW5pksYf3VP1M13cDRTSVA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c91f3de5adaf1de973b797ef7485e441a65b8935", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1636678824, + "narHash": "sha256-NDB9CenPn5z2xbmG/X+Mg6Jd8iUEf7dfprQfXxSD6X8=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "bf346b557b76ffce74167f37752656dede5957f3", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/nix/overlay.nix b/nix/overlay.nix index 7604cf003..4696b5d44 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -1,7 +1,9 @@ -final: prev: { +final: prev: rec { # This is the pinned protoc version we have for this project. protobufPin = prev.protobuf3_15; + ruby = final.ruby_2_7; + devShell = final.callPackage ./vagrant.nix { }; go-protobuf = prev.callPackage ./go-protobuf.nix { }; diff --git a/nix/vagrant.nix b/nix/vagrant.nix index b72859a93..d2a4c706f 100644 --- a/nix/vagrant.nix +++ b/nix/vagrant.nix @@ -3,8 +3,6 @@ , autoconf , autogen , automake -, docker-compose -, doctl , go , go-bindata , go-changelog @@ -13,17 +11,15 @@ , go-protobuf-json , go-tools , grpcurl -, kubectl , libpng , libtool -, minikube , mkShell , nasm , nodejs-16_x , pkg-config -, postgresql_12 , protobufPin , protoc-gen-doc +, ruby , zlib }: @@ -31,13 +27,12 @@ mkShell rec { name = "vagrant"; packages = [ - docker-compose go go-bindata grpcurl nodejs-16_x - postgresql_12 protoc-gen-doc + ruby # Custom packages, added to overlay protobufPin @@ -47,10 +42,6 @@ mkShell rec { go-mockery go-changelog - # For testing - doctl - kubectl - # Needed for website/ autoconf autogen @@ -60,9 +51,6 @@ mkShell rec { nasm pkg-config zlib - ] ++ lib.optionals stdenv.isLinux [ - # On Linux we use minikube as the primary k8s testing platform - minikube ]; # workaround for npm/gulp dep compilation @@ -70,12 +58,4 @@ mkShell rec { shellHook = '' LD=$CC ''; - - # Extra env vars - PGHOST = "localhost"; - PGPORT = "5432"; - PGDATABASE = "noop"; - PGUSER = "postgres"; - PGPASSWORD = "postgres"; - DATABASE_URL = "postgresql://${PGUSER}:${PGPASSWORD}@${PGHOST}:${PGPORT}/${PGDATABASE}?sslmode=disable"; } diff --git a/vagrant.gemspec b/vagrant.gemspec index 76f6671fe..afbd285af 100644 --- a/vagrant.gemspec +++ b/vagrant.gemspec @@ -38,6 +38,9 @@ Gem::Specification.new do |s| s.add_dependency "winrm-elevated", ">= 1.2.1", "< 2.0" s.add_dependency "winrm-fs", ">= 1.3.4", "< 2.0" + # Needed for go generate to use grpc_tools_ruby_protoc + s.add_development_dependency "grpc-tools", "~> 1.41.1" + # Constraint rake to properly handle deprecated method usage # from within rspec s.add_development_dependency "rake", "~> 13.0"