-
Notifications
You must be signed in to change notification settings - Fork 677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nix/NixOS Requirements and Documentation #2413
base: v2
Are you sure you want to change the base?
Changes from all commits
112628a
5d111d2
36bebcc
8fd9b83
6733a9c
1a273dd
0e90ce6
cca2543
49b1f8c
2439d01
0591150
fe198a0
74e882a
47742a5
d2c83dc
7c7411d
b80355c
c52f7bd
a21b062
921b840
1afb630
b5f43e8
264e53c
4f440cf
a201d12
9be5614
722f67c
40ae9b9
818a19a
cd1eacc
493ae4a
6d5756d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,43 +115,7 @@ sudo apk add \ | |
``` | ||
</TabItem> | ||
<TabItem label="NixOS"> | ||
|
||
:::note | ||
This will also install Rust and Node.js as well as the `cargo-tauri` CLI for you, so you can skip those steps below. | ||
::: | ||
|
||
Using `nix-shell`: | ||
|
||
```nix | ||
let | ||
pkgs = import <nixpkgs> { }; | ||
in | ||
pkgs.mkShell { | ||
nativeBuildInputs = with pkgs; [ | ||
pkg-config | ||
gobject-introspection | ||
cargo | ||
cargo-tauri | ||
nodejs | ||
]; | ||
|
||
buildInputs = with pkgs;[ | ||
at-spi2-atk | ||
atkmm | ||
cairo | ||
gdk-pixbuf | ||
glib | ||
gtk3 | ||
harfbuzz | ||
librsvg | ||
libsoup_3 | ||
pango | ||
webkitgtk_4_1 | ||
openssl | ||
]; | ||
} | ||
``` | ||
|
||
This section has been moved Nix/NixOS to a dedicated section [here](#nixnixos) | ||
</TabItem> | ||
</Tabs> | ||
|
||
|
@@ -179,7 +143,6 @@ xcode-select --install | |
``` | ||
|
||
</details> | ||
|
||
Next: [Install Rust](#rust) | ||
|
||
### Windows | ||
|
@@ -209,6 +172,50 @@ Install WebView2 by visiting the [WebView2 Runtime download section](https://dev | |
|
||
Next: [Install Rust](#rust) | ||
|
||
### Nix/NixOS | ||
|
||
Using a [`shell.nix`](https://nix.dev/tutorials/first-steps/declarative-shell): | ||
|
||
```nix | ||
let | ||
pkgs = import <nixpkgs> { | ||
config = { }; | ||
overlays = [ ]; | ||
}; | ||
in | ||
|
||
pkgs.mkShell { | ||
nativeBuildInputs = | ||
with pkgs; | ||
[ | ||
rustc | ||
cargo | ||
# Uncomment if `@tauri-apps/cli` doesn't work on your system | ||
# cargo-tauri | ||
pkg-config | ||
] | ||
++ lib.optionalAttrs stdenv.hostPlatform.isLinux [ wrapGAppsHook4 ]; | ||
|
||
buildInputs = | ||
with pkgs; | ||
[ openssl ] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @getchoo for some reason There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What plugins specifically? It'd be nice to note it I also imagine that would be a macOS exclusive dependency; libiconv is hardly ever used on Linux There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would have to test to see which plugins require it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will investigate and create a minimal environment. |
||
++ lib.optionals stdenv.hostPlatform.isLinux [ | ||
glib-networking | ||
webkitgtk_4_1 | ||
] | ||
++ lib.optionals stdenv.hostPlatform.isDarwin [ | ||
darwin.apple_sdk.frameworks.WebKit | ||
]; | ||
} | ||
``` | ||
|
||
:::caution[Experimental] | ||
Flakes are [experimental](https://nix.dev/manual/nix/stable/contributing/experimental-features.html) in Nix and may change at any time. | ||
::: | ||
|
||
If you prefer to use Flakes, Please follow the following [wiki page how you can use the above `shell.nix` `pkgs.mkShell` inside of a flake](https://wiki.nixos.org/wiki/Flakes#Output_schema) | ||
For more info about Tauri on Nix/NixOS, Checkout the [NixOS Wiki Page.](https://wiki.nixos.org/wiki/Tauri) | ||
|
||
## Rust | ||
|
||
Tauri is built with [Rust](https://www.rust-lang.org) and requires it for development. Install Rust using one of following methods. You can view more installation methods at https://www.rust-lang.org/tools/install. | ||
|
@@ -291,6 +298,7 @@ If you'd like to target your app for Android or iOS then there are a few additio | |
### Android | ||
|
||
1. Download and install [Android Studio from the Android Developers website](https://developer.android.com/studio) | ||
|
||
2. Set the `JAVA_HOME` environment variable: | ||
|
||
{/* TODO: Can this be done in the 4th step? */} | ||
|
@@ -364,7 +372,6 @@ However you can refresh the current session: | |
::: | ||
|
||
</TabItem> | ||
|
||
</Tabs> | ||
|
||
5. Add the Android targets with `rustup`: | ||
|
@@ -381,6 +388,8 @@ Next: [Setup for iOS](#ios) or [Create a project](/start/create-project/). | |
iOS development requires Xcode and is only available on macOS. Be sure that you've installed Xcode and not Xcode Command Line Tools in the [macOS system dependencies section](#macos). | ||
::: | ||
|
||
<Tabs> | ||
<TabItem label="macOS"> | ||
1. Add the iOS targets with `rustup` in Terminal: | ||
|
||
```sh | ||
|
@@ -405,6 +414,17 @@ Next: [Create a project](/start/create-project/). | |
|
||
If you run into any issues during installation be sure to check the [Troubleshooting Guide](/develop/debug/) or reach out on the [Tauri Discord](https://discord.com/invite/tauri). | ||
|
||
</TabItem> | ||
<TabItem label="Nix"> | ||
Add the following to your development shell's `buildInputs` | ||
```nix | ||
darwin.xcode | ||
darwin.apple_sdk.frameworks.UiKit | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
<Card title="Next Steps" icon="rocket"> | ||
|
||
Now that you've installed all of the prerequisistes you're ready to [create your first Tauri project](/start/create-project/)! | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer if you wrap it into a :::info aside, as of now it kinda mixed with the text content right after it. Ofc if you have a better idea than aside it could work.
![image](https://private-user-images.githubusercontent.com/61759797/409303441-8feb3f51-d23d-46e5-8f36-0437f13436cd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxODk4MjAsIm5iZiI6MTczOTE4OTUyMCwicGF0aCI6Ii82MTc1OTc5Ny80MDkzMDM0NDEtOGZlYjNmNTEtZDIzZC00NmU1LThmMzYtMDQzN2YxMzQzNmNkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDEyMTIwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ5MjBlZGFiMmM4YzllZWQzMTQxNjkwNTdlYWExNTg2ZThkNWQxOTE5NzQ4Mzk4OTRjM2FmYjc0MTJjM2NkZTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.wOC8DOaeRD961eRuiNhif05cYwHInSx1YMJF6YtQKgo)