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
- Host: GitHub
- URL: https://github.com/i10416/grpc-swift-flake
- Owner: i10416
- Created: 2024-05-13T04:00:05.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-19T12:36:19.000Z (over 1 year ago)
- Last Synced: 2025-01-12T22:43:51.168Z (over 1 year ago)
- Topics: grpc, nix, swift
- Language: Nix
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.