Skip to content

Instantly share code, notes, and snippets.

@Havvy

Havvy/rustc.nix Secret

Created December 5, 2017 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Havvy/aaffec9a601b955477e26570eff0415e to your computer and use it in GitHub Desktop.
Save Havvy/aaffec9a601b955477e26570eff0415e 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@rustc:\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/project
'';
buildInputs = [
python27
cmake
curl
file
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment