1 { stdenv, lib, fetchFromGitHub, runCommand }:
3 # This derivation is impure: it relies on an Xcode toolchain being installed
4 # and available in the expected place. The values of sandboxProfile and
5 # hydraPlatforms are copied pretty directly from the MacVim derivation, which
8 stdenv.mkDerivation rec {
12 src = fetchFromGitHub {
13 owner = "nicklockwood";
16 sha256 = "1gqxpymbhpmap0i2blg9akarlql4mkzv45l4i212gsxcs991b939";
19 preConfigure = "LD=$CC";
22 /usr/bin/xcodebuild -project SwiftFormat.xcodeproj \
23 -scheme "SwiftFormat (Command Line Tool)" \
24 CODE_SIGN_IDENTITY= SYMROOT=build OBJROOT=build
28 install -D -m 0555 build/Release/swiftformat $out/bin/swiftformat
32 (allow file-read* file-write* process-exec mach-lookup)
33 ; block homebrew dependencies
34 (deny file-read* file-write* process-exec mach-lookup (subpath "/usr/local") (with no-log))
38 description = "A code formatting and linting tool for Swift";
39 homepage = "https://github.com/nicklockwood/SwiftFormat";
40 license = licenses.mit;
41 maintainers = [ maintainers.bdesham ];
42 platforms = platforms.darwin;