chore: remove legacy nix profile resources
This commit is contained in:
@@ -125,7 +125,7 @@ pub fn user_prompts_dir() -> Option<PathBuf> {
|
||||
Some(config_dir()?.join("prompts"))
|
||||
}
|
||||
|
||||
/// Root resource directory used for bundled prompts/Nix support files.
|
||||
/// Root resource directory used for bundled prompts, profiles, catalogs, and docs.
|
||||
pub fn resource_dir() -> Option<PathBuf> {
|
||||
if let Some(p) = env_path(RESOURCE_DIR_ENV) {
|
||||
return Some(p);
|
||||
|
||||
@@ -382,7 +382,7 @@ impl ProfileResolver {
|
||||
.map(str::to_string);
|
||||
match extension.as_deref() {
|
||||
Some("lua") => {}
|
||||
Some("nix") => return Err(ProfileError::UnsupportedProfileType { path: absolute_path, message: "Nix profile evaluation is not part of the primary Profile path; use a Lua profile or --manifest for a complete Manifest".into() }),
|
||||
Some("nix") => return Err(ProfileError::UnsupportedProfileType { path: absolute_path, message: "Nix profile files are no longer supported; use a Lua profile or --manifest for a complete Manifest".into() }),
|
||||
other => return Err(ProfileError::UnsupportedProfileType { path: absolute_path, message: format!("unsupported profile extension {}; Lua profiles must end in .lua", other.map_or("<none>".to_string(), |s| format!(".{s}"))) }),
|
||||
}
|
||||
let profile_dir = absolute_path
|
||||
|
||||
@@ -416,7 +416,7 @@ mod tests {
|
||||
);
|
||||
metadata.resolved_manifest_snapshot = Some(serde_json::json!({
|
||||
"pod": { "name": "profile-pod" },
|
||||
"profile": { "source": { "kind": "path", "path": "/profiles/coder.nix" } }
|
||||
"profile": { "source": { "kind": "path", "path": "/profiles/coder.lua" } }
|
||||
}));
|
||||
|
||||
let json = serde_json::to_string(&metadata).unwrap();
|
||||
|
||||
@@ -444,7 +444,7 @@ permission = "write"
|
||||
#[test]
|
||||
fn profile_uses_selected_profile() {
|
||||
let tmp = TempDir::new().unwrap();
|
||||
let profile = tmp.path().join("profile.nix");
|
||||
let profile = tmp.path().join("profile.lua");
|
||||
let cli = Cli::try_parse_from([
|
||||
"insomnia-pod",
|
||||
"--profile",
|
||||
@@ -633,12 +633,12 @@ permission = "write"
|
||||
fn profile_conflicts_with_manifest_and_restore_modes() {
|
||||
let segment_id = session_store::new_segment_id().to_string();
|
||||
for args in [
|
||||
vec!["insomnia-pod", "--profile", "p.nix", "--manifest", "m.toml"],
|
||||
vec!["insomnia-pod", "--profile", "p.nix", "--pod", "agent"],
|
||||
vec!["insomnia-pod", "--profile", "p.lua", "--manifest", "m.toml"],
|
||||
vec!["insomnia-pod", "--profile", "p.lua", "--pod", "agent"],
|
||||
vec![
|
||||
"insomnia-pod",
|
||||
"--profile",
|
||||
"p.nix",
|
||||
"p.lua",
|
||||
"--session",
|
||||
&segment_id,
|
||||
],
|
||||
@@ -659,7 +659,7 @@ permission = "write"
|
||||
let cli = Cli::try_parse_from([
|
||||
"insomnia-pod",
|
||||
"--profile",
|
||||
"p.nix",
|
||||
"p.lua",
|
||||
"--profile-pod-name",
|
||||
"agent",
|
||||
])
|
||||
|
||||
@@ -1181,9 +1181,9 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn parse_profile_spawn_mode() {
|
||||
match parse_args_from(["--profile", "/profiles/coder.nix"]).unwrap() {
|
||||
match parse_args_from(["--profile", "/profiles/coder.lua"]).unwrap() {
|
||||
Mode::Spawn { profile } => {
|
||||
assert_eq!(profile, Some("/profiles/coder.nix".to_string()));
|
||||
assert_eq!(profile, Some("/profiles/coder.lua".to_string()));
|
||||
}
|
||||
_ => panic!("expected Spawn mode"),
|
||||
}
|
||||
@@ -1196,7 +1196,7 @@ mod tests {
|
||||
(
|
||||
vec![
|
||||
"--profile".to_string(),
|
||||
"p.nix".to_string(),
|
||||
"p.lua".to_string(),
|
||||
"--resume".to_string(),
|
||||
],
|
||||
"--profile can only be used for fresh spawn",
|
||||
@@ -1204,7 +1204,7 @@ mod tests {
|
||||
(
|
||||
vec![
|
||||
"--profile".to_string(),
|
||||
"p.nix".to_string(),
|
||||
"p.lua".to_string(),
|
||||
"--session".to_string(),
|
||||
segment_id,
|
||||
],
|
||||
@@ -1213,7 +1213,7 @@ mod tests {
|
||||
(
|
||||
vec![
|
||||
"--profile".to_string(),
|
||||
"p.nix".to_string(),
|
||||
"p.lua".to_string(),
|
||||
"--socket".to_string(),
|
||||
"/tmp/insomnia/sock".to_string(),
|
||||
],
|
||||
@@ -1222,7 +1222,7 @@ mod tests {
|
||||
(
|
||||
vec![
|
||||
"--profile".to_string(),
|
||||
"p.nix".to_string(),
|
||||
"p.lua".to_string(),
|
||||
"agent".to_string(),
|
||||
],
|
||||
"--profile can only be used for fresh spawn",
|
||||
|
||||
@@ -655,7 +655,7 @@ mod tests {
|
||||
r#"
|
||||
default = "coder"
|
||||
[profile]
|
||||
coder = "profiles/coder.nix"
|
||||
coder = "profiles/coder.lua"
|
||||
"#,
|
||||
)
|
||||
.unwrap();
|
||||
@@ -679,7 +679,7 @@ coder = "profiles/coder.nix"
|
||||
r#"
|
||||
default = "coder"
|
||||
[profile.coder]
|
||||
path = "profiles/coder.nix"
|
||||
path = "profiles/coder.lua"
|
||||
description = "Project coder"
|
||||
"#,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user