-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
64 lines (58 loc) · 2.04 KB
/
Copy pathflake.nix
File metadata and controls
64 lines (58 loc) · 2.04 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
{
description = "Whisky development tools (pinned swiftformat and swiftlint)";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};
outputs =
{ nixpkgs, ... }:
let
systems = [
"aarch64-darwin"
"x86_64-darwin"
];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
# CONTRIBUTING.md requires this exact version; CI lints with it too.
swiftformatVersion = "0.58.7";
# Current SwiftLint release. CI's action bundles its own build, so lint
# results are close but not guaranteed identical; the SwiftFormat pin is
# the load-bearing one.
swiftlintVersion = "0.65.0";
swiftformat =
pkgs:
pkgs.stdenvNoCC.mkDerivation {
pname = "swiftformat-bin";
version = swiftformatVersion;
src = pkgs.fetchurl {
url = "https://github.com/nicklockwood/SwiftFormat/releases/download/${swiftformatVersion}/swiftformat.zip";
hash = "sha256-fkP44U4gie64PWlYzhYv+pDJMw8/MJygVGk2FLKxskE=";
};
nativeBuildInputs = [ pkgs.unzip ];
unpackPhase = "unzip $src";
installPhase = "install -Dm755 swiftformat $out/bin/swiftformat";
};
swiftlint =
pkgs:
pkgs.stdenvNoCC.mkDerivation {
pname = "swiftlint-bin";
version = swiftlintVersion;
src = pkgs.fetchurl {
url = "https://github.com/realm/SwiftLint/releases/download/${swiftlintVersion}/portable_swiftlint.zip";
hash = "sha256-1ssKp6L18e8wb8nje8tU3Jom+syPd4SsDD3T7M9ca6Y=";
};
nativeBuildInputs = [ pkgs.unzip ];
unpackPhase = "unzip $src";
installPhase = "install -Dm755 swiftlint $out/bin/swiftlint";
};
in
{
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = [
(swiftformat pkgs)
(swiftlint pkgs)
];
};
});
formatter = forAllSystems (pkgs: pkgs.nixfmt);
};
}