58 lines
1.8 KiB
Nix
58 lines
1.8 KiB
Nix
|
|
{
|
||
|
|
description = "CentralCloud OnCall Mobile — ntfy iOS app (Swift/Xcode, macOS only)";
|
||
|
|
|
||
|
|
inputs = {
|
||
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
|
||
|
|
flake-utils.url = "github:numtide/flake-utils";
|
||
|
|
};
|
||
|
|
|
||
|
|
nixConfig = {
|
||
|
|
extra-substituters = [
|
||
|
|
"https://cache.centralcloud.com/default"
|
||
|
|
];
|
||
|
|
extra-trusted-public-keys = [
|
||
|
|
"default:ywfU21WX06iOn2Ec2lae1jYh4w8LO4IQkmp06vJzsk8="
|
||
|
|
];
|
||
|
|
};
|
||
|
|
|
||
|
|
outputs = {
|
||
|
|
nixpkgs,
|
||
|
|
flake-utils,
|
||
|
|
...
|
||
|
|
}:
|
||
|
|
flake-utils.lib.eachDefaultSystem (system: let
|
||
|
|
pkgs = import nixpkgs {inherit system;};
|
||
|
|
isDarwin = pkgs.stdenv.isDarwin;
|
||
|
|
in {
|
||
|
|
devShells.default = pkgs.mkShell {
|
||
|
|
packages =
|
||
|
|
[
|
||
|
|
pkgs.git
|
||
|
|
pkgs.jq
|
||
|
|
]
|
||
|
|
++ pkgs.lib.optionals isDarwin [
|
||
|
|
# macOS-only: Xcode toolchain is managed outside Nix via xcode-select
|
||
|
|
pkgs.xcbeautify # prettier xcodebuild output
|
||
|
|
pkgs.swiftlint # Swift linting
|
||
|
|
pkgs.swiftformat # Swift formatting
|
||
|
|
];
|
||
|
|
|
||
|
|
shellHook = ''
|
||
|
|
echo "CentralCloud OnCall Mobile (iOS) dev shell"
|
||
|
|
${pkgs.lib.optionalString isDarwin ''
|
||
|
|
echo " xcbeautify : $(xcbeautify --version 2>/dev/null || echo 'available')"
|
||
|
|
echo " swiftlint : $(swiftlint --version 2>/dev/null || echo 'available')"
|
||
|
|
echo ""
|
||
|
|
echo "Build: xcodebuild -scheme ntfy -destination 'generic/platform=iOS' | xcbeautify"
|
||
|
|
echo "Note : Xcode must be installed via xcode-select (not managed by Nix)"
|
||
|
|
''}
|
||
|
|
${pkgs.lib.optionalString (!isDarwin) ''
|
||
|
|
echo ""
|
||
|
|
echo "NOTE: iOS builds require macOS + Xcode. This shell provides only"
|
||
|
|
echo " scripting utilities on Linux/other platforms."
|
||
|
|
''}
|
||
|
|
'';
|
||
|
|
};
|
||
|
|
});
|
||
|
|
}
|