Skip to content

Commit

Permalink
Add Swift environment
Browse files Browse the repository at this point in the history
  • Loading branch information
lucperkins committed Jul 20, 2024
1 parent a0d7bb9 commit d3aea80
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Once your preferred template has been initialized, you can use the provided shel
| [Rust] | [`rust`](./rust/) |
| [Scala] | [`scala`](./scala/) |
| [Shell] | [`shell`](./shell/) |
| [Swift] | [`swift`](./swift) |
| [Vlang] | [`vlang`](./vlang/) |
| [Zig] | [`zig`](./zig/) |

Expand Down Expand Up @@ -281,7 +282,12 @@ A dev template that's fully customizable.

- [shellcheck] 0.9.0

### [`Vlang`](./vlang/)
### [`swift`](./swift/)

- [Swift] 5.8
- [sourcekit-lsp]

### [`vlang`](./vlang/)

- [Vlang] 0.4.4

Expand Down Expand Up @@ -401,7 +407,9 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T
[shellcheck]: https://www.shellcheck.net/
[statix]: https://github.com/nerdypepper/statix
[sbt]: https://www.scala-sbt.org
[sourcekit-lsp]: https://github.com/swiftlang/sourcekit-lsp
[spago]: https://github.com/purescript/spago
[swift]: https://www.swift.org
[tectonic]: https://tectonic-typesetting.github.io/
[terraform]: https://terraform.io
[terragrunt]: https://terragrunt.gruntwork.io
Expand Down
5 changes: 5 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,11 @@
description = "Shell script development environment";
};

swift = {
path = ./swift;
description = "Swift development environment";
};

vlang = {
path = ./vlang;
description = "Vlang developent environment";
Expand Down
1 change: 1 addition & 0 deletions swift/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
25 changes: 25 additions & 0 deletions swift/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions swift/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
description = "A Nix-flake-based Swift development environment";

inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";

outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit system; };
});
in
{
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [
swift
sourcekit-lsp
];
};
});
};
}

0 comments on commit d3aea80

Please sign in to comment.