From b3b168e32c2966837a79df3a7c3844cf9cb1cfde Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Wed, 18 Jan 2023 15:11:05 +0000 Subject: [PATCH] Add `(nix:$name)` as a prefix to the bash prompt (#191) * Add `(nix)` as a prefix to the bash prompt Make it clearer when you're in the terminal vs. not. * bash prompt prefix: put the project's name in the terminal * Blame our installer for the nix.conf * fixup: adding the version to the nix.conf * force a space after the prefix --- src/action/common/place_nix_configuration.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/action/common/place_nix_configuration.rs b/src/action/common/place_nix_configuration.rs index b391bf7..aeb2bd4 100644 --- a/src/action/common/place_nix_configuration.rs +++ b/src/action/common/place_nix_configuration.rs @@ -24,6 +24,8 @@ impl PlaceNixConfiguration { ) -> Result, ActionError> { let buf = format!( "\ + # Generated by https://github.com/DeterminateSystems/nix-installer, version {version}.\n\ + \n\ {extra_conf}\n\ \n\ build-users-group = {nix_build_group_name}\n\ @@ -31,8 +33,11 @@ impl PlaceNixConfiguration { experimental-features = nix-command flakes\n\ \n\ auto-optimise-store = true\n\ + \n\ + bash-prompt-prefix = (nix:$name)\\040\n\ ", extra_conf = extra_conf.join("\n"), + version = env!("CARGO_PKG_VERSION"), ); let create_directory = CreateDirectory::plan(NIX_CONF_FOLDER, None, None, 0o0755, force).await?;