diff --git a/README.md b/README.md index 6665581..6ed05b8 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ Here are some tips to enhance your Rust experience on this system: - Alternatively, you can install `rustup` through `configuration.nix` and nixpkgs for a system-wide Rust setup. This allows you to manage Rust versions globally through `rustup`. 2. **Troubleshooting Compilation Issues:** - If you encounter problems during Rust compilation, especially those related to OpenSSL or SQLite (refer [here](https://nixos.wiki/wiki/Rust#Building_Rust_crates_that_require_external_system_libraries)), leverage the `rustenv` fish function. This function is an alias for the `nix-shell -p pkg-config openssl sqlite --run fish` command, opening a Nix shell with the necessary dependencies for seamless code compilation. Additionally, if you use Nix shell, compilation will occur in the runtime directory, which might be insufficient for some projects. You can adjust the runtime directory size in `configuration.nix` under `services.logind.extraConfig="RuntimeDirectorySize=4G"`. + If you encounter problems during Rust compilation, especially those related to OpenSSL or SQLite (refer [here](https://nixos.wiki/wiki/Rust#Building_Rust_crates_that_require_external_system_libraries)), leverage the `rustenv` fish function. This function is an alias for the `nix-shell -p pkg-config openssl sqlite protobuf --run fish` command, opening a Nix shell with the necessary dependencies for seamless code compilation. Additionally, if you use Nix shell, compilation will occur in the runtime directory, which might be insufficient for some projects. You can adjust the runtime directory size in `configuration.nix` under `services.logind.extraConfig="RuntimeDirectorySize=8G"`. 3. **Cross-Compilation:** For cross-compilation, consider using tools like `zigbuild` or `cross`. Personally, I find `zigbuild` preferable, but both are valuable options for your cross-compilation needs. diff --git a/home/.config/fish/config.fish b/home/.config/fish/config.fish index c13cf59..74c7b40 100644 --- a/home/.config/fish/config.fish +++ b/home/.config/fish/config.fish @@ -8,7 +8,7 @@ alias ldocker="lazydocker" alias conf="z ~/.config" alias nixos="z /etc/nixos" alias store="z /nix/store" -alias rustenv="nix-shell -p pkg-config openssl sqlite --run fish" # run this command first if you have trouble with openssl or sqlite during compiling a rust project (more https://nixos.wiki/wiki/Rust#Building_Rust_crates_that_require_external_system_libraries) +alias rustenv="nix-shell -p pkg-config openssl sqlite protobuf --run fish" # run this command first if you have trouble with openssl, sqlite or protobuf during compiling a rust project (more https://nixos.wiki/wiki/Rust#Building_Rust_crates_that_require_external_system_libraries) alias nswitch="sudo nixos-rebuild switch --flake /etc/nixos" alias nswitchu="sudo nixos-rebuild switch --flake /etc/nixos --upgrade --update-input nixpkgs --update-input rust-overlay --commit-lock-file" alias ncsu="sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos" @@ -23,6 +23,8 @@ set -gx EDITOR hx set -gx VOLUME_STEP 5 set -gx BRIGHTNESS_STEP 5 +set -gx PATH $HOME/.cargo/bin $PATH + set fish_vi_force_cursor set fish_cursor_default block set fish_cursor_insert line blink diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 54135b0..99f0809 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -145,7 +145,7 @@ }; # Change runtime directory size - services.logind.extraConfig = "RuntimeDirectorySize=4G"; + services.logind.extraConfig = "RuntimeDirectorySize=8G"; # Scheduled auto upgrade system (this is only for system upgrades, # if you want to upgrade cargo\npm\pip global packages, docker containers or different part of the system diff --git a/nixos/rust-toolchain.toml b/nixos/rust-toolchain.toml index 56722d3..2349ea2 100644 --- a/nixos/rust-toolchain.toml +++ b/nixos/rust-toolchain.toml @@ -2,6 +2,7 @@ channel = "stable" components = [ "rust-src", "rust-analyzer" ] targets = [ + "wasm32-unknown-unknown", "wasm32-wasi", "x86_64-pc-windows-gnu", "x86_64-unknown-linux-gnu",