From 3063635b9870f68da3ff8a22b3719534cf093c73 Mon Sep 17 00:00:00 2001
From: Graham Christensen <graham@grahamc.com>
Date: Mon, 27 Nov 2023 18:38:40 -0500
Subject: [PATCH] Fixup the profile paths in the post-install instructions

---
 src/cli/subcommand/install.rs | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/cli/subcommand/install.rs b/src/cli/subcommand/install.rs
index f333363e9..a874be741 100644
--- a/src/cli/subcommand/install.rs
+++ b/src/cli/subcommand/install.rs
@@ -4,7 +4,10 @@ use std::{
 };
 
 use crate::{
-    action::ActionState,
+    action::{
+        common::configure_shell_profile::PROFILE_NIX_FILE_FISH,
+        common::configure_shell_profile::PROFILE_NIX_FILE_SHELL, ActionState,
+    },
     cli::{
         ensure_root,
         interaction::{self, PromptChoice},
@@ -312,6 +315,8 @@ impl CommandExecute for Install {
                 }
             },
             Ok(_) => {
+                let load_fish = format!(". {}", PROFILE_NIX_FILE_FISH);
+                let load_shell = format!(". {}", PROFILE_NIX_FILE_SHELL);
                 println!(
                     "\
                     {success}\n\
@@ -319,10 +324,12 @@ impl CommandExecute for Install {
                     ",
                     success = "Nix was installed successfully!".green().bold(),
                     shell_reminder = match std::env::var("SHELL") {
-                        Ok(val) if val.contains("fish") =>
-                            ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.fish".bold(),
-                        Ok(_) | Err(_) =>
-                            ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh".bold(),
+                        Ok(val) if val.contains("fish") => {
+                            load_fish.bold()
+                        },
+                        Ok(_) | Err(_) => {
+                            load_shell.bold()
+                        },
                     },
                 );
             },