From 674de9457b4764b765dfdcf294d3ece686cab1f6 Mon Sep 17 00:00:00 2001 From: Anton-4 <17049058+Anton-4@users.noreply.github.com> Date: Mon, 1 Nov 2021 10:26:11 +0100 Subject: [PATCH 1/3] better nix editor instructions --- BUILDING_FROM_SOURCE.md | 46 ++++++++++++++++++++++++++++++++++++--- editor/src/editor/main.rs | 4 +++- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/BUILDING_FROM_SOURCE.md b/BUILDING_FROM_SOURCE.md index df825d2935..4344a91d57 100644 --- a/BUILDING_FROM_SOURCE.md +++ b/BUILDING_FROM_SOURCE.md @@ -82,7 +82,7 @@ There are also alternative installation options at http://releases.llvm.org/down ## Using Nix -:exclamation: **Our Nix setup is currently broken, you'll have to install manually for now** :exclamation: +:exclamation: **Our Nix setup is not yet working on MacOS, you'll have to install manually for now** :exclamation: ### Install @@ -124,10 +124,49 @@ If you plan on using `nix-shell` regularly, check out [direnv](https://direnv.ne ### Editor +`cargo run edit` should work from NixOS, if you use a nix-shell from inside another OS follow the instructions below. + +#### Nvidia GPU + +Outside of nix shell, execute the following: +``` +nix-channel --add https://github.com/guibou/nixGL/archive/main.tar.gz nixgl && nix-channel --update +nix-env -iA nixgl.auto.nixVulkanNvidia +``` +Running the editor does not work with `nix-shell --pure` +``` +nix-shell +``` +460.91.03 may be different for you, type nixVulkanNvidia and press tab to autocomplete for your version +``` +nixVulkanNvidia-460.91.03 cargo run edit +``` + +#### Integrated Intel Graphics + +:exclamation: ** Our Nix setup can currently not run the editor with integrated intel graphics, see #1856 ** :exclamation: + +Outside of a nix shell, run: + +```bash +git clone https://github.com/guibou/nixGL +cd nixGL +nix-env -f ./ -iA nixVulkanIntel +``` + +cd to the roc repo, and run (without --pure): +``` +nix-shell +nixVulkanIntel cargo run edit +``` + +#### Other configs + +Check the [nixGL repo](https://github.com/guibou/nixGL) for other graphics configurations. + When you want to run the editor from Ubuntu inside nix you need to install [nixGL](https://github.com/guibou/nixGL) as well: ```bash -nix-shell git clone https://github.com/guibou/nixGL cd nixGL ``` @@ -142,9 +181,10 @@ nix-env -f ./ -iA nixVulkanIntel ``` Check the [nixGL repo](https://github.com/guibou/nixGL) for other configurations. -Now you should be able to run the editor: +Now you should be able to run the editor (only work in nix-shell without --pure): ```bash cd roc +nix-shell nixVulkanNvidia cargo run edit `# replace Nvidia with the config you chose in the previous step` ``` diff --git a/editor/src/editor/main.rs b/editor/src/editor/main.rs index 8ecded6f02..d1b1431afa 100644 --- a/editor/src/editor/main.rs +++ b/editor/src/editor/main.rs @@ -79,7 +79,9 @@ fn run_event_loop(project_dir_path_opt: Option<&Path>) -> Result<(), Box Date: Mon, 1 Nov 2021 17:11:09 +0100 Subject: [PATCH 2/3] cleanup --- BUILDING_FROM_SOURCE.md | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/BUILDING_FROM_SOURCE.md b/BUILDING_FROM_SOURCE.md index 4344a91d57..7391db0364 100644 --- a/BUILDING_FROM_SOURCE.md +++ b/BUILDING_FROM_SOURCE.md @@ -94,7 +94,7 @@ First, install nix: `curl -L https://nixos.org/nix/install | sh` -If MacOS and using a version >= 10.15: +If you're on MacOS and using a OS version >= 10.15: `sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume` @@ -104,7 +104,7 @@ You may prefer to setup up the volume manually by following nix documentation. ### Usage -Now with nix installed you just need to run one command: +Now with nix installed, you just need to run one command: `nix-shell` @@ -124,20 +124,20 @@ If you plan on using `nix-shell` regularly, check out [direnv](https://direnv.ne ### Editor -`cargo run edit` should work from NixOS, if you use a nix-shell from inside another OS follow the instructions below. +`cargo run edit` should work from NixOS, if you use a nix-shell from inside another OS, follow the instructions below. #### Nvidia GPU -Outside of nix shell, execute the following: +Outside of a nix shell, execute the following: ``` nix-channel --add https://github.com/guibou/nixGL/archive/main.tar.gz nixgl && nix-channel --update nix-env -iA nixgl.auto.nixVulkanNvidia ``` -Running the editor does not work with `nix-shell --pure` +Running the editor does not work with `nix-shell --pure`. ``` nix-shell ``` -460.91.03 may be different for you, type nixVulkanNvidia and press tab to autocomplete for your version +460.91.03 may be different for you, type nixVulkanNvidia and press tab to autocomplete for your version. ``` nixVulkanNvidia-460.91.03 cargo run edit ``` @@ -164,30 +164,6 @@ nixVulkanIntel cargo run edit Check the [nixGL repo](https://github.com/guibou/nixGL) for other graphics configurations. -When you want to run the editor from Ubuntu inside nix you need to install [nixGL](https://github.com/guibou/nixGL) as well: - -```bash -git clone https://github.com/guibou/nixGL -cd nixGL -``` - -If you have an Nvidia graphics card, run: -``` -nix-env -f ./ -iA nixVulkanNvidia -``` -If you have integrated Intel graphics, run: -``` -nix-env -f ./ -iA nixVulkanIntel -``` -Check the [nixGL repo](https://github.com/guibou/nixGL) for other configurations. - -Now you should be able to run the editor (only work in nix-shell without --pure): -```bash -cd roc -nix-shell -nixVulkanNvidia cargo run edit `# replace Nvidia with the config you chose in the previous step` -``` - ## Troubleshooting Create an issue if you run into problems not listed here. From a978719b0e6bcbcb62ad303bec598799dc7054eb Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Mon, 1 Nov 2021 22:27:57 -0400 Subject: [PATCH 3/3] s/can currnently not/currently cannot --- BUILDING_FROM_SOURCE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILDING_FROM_SOURCE.md b/BUILDING_FROM_SOURCE.md index 7391db0364..a897b15112 100644 --- a/BUILDING_FROM_SOURCE.md +++ b/BUILDING_FROM_SOURCE.md @@ -144,7 +144,7 @@ nixVulkanNvidia-460.91.03 cargo run edit #### Integrated Intel Graphics -:exclamation: ** Our Nix setup can currently not run the editor with integrated intel graphics, see #1856 ** :exclamation: +:exclamation: ** Our Nix setup currently cannot run the editor with integrated intel graphics, see #1856 ** :exclamation: Outside of a nix shell, run: