-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathflake.nix
More file actions
85 lines (80 loc) · 2.33 KB
/
flake.nix
File metadata and controls
85 lines (80 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{
description = "Coder Desktop macOS";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
grpc-swift = {
url = "github:i10416/grpc-swift-flake";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-parts.follows = "flake-parts";
};
};
outputs =
{
nixpkgs,
flake-utils,
grpc-swift,
...
}:
flake-utils.lib.eachSystem
(with flake-utils.lib.system; [
aarch64-darwin
x86_64-darwin
])
(
system:
let
pkgs = import nixpkgs {
inherit system;
};
formatter = pkgs.nixfmt-rfc-style;
in
{
inherit formatter;
devShells = rec {
# Need to use a devshell for CI, as we want to reuse the already existing Xcode on the runner
ci = pkgs.mkShellNoCC {
buildInputs = with pkgs; [
actionlint
clang
coreutils
gh
git
gnumake
protobuf_28
grpc-swift.packages.${system}.protoc-gen-grpc-swift
grpc-swift.packages.${system}.protoc-gen-swift
swiftformat
swiftlint
xcbeautify
xcodegen
xcpretty
zizmor
];
shellHook = ''
# Copied from https://github.com/ghostty-org/ghostty/blob/c4088f0c73af1c153c743fc006637cc76c1ee127/nix/devShell.nix#L189-L199
# We want to rely on the system Xcode tools in CI!
unset SDKROOT
unset DEVELOPER_DIR
# We need to remove the nix "xcrun" from the PATH.
export PATH=$(echo "$PATH" | awk -v RS=: -v ORS=: '$0 !~ /xcrun/ || $0 == "/usr/bin" {print}' | sed 's/:$//')
'';
};
default = pkgs.mkShellNoCC {
buildInputs =
with pkgs;
[
apple-sdk_15
formatter
watchexec
]
++ ci.buildInputs;
};
};
}
);
}