An open API service indexing awesome lists of open source software.

https://github.com/i10416/grpc-swift-flake

grpc-swift wrapped by Nix flake
https://github.com/i10416/grpc-swift-flake

grpc nix swift

Last synced: about 2 months ago
JSON representation

grpc-swift wrapped by Nix flake

Awesome Lists containing this project

README

          

## grpc-swift flake

## Try It Out

```sh
nix develop github:i10416/grpc-swift-flake
```

## About

This is a repository for grpc-swift wrapped by Nix flake.

This flake provides `protoc-gen-swift` and `protoc-gen-grpc-swift` packages for each system.

```nix
{
# ...
inputs.grpc-swift.url = "github:i10416/grpc-swift-flake";
inputs.flake-utils.url = "github:numtide/flake-utils";
# ...
outputs = {self,flake-utils, grpc-swift, ...}:
flake-utils.lib.eachDefaultSystem (system:
{
devShell = pkgs.mkShell {
name = "...";
buildInputs = [
grpc-swift.packages.${system}.protoc-gen-swift
grpc-swift.packages.${system}.protoc-gen-grpc-swift
]
}
}
)
}
```

## Develop

### build

`nix build .` builds `protoc-gen-swift` by default. Run `nix build .#protoc-gen-swift` and `nix build .#protoc-gen-grpc-swift` to build each package.

Derivations under `protoc-gen-swift/` and `protoc-gen-grpc-swift/` can be built by `nix-build` command. They have default grpc-swift source, but they are supposed to be used for debug purpose.

```sh
cd protoc-gen-swift
nix-build .
```

### swiftpm2nix

Files under grpc-swift-src/swiftpm2nix are generated by the following steps.

```sh
git clone git@github.com:grpc/grpc-swift.git -b 1.23.0 grpc-swift-src
cd grpc-swift-src
nix-shell -p swift swiftpm swiftpm2nix
swift package resolve
swiftpm2nix
# Move files under grpc-swift-src/nix to grpc-swift/swiftpm2nix.
```

NOTE:
These steps are taken from https://git.ri.se/lars.rasmusson/nixpkgs/-/blob/master/doc/languages-frameworks/swift.section.md.