Include pure Swift version of swiftformat
This should probably be upstreamed... eventually.
This commit is contained in:
parent
de38673001
commit
471c61218e
3 changed files with 41 additions and 0 deletions
|
@ -33,6 +33,7 @@
|
||||||
pwgen
|
pwgen
|
||||||
radare2
|
radare2
|
||||||
rustup
|
rustup
|
||||||
|
swiftformat
|
||||||
tmux
|
tmux
|
||||||
unar
|
unar
|
||||||
virt-manager
|
virt-manager
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
self: super:
|
self: super:
|
||||||
{
|
{
|
||||||
monaco-powerline = super.callPackage ./monaco-powerline/default.nix {};
|
monaco-powerline = super.callPackage ./monaco-powerline/default.nix {};
|
||||||
|
swiftformat = super.callPackage ./swiftformat.nix {};
|
||||||
}
|
}
|
||||||
|
|
39
pkgs/swiftformat.nix
Normal file
39
pkgs/swiftformat.nix
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
{ stdenv, lib, fetchFromGitHub, swift, swiftpm, swiftPackages }:
|
||||||
|
|
||||||
|
# This derivation is impure: it relies on an Xcode toolchain being installed
|
||||||
|
# and available in the expected place. The values of sandboxProfile and
|
||||||
|
# hydraPlatforms are copied pretty directly from the MacVim derivation, which
|
||||||
|
# is also impure.
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "swiftformat";
|
||||||
|
version = "0.51.13";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "nicklockwood";
|
||||||
|
repo = "SwiftFormat";
|
||||||
|
rev = version;
|
||||||
|
sha256 = "sha256-8AvPA8KzejU4BI/BAX+gCjwPi4Xv0jEQbLHj9OCtasw";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [ swift swiftpm ];
|
||||||
|
buildInputs = [ swiftPackages.Foundation ];
|
||||||
|
|
||||||
|
# We only install the swiftformat binary, so don't need the other products.
|
||||||
|
swiftpmFlags = [ "--product swiftformat" ];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
binPath="$(swiftpmBinPath)"
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp $binPath/swiftformat $out/bin/
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "A code formatting and linting tool for Swift";
|
||||||
|
homepage = "https://github.com/nicklockwood/SwiftFormat";
|
||||||
|
license = licenses.mit;
|
||||||
|
maintainers = [ maintainers.bdesham ];
|
||||||
|
platforms = with lib.platforms; linux ++ darwin;
|
||||||
|
hydraPlatforms = [];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue