{ description = "User management system."; inputs = { flake-utils.url = "github:numtide/flake-utils"; }; outputs = inputs @ { self, nixpkgs, ... }: inputs.flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; myProtoc = "${pkgs.grpc-tools}/bin/protoc"; myUsersDir = "$MY_USERS_DIR"; myUsersBuild = pkgs.writeShellScriptBin "users-build" '' pushd ${myUsersDir} > /dev/null && ${myProtoc} --proto_path=${myUsersDir} \ --go_out=. --go_opt=paths=source_relative \ --go-grpc_out=. --go-grpc_opt=paths=source_relative \ proto/users.proto && popd > /dev/null ''; in rec { devShells.default = pkgs.mkShell { buildInputs = with pkgs; [ go gopls protoc-gen-go protoc-gen-go-grpc grpc grpcui grpcurl grpc-tools myUsersBuild ]; shellHook = '' export MY_USERS_DIR="$(pwd)" ''; }; } ); }