Something went wrong. Try again.
NixOS, nix-darwin and home manager configurations for various my various devices.
nix-darwin nixvim nix nixos
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829import subprocess
# Get the default Rust toolchaintoolchain_command = "rustup toolchain list | grep '(default)' | cut -d' ' -f 1"TOOLCHAIN = subprocess.check_output( toolchain_command, shell=True, text=True).strip()
# Get the commit hash of the installed Rust compilercommit_hash_command = "rustc -Vv | grep commit-hash | cut -d' ' -f 2"COMMIT_HASH = subprocess.check_output( commit_hash_command, shell=True, text=True).strip()
# Get the Rustup home directoryrustup_home_command = "rustup show home"RUSTUP_HOME = subprocess.check_output( rustup_home_command, shell=True, text=True).strip()
# Create the settings stringsettings = f"\nsettings set target.source-map /rustc/{COMMIT_HASH}/ {RUSTUP_HOME}/toolchains/{TOOLCHAIN}/lib/rustlib/src/rust/"commands = f"{RUSTUP_HOME}/toolchains/{TOOLCHAIN}/lib/rustlib/etc/lldb_commands"
# Print or use the 'settings' variable as neededprint(settings)
print(commands)# Append settings to commands file# with open(commands, "a") as f:# f.write(settings)