updated nix editor instructions

This commit is contained in:
Anton-4 2022-05-10 14:25:13 +02:00
parent 9a18c26abd
commit 1b10106039
No known key found for this signature in database
GPG Key ID: C954D6E0F9C0ABFD
3 changed files with 41 additions and 5 deletions

View File

@ -1 +1 @@
12.0.0 13.0.0

View File

@ -50,14 +50,47 @@ If you plan on using `nix-shell` regularly, check out [direnv](https://direnv.ne
The editor is a :construction:WIP:construction: and not ready yet to replace your favorite editor, although if you want to try it out on nix, read on. The editor is a :construction:WIP:construction: and not ready yet to replace your favorite editor, although if you want to try it out on nix, read on.
`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 #### from nix flake
Running the ediotr may fail using the classic nix-shell, we recommend using the nix flake, see [enabling nix flakes](https://nixos.wiki/wiki/Flakes).
start a nix shell using `nix develop` and follow the instructions below for your graphics configuration.
##### Nvidia GPU
```
nix run --override-input nixpkgs nixpkgs/nixos-21.11 --impure github:guibou/nixGL#nixVulkanNvidia -- cargo run edit
```
If you get an error like:
```
error: unable to execute '/nix/store/qk6...wjla-nixVulkanNvidia-470.103.01/bin/nixVulkanNvidia': No such file or directory
```
The intel command should work:
```
nix run --override-input nixpkgs nixpkgs/nixos-21.11 --impure github:guibou/nixGL#nixVulkanIntel -- cargo run edit
```
##### Integrated Intel Graphics
```
nix run --override-input nixpkgs nixpkgs/nixos-21.11 --impure github:guibou/nixGL#nixVulkanIntel -- cargo run edit
```
##### Other configs
Check the [nixGL repo](https://github.com/guibou/nixGL) for other graphics configurations. Feel free to ask us for help if you get stuck.
#### using a classic nix-shell
##### Nvidia GPU
Outside of a 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-channel --add https://github.com/guibou/nixGL/archive/main.tar.gz nixgl && nix-channel --update
nix-env -iA nixgl.auto.nixVulkanNvidia 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`, instead run:
``` ```
nix-shell nix-shell
``` ```

View File

@ -12,7 +12,9 @@
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
overlays = [ (import rust-overlay) ]; overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit system overlays; }; pkgs = import nixpkgs {
inherit system overlays;
};
llvmPkgs = pkgs.llvmPackages_13; llvmPkgs = pkgs.llvmPackages_13;
# get current working directory # get current working directory
@ -33,7 +35,7 @@
alsa-lib alsa-lib
]; ];
# zig 0.8.1 from pkgs is broken on aarch64-darwin, hence the workaround # zig 0.9.1 from pkgs is broken on aarch64-darwin, hence the workaround
zig-toolchain = zig.packages.${system}."0.9.1"; zig-toolchain = zig.packages.${system}."0.9.1";
sharedInputs = (with pkgs; [ sharedInputs = (with pkgs; [
@ -70,6 +72,7 @@
LD_LIBRARY_PATH = with pkgs; LD_LIBRARY_PATH = with pkgs;
lib.makeLibraryPath lib.makeLibraryPath
([ pkg-config stdenv.cc.cc.lib libffi ncurses zlib ] ++ linuxInputs); ([ pkg-config stdenv.cc.cc.lib libffi ncurses zlib ] ++ linuxInputs);
NIXPKGS_ALLOW_UNFREE = 1; # to run the editor with NVIDIA's closed source drivers
}; };
} }