Skip to content

Instantly share code, notes, and snippets.

@Havvy

Havvy/rust.nix Secret

Created February 11, 2017 11:24
Show Gist options
  • Save Havvy/2a6e4fde76292b03cabf2ca70d0ece09 to your computer and use it in GitHub Desktop.
Save Havvy/2a6e4fde76292b03cabf2ca70d0ece09 to your computer and use it in GitHub Desktop.
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "rustc";
shellHook = ''
# Set some variables for the terminal prompt.
green=$(tput setaf 2)
bold=$(tput bold)
reset=$(tput sgr0) # Resets other styles. Broken in some unknown way?
# # Everything between \[ and \] are considerd as 0 characters long for word-wrap.
# \u is the username.
# \w is the path (relative to ~ if possible)
export PS1="\n\[$green$bold\][\u@rust:\w]\$\[$reset\] "
# Unset the variables used for the terminal prompt.
unset green
unset bold
unset clear
# Go directly to the Rust directory.
cd ~/workspace/rust
'';
buildInputs = [
python27
cmake
curl
file
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment