chore: add Nix flake dev shell (xcbeautify, swiftlint, swiftformat on macOS)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Mikael Hugo 2026-05-10 23:16:12 +02:00
parent b61057c3b7
commit 5bf7c061b2
2 changed files with 118 additions and 0 deletions

61
flake.lock generated Normal file
View file

@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1778003029,
"narHash": "sha256-q/nkKLDtHIyLjZpKhWk3cSK5IYsFqtMd6UtXF3ddjgA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0c88e1f2bdb93d5999019e99cb0e61e1fe2af4c5",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.11",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

57
flake.nix Normal file
View file

@ -0,0 +1,57 @@
{
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."
''}
'';
};
});
}