You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constPRE_PKG_SUGGEST:&str = "For a more robust Nix installation, use the Determinate package for macOS: https://dtr.mn/determinate-nix";
10
+
11
+
constDETERMINATE_MSG_EXPLAINER:&str = "\
12
+
Determinate Nix is Determinate Systems' validated and secure downstream Nix distribution for enterprises. \
13
+
It comes bundled with Determinate Nixd, a helpful daemon that automates some otherwise-unpleasant aspects of using Nix, such as garbage collection, and enables you to easily authenticate with FlakeHub.
If you are using `nix-installer` in an automated curing process and seeing this message, consider pinning the version you use via https://github.com/DeterminateSystems/nix-installer#accessing-other-versions.\
33
34
";
34
35
35
-
constPRE_PKG_SUGGEST:&str = "For a more robust Nix installation, use the Determinate package for macOS: https://dtr.mn/determinate-nix";
36
-
37
-
constDETERMINATE_MSG_EXPLAINER:&str = "\
38
-
Determinate Nix is Determinate Systems' validated and secure downstream Nix distribution for enterprises. \
39
-
It comes bundled with Determinate Nixd, a helpful daemon that automates some otherwise-unpleasant aspects of using Nix, such as garbage collection, and enables you to easily authenticate with FlakeHub.
40
-
41
-
For more details: https://dtr.mn/determinate-nix\
42
-
";
43
-
44
36
/**
45
37
Install Nix using a planner
46
38
@@ -82,14 +74,6 @@ pub struct Install {
82
74
pubplanner:Option<BuiltinPlanner>,
83
75
}
84
76
85
-
#[derive(Eq,PartialEq)]
86
-
enumInstallCase{
87
-
DeterminateInteractive,
88
-
DeterminateScripted,
89
-
UpstreamInteractive,
90
-
UpstreamScripted,
91
-
}
92
-
93
77
#[async_trait::async_trait]
94
78
implCommandExecuteforInstall{
95
79
#[tracing::instrument(level = "trace", skip_all)]
@@ -131,19 +115,9 @@ impl CommandExecute for Install {
131
115
returnErr(eyre!("`--plan` conflicts with passing a planner, a planner creates plans, so passing an existing plan doesn't make sense"));
Found existing plan in `{RECEIPT_LOCATION}` which was created by a version incompatible `nix-installer`.\n\
143
+
{EXISTING_INCOMPATIBLE_PLAN_GUIDANCE}\n\
144
+
").red()
172
145
);
173
-
returnOk(ExitCode::FAILURE);
174
-
}
146
+
returnOk(ExitCode::FAILURE);
147
+
}
175
148
176
-
if existing_receipt.planner.typetag_name() != planner.typetag_name(){
177
-
eprintln!("{}", format!("Found existing plan in `{RECEIPT_LOCATION}` which used a different planner, try uninstalling the existing install with `{uninstall_command}`").red());
178
-
returnOk(ExitCode::FAILURE);
179
-
}
149
+
if existing_receipt.planner.typetag_name() != planner.typetag_name(){
150
+
eprintln!("{}", format!("Found existing plan in `{RECEIPT_LOCATION}` which used a different planner, try uninstalling the existing install with `{uninstall_command}`").red());
151
+
returnOk(ExitCode::FAILURE);
152
+
}
180
153
181
-
if existing_receipt.planner.settings().map_err(|e| eyre!(e))?
182
-
!= planner.settings().map_err(|e| eyre!(e))?
183
-
{
184
-
eprintln!("{}", format!("Found existing plan in `{RECEIPT_LOCATION}` which used different planner settings, try uninstalling the existing install with `{uninstall_command}`").red());
185
-
returnOk(ExitCode::FAILURE);
186
-
}
154
+
if existing_receipt.planner.settings().map_err(|e| eyre!(e))?
155
+
!= planner.settings().map_err(|e| eyre!(e))?
156
+
{
157
+
eprintln!("{}", format!("Found existing plan in `{RECEIPT_LOCATION}` which used different planner settings, try uninstalling the existing install with `{uninstall_command}`").red());
158
+
returnOk(ExitCode::FAILURE);
159
+
}
187
160
188
-
eprintln!("{}", format!("Found existing plan in `{RECEIPT_LOCATION}`, with the same settings, already completed. Try uninstalling (`{uninstall_command}`) and reinstalling if Nix isn't working").red());
189
-
returnOk(ExitCode::SUCCESS);
190
-
},
191
-
None => {
192
-
let planner_settings = planner.common_settings_mut();
eprintln!("{}", format!("Found existing plan in `{RECEIPT_LOCATION}`, with the same settings, already completed. Try uninstalling (`{uninstall_command}`) and reinstalling if Nix isn't working").red());
0 commit comments