-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
66 lines (60 loc) · 2.24 KB
/
flake.nix
File metadata and controls
66 lines (60 loc) · 2.24 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
{
description = "ClipKitty Rust development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
tapkey.url = "github:jul-sh/tapkey";
};
outputs = { self, nixpkgs, rust-overlay, flake-utils, tapkey, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
# Rust toolchain with both ARM and x86_64 targets for universal binaries
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
extensions = [ "rust-src" "rust-std" ];
targets = [ "aarch64-apple-darwin" "x86_64-apple-darwin" ];
};
# App Store Connect CLI (pre-built binary)
asc = let
version = "0.43.0";
src = {
aarch64-darwin = pkgs.fetchurl {
url = "https://github.com/rudrankriyam/App-Store-Connect-CLI/releases/download/${version}/asc_${version}_macOS_arm64";
sha256 = "sha256-5xu0oGdk2WT44G75iSiqIOgWt4enBOHijls1mT5Jo4k=";
};
x86_64-darwin = pkgs.fetchurl {
url = "https://github.com/rudrankriyam/App-Store-Connect-CLI/releases/download/${version}/asc_${version}_macOS_amd64";
sha256 = "sha256-KBTjyJ51TYsAW/9MtUT33yVxHupKk4g+Mqk3ZlBUchI=";
};
}.${system} or (throw "asc: unsupported system ${system}");
in pkgs.runCommand "asc-${version}" {} ''
mkdir -p $out/bin
cp ${src} $out/bin/asc
chmod +x $out/bin/asc
'';
in
{
devShells.default = pkgs.mkShell {
buildInputs = [
rustToolchain
pkgs.swiftlint
pkgs.swiftformat
asc
] ++ pkgs.lib.optionals (tapkey.packages ? ${system}) [
tapkey.packages.${system}.default
];
shellHook = ''
export IN_NIX_SHELL=1
# Install git hooks if not already installed
if [ -d .git ] && [ ! -f .git/hooks/pre-commit ]; then
./Scripts/install-hooks.sh
fi
'';
};
}
);
}