diff --git a/.github/config-schema.json b/.github/config-schema.json index 7f6b74282..4801b7eab 100644 --- a/.github/config-schema.json +++ b/.github/config-schema.json @@ -65,11 +65,7 @@ "buf": { "default": { "detect_extensions": [], - "detect_files": [ - "buf.yaml", - "buf.gen.yaml", - "buf.work.yaml" - ], + "detect_files": ["buf.yaml", "buf.gen.yaml", "buf.work.yaml"], "detect_folders": [], "disabled": false, "format": "with [$symbol($version )]($style)", @@ -86,11 +82,7 @@ "bun": { "default": { "detect_extensions": [], - "detect_files": [ - "bun.lock", - "bun.lockb", - "bunfig.toml" - ], + "detect_files": ["bun.lock", "bun.lockb", "bunfig.toml"], "detect_folders": [], "disabled": false, "format": "via [$symbol($version )]($style)", @@ -107,23 +99,11 @@ "c": { "default": { "commands": [ - [ - "cc", - "--version" - ], - [ - "gcc", - "--version" - ], - [ - "clang", - "--version" - ] - ], - "detect_extensions": [ - "c", - "h" + ["cc", "--version"], + ["gcc", "--version"], + ["clang", "--version"] ], + "detect_extensions": ["c", "h"], "detect_files": [], "detect_folders": [], "disabled": false, @@ -158,10 +138,7 @@ "cmake": { "default": { "detect_extensions": [], - "detect_files": [ - "CMakeLists.txt", - "CMakeCache.txt" - ], + "detect_files": ["CMakeLists.txt", "CMakeCache.txt"], "detect_folders": [], "disabled": false, "format": "via [$symbol($version )]($style)", @@ -193,12 +170,7 @@ }, "cobol": { "default": { - "detect_extensions": [ - "cbl", - "cob", - "CBL", - "COB" - ], + "detect_extensions": ["cbl", "cob", "CBL", "COB"], "detect_files": [], "detect_folders": [], "disabled": false, @@ -218,6 +190,7 @@ "disabled": false, "format": "via [$symbol$environment]($style) ", "ignore_base": true, + "ignore_pixi_envs": true, "style": "green bold", "symbol": "🅒 ", "truncation_length": 1 @@ -284,12 +257,8 @@ }, "crystal": { "default": { - "detect_extensions": [ - "cr" - ], - "detect_files": [ - "shard.yml" - ], + "detect_extensions": ["cr"], + "detect_files": ["shard.yml"], "detect_folders": [], "disabled": false, "format": "via [$symbol($version )]($style)", @@ -306,9 +275,7 @@ "daml": { "default": { "detect_extensions": [], - "detect_files": [ - "daml.yaml" - ], + "detect_files": ["daml.yaml"], "detect_folders": [], "disabled": false, "format": "via [$symbol($version )]($style)", @@ -324,17 +291,9 @@ }, "dart": { "default": { - "detect_extensions": [ - "dart" - ], - "detect_files": [ - "pubspec.yaml", - "pubspec.yml", - "pubspec.lock" - ], - "detect_folders": [ - ".dart_tool" - ], + "detect_extensions": ["dart"], + "detect_files": ["pubspec.yaml", "pubspec.yml", "pubspec.lock"], + "detect_folders": [".dart_tool"], "disabled": false, "format": "via [$symbol($version )]($style)", "style": "bold blue", @@ -401,13 +360,9 @@ "default": { "allowed_msg": "allowed", "denied_msg": "denied", - "detect_env_vars": [ - "DIRENV_FILE" - ], + "detect_env_vars": ["DIRENV_FILE"], "detect_extensions": [], - "detect_files": [ - ".envrc" - ], + "detect_files": [".envrc"], "detect_folders": [], "disabled": true, "format": "[$symbol$loaded/$allowed]($style) ", @@ -446,11 +401,7 @@ }, "dotnet": { "default": { - "detect_extensions": [ - "csproj", - "fsproj", - "xproj" - ], + "detect_extensions": ["csproj", "fsproj", "xproj"], "detect_files": [ "global.json", "project.json", @@ -475,9 +426,7 @@ "elixir": { "default": { "detect_extensions": [], - "detect_files": [ - "mix.exs" - ], + "detect_files": ["mix.exs"], "detect_folders": [], "disabled": false, "format": "via [$symbol($version \\(OTP $otp_version\\) )]($style)", @@ -493,17 +442,9 @@ }, "elm": { "default": { - "detect_extensions": [ - "elm" - ], - "detect_files": [ - "elm.json", - "elm-package.json", - ".elm-version" - ], - "detect_folders": [ - "elm-stuff" - ], + "detect_extensions": ["elm"], + "detect_files": ["elm.json", "elm-package.json", ".elm-version"], + "detect_folders": ["elm-stuff"], "disabled": false, "format": "via [$symbol($version )]($style)", "style": "cyan bold", @@ -526,10 +467,7 @@ "erlang": { "default": { "detect_extensions": [], - "detect_files": [ - "rebar.config", - "erlang.mk" - ], + "detect_files": ["rebar.config", "erlang.mk"], "detect_folders": [], "disabled": false, "format": "via [$symbol($version )]($style)", @@ -545,9 +483,7 @@ }, "fennel": { "default": { - "detect_extensions": [ - "fnl" - ], + "detect_extensions": ["fnl"], "detect_files": [], "detect_folders": [], "disabled": true, @@ -716,12 +652,8 @@ }, "gleam": { "default": { - "detect_extensions": [ - "gleam" - ], - "detect_files": [ - "gleam.toml" - ], + "detect_extensions": ["gleam"], + "detect_files": ["gleam.toml"], "detect_folders": [], "disabled": false, "format": "via [$symbol($version )]($style)", @@ -737,9 +669,7 @@ }, "golang": { "default": { - "detect_extensions": [ - "go" - ], + "detect_extensions": ["go"], "detect_files": [ "go.mod", "go.sum", @@ -749,9 +679,7 @@ "Gopkg.lock", ".go-version" ], - "detect_folders": [ - "Godeps" - ], + "detect_folders": ["Godeps"], "disabled": false, "format": "via [$symbol($version )]($style)", "not_capable_style": "bold red", @@ -767,14 +695,9 @@ }, "gradle": { "default": { - "detect_extensions": [ - "gradle", - "gradle.kts" - ], + "detect_extensions": ["gradle", "gradle.kts"], "detect_files": [], - "detect_folders": [ - "gradle" - ], + "detect_folders": ["gradle"], "disabled": false, "format": "via [$symbol($version )]($style)", "recursive": false, @@ -803,15 +726,8 @@ }, "haskell": { "default": { - "detect_extensions": [ - "hs", - "cabal", - "hs-boot" - ], - "detect_files": [ - "stack.yaml", - "cabal.project" - ], + "detect_extensions": ["hs", "cabal", "hs-boot"], + "detect_files": ["stack.yaml", "cabal.project"], "detect_folders": [], "disabled": false, "format": "via [$symbol($version )]($style)", @@ -827,19 +743,9 @@ }, "haxe": { "default": { - "detect_extensions": [ - "hx", - "hxml" - ], - "detect_files": [ - "haxelib.json", - "hxformat.json", - ".haxerc" - ], - "detect_folders": [ - ".haxelib", - "haxe_libraries" - ], + "detect_extensions": ["hx", "hxml"], + "detect_files": ["haxelib.json", "hxformat.json", ".haxerc"], + "detect_folders": [".haxelib", "haxe_libraries"], "disabled": false, "format": "via [$symbol($version )]($style)", "style": "bold fg:202", @@ -855,10 +761,7 @@ "helm": { "default": { "detect_extensions": [], - "detect_files": [ - "helmfile.yaml", - "Chart.yaml" - ], + "detect_files": ["helmfile.yaml", "Chart.yaml"], "detect_folders": [], "disabled": false, "format": "via [$symbol($version )]($style)", @@ -906,14 +809,7 @@ }, "java": { "default": { - "detect_extensions": [ - "java", - "class", - "jar", - "gradle", - "clj", - "cljc" - ], + "detect_extensions": ["java", "class", "jar", "gradle", "clj", "cljc"], "detect_files": [ "pom.xml", "build.gradle.kts", @@ -955,13 +851,8 @@ }, "julia": { "default": { - "detect_extensions": [ - "jl" - ], - "detect_files": [ - "Project.toml", - "Manifest.toml" - ], + "detect_extensions": ["jl"], + "detect_files": ["Project.toml", "Manifest.toml"], "detect_folders": [], "disabled": false, "format": "via [$symbol($version )]($style)", @@ -977,10 +868,7 @@ }, "kotlin": { "default": { - "detect_extensions": [ - "kt", - "kts" - ], + "detect_extensions": ["kt", "kts"], "detect_files": [], "detect_folders": [], "disabled": false, @@ -1041,15 +929,9 @@ }, "lua": { "default": { - "detect_extensions": [ - "lua" - ], - "detect_files": [ - ".lua-version" - ], - "detect_folders": [ - "lua" - ], + "detect_extensions": ["lua"], + "detect_files": [".lua-version"], + "detect_folders": ["lua"], "disabled": false, "format": "via [$symbol($version )]($style)", "lua_binary": "lua", @@ -1094,10 +976,7 @@ }, "mojo": { "default": { - "detect_extensions": [ - "mojo", - "🔥" - ], + "detect_extensions": ["mojo", "🔥"], "detect_files": [], "detect_folders": [], "disabled": false, @@ -1139,14 +1018,8 @@ }, "nim": { "default": { - "detect_extensions": [ - "nim", - "nims", - "nimble" - ], - "detect_files": [ - "nim.cfg" - ], + "detect_extensions": ["nim", "nims", "nimble"], + "detect_files": ["nim.cfg"], "detect_folders": [], "disabled": false, "format": "via [$symbol($version )]($style)", @@ -1179,14 +1052,7 @@ }, "nodejs": { "default": { - "detect_extensions": [ - "js", - "mjs", - "cjs", - "ts", - "mts", - "cts" - ], + "detect_extensions": ["js", "mjs", "cjs", "ts", "mts", "cts"], "detect_files": [ "package.json", ".node-version", @@ -1195,9 +1061,7 @@ "!bun.lock", "!bun.lockb" ], - "detect_folders": [ - "node_modules" - ], + "detect_folders": ["node_modules"], "disabled": false, "format": "via [$symbol($version )]($style)", "not_capable_style": "bold red", @@ -1213,13 +1077,7 @@ }, "ocaml": { "default": { - "detect_extensions": [ - "opam", - "ml", - "mli", - "re", - "rei" - ], + "detect_extensions": ["opam", "ml", "mli", "re", "rei"], "detect_files": [ "dune", "dune-project", @@ -1227,10 +1085,7 @@ "jbuild-ignore", ".merlin" ], - "detect_folders": [ - "_opam", - "esy.lock" - ], + "detect_folders": ["_opam", "esy.lock"], "disabled": false, "format": "via [$symbol($version )(\\($switch_indicator$switch_name\\) )]($style)", "global_switch_indicator": "", @@ -1247,9 +1102,7 @@ }, "odin": { "default": { - "detect_extensions": [ - "odin" - ], + "detect_extensions": ["odin"], "detect_files": [], "detect_folders": [], "disabled": false, @@ -1266,9 +1119,7 @@ }, "opa": { "default": { - "detect_extensions": [ - "rego" - ], + "detect_extensions": ["rego"], "detect_files": [], "detect_folders": [], "disabled": false, @@ -1378,11 +1229,7 @@ }, "perl": { "default": { - "detect_extensions": [ - "pl", - "pm", - "pod" - ], + "detect_extensions": ["pl", "pm", "pod"], "detect_files": [ "Makefile.PL", "Build.PL", @@ -1407,13 +1254,8 @@ }, "php": { "default": { - "detect_extensions": [ - "php" - ], - "detect_files": [ - "composer.json", - ".php-version" - ], + "detect_extensions": ["php"], + "detect_files": ["composer.json", ".php-version"], "detect_folders": [], "disabled": false, "format": "via [$symbol($version )]($style)", @@ -1442,6 +1284,23 @@ } ] }, + "pixi": { + "default": { + "detect_files": ["pixi.toml", "pixi.lock"], + "disabled": false, + "format": "via [$symbol($version )(\\($environment\\) )]($style)", + "pixi_binary": ["pixi"], + "show_default_environment": true, + "style": "yellow bold", + "symbol": "📦 ", + "version_format": "v${raw}" + }, + "allOf": [ + { + "$ref": "#/definitions/PixiConfig" + } + ] + }, "pulumi": { "default": { "disabled": false, @@ -1459,14 +1318,8 @@ }, "purescript": { "default": { - "detect_extensions": [ - "purs" - ], - "detect_files": [ - "spago.dhall", - "spago.yaml", - "spago.lock" - ], + "detect_extensions": ["purs"], + "detect_files": ["spago.dhall", "spago.yaml", "spago.lock"], "detect_folders": [], "disabled": false, "format": "via [$symbol($version )]($style)", @@ -1482,13 +1335,8 @@ }, "python": { "default": { - "detect_env_vars": [ - "VIRTUAL_ENV" - ], - "detect_extensions": [ - "py", - "ipynb" - ], + "detect_env_vars": ["VIRTUAL_ENV"], + "detect_extensions": ["py", "ipynb"], "detect_files": [ "requirements.txt", ".python-version", @@ -1496,25 +1344,14 @@ "Pipfile", "tox.ini", "setup.py", - "__init__.py", - "pixi.toml" + "__init__.py" ], "detect_folders": [], "disabled": false, "format": "via [${symbol}${pyenv_prefix}(${version} )(\\($virtualenv\\) )]($style)", "pyenv_prefix": "pyenv ", "pyenv_version_name": false, - "python_binary": [ - [ - "python" - ], - [ - "python3" - ], - [ - "python2" - ] - ], + "python_binary": [["python"], ["python3"], ["python2"]], "style": "yellow bold", "symbol": "🐍 ", "version_format": "v${raw}" @@ -1527,12 +1364,8 @@ }, "quarto": { "default": { - "detect_extensions": [ - "qmd" - ], - "detect_files": [ - "_quarto.yml" - ], + "detect_extensions": ["qmd"], + "detect_files": ["_quarto.yml"], "detect_folders": [], "disabled": false, "format": "via [$symbol($version )]($style)", @@ -1548,16 +1381,8 @@ }, "raku": { "default": { - "detect_extensions": [ - "p6", - "pm6", - "pod6", - "raku", - "rakumod" - ], - "detect_files": [ - "META6.json" - ], + "detect_extensions": ["p6", "pm6", "pod6", "raku", "rakumod"], + "detect_files": ["META6.json"], "detect_folders": [], "disabled": false, "format": "via [$symbol($version-$vm_version )]($style)", @@ -1573,10 +1398,7 @@ }, "red": { "default": { - "detect_extensions": [ - "red", - "reds" - ], + "detect_extensions": ["red", "reds"], "detect_files": [], "detect_folders": [], "disabled": false, @@ -1593,19 +1415,9 @@ }, "rlang": { "default": { - "detect_extensions": [ - "R", - "Rd", - "Rmd", - "Rproj", - "Rsx" - ], - "detect_files": [ - "DESCRIPTION" - ], - "detect_folders": [ - ".Rproj.user" - ], + "detect_extensions": ["R", "Rd", "Rmd", "Rproj", "Rsx"], + "detect_files": ["DESCRIPTION"], + "detect_folders": [".Rproj.user"], "disabled": false, "format": "via [$symbol($version )]($style)", "style": "blue bold", @@ -1620,18 +1432,10 @@ }, "ruby": { "default": { - "detect_extensions": [ - "rb" - ], - "detect_files": [ - "Gemfile", - ".ruby-version" - ], + "detect_extensions": ["rb"], + "detect_files": ["Gemfile", ".ruby-version"], "detect_folders": [], - "detect_variables": [ - "RUBY_VERSION", - "RBENV_VERSION" - ], + "detect_variables": ["RUBY_VERSION", "RBENV_VERSION"], "disabled": false, "format": "via [$symbol($version )]($style)", "style": "bold red", @@ -1646,12 +1450,8 @@ }, "rust": { "default": { - "detect_extensions": [ - "rs" - ], - "detect_files": [ - "Cargo.toml" - ], + "detect_extensions": ["rs"], + "detect_files": ["Cargo.toml"], "detect_folders": [], "disabled": false, "format": "via [$symbol($version )]($style)", @@ -1667,18 +1467,9 @@ }, "scala": { "default": { - "detect_extensions": [ - "sbt", - "scala" - ], - "detect_files": [ - ".scalaenv", - ".sbtenv", - "build.sbt" - ], - "detect_folders": [ - ".metals" - ], + "detect_extensions": ["sbt", "scala"], + "detect_files": [".scalaenv", ".sbtenv", "build.sbt"], + "detect_folders": [".metals"], "disabled": false, "format": "via [$symbol($version )]($style)", "style": "red bold", @@ -1745,12 +1536,8 @@ }, "solidity": { "default": { - "compiler": [ - "solc" - ], - "detect_extensions": [ - "sol" - ], + "compiler": ["solc"], + "detect_extensions": ["sol"], "detect_files": [], "detect_folders": [], "disabled": false, @@ -1818,12 +1605,8 @@ }, "swift": { "default": { - "detect_extensions": [ - "swift" - ], - "detect_files": [ - "Package.swift" - ], + "detect_extensions": ["swift"], + "detect_files": ["Package.swift"], "detect_folders": [], "disabled": false, "format": "via [$symbol($version )]($style)", @@ -1839,15 +1622,9 @@ }, "terraform": { "default": { - "detect_extensions": [ - "tf", - "tfplan", - "tfstate" - ], + "detect_extensions": ["tf", "tfplan", "tfstate"], "detect_files": [], - "detect_folders": [ - ".terraform" - ], + "detect_folders": [".terraform"], "disabled": false, "format": "via [$symbol$workspace]($style) ", "style": "bold 105", @@ -1877,12 +1654,8 @@ }, "typst": { "default": { - "detect_extensions": [ - "typ" - ], - "detect_files": [ - "template.typ" - ], + "detect_extensions": ["typ"], + "detect_files": ["template.typ"], "detect_folders": [], "disabled": false, "format": "via [$symbol($version )]($style)", @@ -1915,9 +1688,7 @@ "vagrant": { "default": { "detect_extensions": [], - "detect_files": [ - "Vagrantfile" - ], + "detect_files": ["Vagrantfile"], "detect_folders": [], "disabled": false, "format": "via [$symbol($version )]($style)", @@ -1946,14 +1717,8 @@ }, "vlang": { "default": { - "detect_extensions": [ - "v" - ], - "detect_files": [ - "v.mod", - "vpkg.json", - ".vpkg-lock.json" - ], + "detect_extensions": ["v"], + "detect_files": ["v.mod", "vpkg.json", ".vpkg-lock.json"], "detect_folders": [], "disabled": false, "format": "via [$symbol($version )]($style)", @@ -1969,9 +1734,7 @@ }, "zig": { "default": { - "detect_extensions": [ - "zig" - ], + "detect_extensions": ["zig"], "detect_files": [], "detect_folders": [], "disabled": false, @@ -2026,10 +1789,7 @@ "type": "boolean" }, "palette": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "palettes": { "default": {}, @@ -2196,17 +1956,11 @@ }, "charging_symbol": { "default": null, - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "discharging_symbol": { "default": null, - "type": [ - "string", - "null" - ] + "type": ["string", "null"] } }, "additionalProperties": false @@ -2242,11 +1996,7 @@ } }, "detect_files": { - "default": [ - "buf.yaml", - "buf.gen.yaml", - "buf.work.yaml" - ], + "default": ["buf.yaml", "buf.gen.yaml", "buf.work.yaml"], "type": "array", "items": { "type": "string" @@ -2293,11 +2043,7 @@ } }, "detect_files": { - "default": [ - "bun.lock", - "bun.lockb", - "bunfig.toml" - ], + "default": ["bun.lock", "bun.lockb", "bunfig.toml"], "type": "array", "items": { "type": "string" @@ -2337,10 +2083,7 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "c", - "h" - ], + "default": ["c", "h"], "type": "array", "items": { "type": "string" @@ -2362,18 +2105,9 @@ }, "commands": { "default": [ - [ - "cc", - "--version" - ], - [ - "gcc", - "--version" - ], - [ - "clang", - "--version" - ] + ["cc", "--version"], + ["gcc", "--version"], + ["clang", "--version"] ], "type": "array", "items": { @@ -2455,10 +2189,7 @@ } }, "detect_files": { - "default": [ - "CMakeLists.txt", - "CMakeCache.txt" - ], + "default": ["CMakeLists.txt", "CMakeCache.txt"], "type": "array", "items": { "type": "string" @@ -2508,10 +2239,7 @@ "format": "int64" }, "notification_timeout": { - "type": [ - "integer", - "null" - ], + "type": ["integer", "null"], "format": "uint32", "minimum": 0.0 } @@ -2542,12 +2270,7 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "cbl", - "cob", - "CBL", - "COB" - ], + "default": ["cbl", "cob", "CBL", "COB"], "type": "array", "items": { "type": "string" @@ -2595,6 +2318,10 @@ "default": true, "type": "boolean" }, + "ignore_pixi_envs": { + "default": true, + "type": "boolean" + }, "disabled": { "default": false, "type": "boolean" @@ -2728,18 +2455,14 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "cr" - ], + "default": ["cr"], "type": "array", "items": { "type": "string" } }, "detect_files": { - "default": [ - "shard.yml" - ], + "default": ["shard.yml"], "type": "array", "items": { "type": "string" @@ -2786,9 +2509,7 @@ } }, "detect_files": { - "default": [ - "daml.yaml" - ], + "default": ["daml.yaml"], "type": "array", "items": { "type": "string" @@ -2828,29 +2549,21 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "dart" - ], + "default": ["dart"], "type": "array", "items": { "type": "string" } }, "detect_files": { - "default": [ - "pubspec.yaml", - "pubspec.yml", - "pubspec.lock" - ], + "default": ["pubspec.yaml", "pubspec.yml", "pubspec.lock"], "type": "array", "items": { "type": "string" } }, "detect_folders": { - "default": [ - ".dart_tool" - ], + "default": [".dart_tool"], "type": "array", "items": { "type": "string" @@ -2956,17 +2669,11 @@ }, "repo_root_style": { "default": null, - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "before_repo_root_style": { "default": null, - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "disabled": { "default": false, @@ -3022,18 +2729,14 @@ } }, "detect_env_vars": { - "default": [ - "DIRENV_FILE" - ], + "default": ["DIRENV_FILE"], "type": "array", "items": { "type": "string" } }, "detect_files": { - "default": [ - ".envrc" - ], + "default": [".envrc"], "type": "array", "items": { "type": "string" @@ -3148,11 +2851,7 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "csproj", - "fsproj", - "xproj" - ], + "default": ["csproj", "fsproj", "xproj"], "type": "array", "items": { "type": "string" @@ -3212,9 +2911,7 @@ } }, "detect_files": { - "default": [ - "mix.exs" - ], + "default": ["mix.exs"], "type": "array", "items": { "type": "string" @@ -3254,29 +2951,21 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "elm" - ], + "default": ["elm"], "type": "array", "items": { "type": "string" } }, "detect_files": { - "default": [ - "elm.json", - "elm-package.json", - ".elm-version" - ], + "default": ["elm.json", "elm-package.json", ".elm-version"], "type": "array", "items": { "type": "string" } }, "detect_folders": { - "default": [ - "elm-stuff" - ], + "default": ["elm-stuff"], "type": "array", "items": { "type": "string" @@ -3297,16 +2986,10 @@ "type": "string" }, "variable": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "default": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "format": { "default": "with [$env_value]($style) ", @@ -3354,10 +3037,7 @@ } }, "detect_files": { - "default": [ - "rebar.config", - "erlang.mk" - ], + "default": ["rebar.config", "erlang.mk"], "type": "array", "items": { "type": "string" @@ -3397,9 +3077,7 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "fnl" - ], + "default": ["fnl"], "type": "array", "items": { "type": "string" @@ -3776,10 +3454,7 @@ "type": "boolean" }, "windows_starship": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] } }, "additionalProperties": false @@ -3808,18 +3483,14 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "gleam" - ], + "default": ["gleam"], "type": "array", "items": { "type": "string" } }, "detect_files": { - "default": [ - "gleam.toml" - ], + "default": ["gleam.toml"], "type": "array", "items": { "type": "string" @@ -3863,9 +3534,7 @@ "type": "string" }, "detect_extensions": { - "default": [ - "go" - ], + "default": ["go"], "type": "array", "items": { "type": "string" @@ -3887,9 +3556,7 @@ } }, "detect_folders": { - "default": [ - "Godeps" - ], + "default": ["Godeps"], "type": "array", "items": { "type": "string" @@ -3926,10 +3593,7 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "gradle", - "gradle.kts" - ], + "default": ["gradle", "gradle.kts"], "type": "array", "items": { "type": "string" @@ -3943,9 +3607,7 @@ } }, "detect_folders": { - "default": [ - "gradle" - ], + "default": ["gradle"], "type": "array", "items": { "type": "string" @@ -4000,21 +3662,14 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "hs", - "cabal", - "hs-boot" - ], + "default": ["hs", "cabal", "hs-boot"], "type": "array", "items": { "type": "string" } }, "detect_files": { - "default": [ - "stack.yaml", - "cabal.project" - ], + "default": ["stack.yaml", "cabal.project"], "type": "array", "items": { "type": "string" @@ -4054,31 +3709,21 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "hx", - "hxml" - ], + "default": ["hx", "hxml"], "type": "array", "items": { "type": "string" } }, "detect_files": { - "default": [ - "haxelib.json", - "hxformat.json", - ".haxerc" - ], + "default": ["haxelib.json", "hxformat.json", ".haxerc"], "type": "array", "items": { "type": "string" } }, "detect_folders": { - "default": [ - ".haxelib", - "haxe_libraries" - ], + "default": [".haxelib", "haxe_libraries"], "type": "array", "items": { "type": "string" @@ -4118,10 +3763,7 @@ } }, "detect_files": { - "default": [ - "helmfile.yaml", - "Chart.yaml" - ], + "default": ["helmfile.yaml", "Chart.yaml"], "type": "array", "items": { "type": "string" @@ -4236,14 +3878,7 @@ "type": "string" }, "detect_extensions": { - "default": [ - "java", - "class", - "jar", - "gradle", - "clj", - "cljc" - ], + "default": ["java", "class", "jar", "gradle", "clj", "cljc"], "type": "array", "items": { "type": "string" @@ -4336,19 +3971,14 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "jl" - ], + "default": ["jl"], "type": "array", "items": { "type": "string" } }, "detect_files": { - "default": [ - "Project.toml", - "Manifest.toml" - ], + "default": ["Project.toml", "Manifest.toml"], "type": "array", "items": { "type": "string" @@ -4392,10 +4022,7 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "kt", - "kts" - ], + "default": ["kt", "kts"], "type": "array", "items": { "type": "string" @@ -4498,38 +4125,23 @@ }, "user_pattern": { "default": null, - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "symbol": { "default": null, - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "style": { "default": null, - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "context_alias": { "default": null, - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "user_alias": { "default": null, - "type": [ - "string", - "null" - ] + "type": ["string", "null"] } }, "additionalProperties": false @@ -4594,27 +4206,21 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "lua" - ], + "default": ["lua"], "type": "array", "items": { "type": "string" } }, "detect_files": { - "default": [ - ".lua-version" - ], + "default": [".lua-version"], "type": "array", "items": { "type": "string" } }, "detect_folders": { - "default": [ - "lua" - ], + "default": ["lua"], "type": "array", "items": { "type": "string" @@ -4702,10 +4308,7 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "mojo", - "🔥" - ], + "default": ["mojo", "🔥"], "type": "array", "items": { "type": "string" @@ -4796,20 +4399,14 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "nim", - "nims", - "nimble" - ], + "default": ["nim", "nims", "nimble"], "type": "array", "items": { "type": "string" } }, "detect_files": { - "default": [ - "nim.cfg" - ], + "default": ["nim.cfg"], "type": "array", "items": { "type": "string" @@ -4891,14 +4488,7 @@ "type": "string" }, "detect_extensions": { - "default": [ - "js", - "mjs", - "cjs", - "ts", - "mts", - "cts" - ], + "default": ["js", "mjs", "cjs", "ts", "mts", "cts"], "type": "array", "items": { "type": "string" @@ -4919,9 +4509,7 @@ } }, "detect_folders": { - "default": [ - "node_modules" - ], + "default": ["node_modules"], "type": "array", "items": { "type": "string" @@ -4962,13 +4550,7 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "opam", - "ml", - "mli", - "re", - "rei" - ], + "default": ["opam", "ml", "mli", "re", "rei"], "type": "array", "items": { "type": "string" @@ -4988,10 +4570,7 @@ } }, "detect_folders": { - "default": [ - "_opam", - "esy.lock" - ], + "default": ["_opam", "esy.lock"], "type": "array", "items": { "type": "string" @@ -5024,9 +4603,7 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "odin" - ], + "default": ["odin"], "type": "array", "items": { "type": "string" @@ -5073,9 +4650,7 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "rego" - ], + "default": ["rego"], "type": "array", "items": { "type": "string" @@ -5251,11 +4826,7 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "pl", - "pm", - "pod" - ], + "default": ["pl", "pm", "pod"], "type": "array", "items": { "type": "string" @@ -5310,19 +4881,14 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "php" - ], + "default": ["php"], "type": "array", "items": { "type": "string" } }, "detect_files": { - "default": [ - "composer.json", - ".php-version" - ], + "default": ["composer.json", ".php-version"], "type": "array", "items": { "type": "string" @@ -5369,6 +4935,64 @@ }, "additionalProperties": false }, + "PixiConfig": { + "type": "object", + "properties": { + "pixi_binary": { + "default": ["pixi"], + "allOf": [ + { + "$ref": "#/definitions/Either_for_String_and_Array_of_String" + } + ] + }, + "show_default_environment": { + "default": true, + "type": "boolean" + }, + "format": { + "default": "via [$symbol($version )(\\($environment\\) )]($style)", + "type": "string" + }, + "version_format": { + "default": "v${raw}", + "type": "string" + }, + "symbol": { + "default": "📦 ", + "type": "string" + }, + "style": { + "default": "yellow bold", + "type": "string" + }, + "disabled": { + "default": false, + "type": "boolean" + }, + "detect_files": { + "default": ["pixi.toml", "pixi.lock"], + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "Either_for_String_and_Array_of_String": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, "PulumiConfig": { "type": "object", "properties": { @@ -5423,20 +5047,14 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "purs" - ], + "default": ["purs"], "type": "array", "items": { "type": "string" } }, "detect_files": { - "default": [ - "spago.dhall", - "spago.yaml", - "spago.lock" - ], + "default": ["spago.dhall", "spago.yaml", "spago.lock"], "type": "array", "items": { "type": "string" @@ -5464,17 +5082,7 @@ "type": "string" }, "python_binary": { - "default": [ - [ - "python" - ], - [ - "python3" - ], - [ - "python2" - ] - ], + "default": [["python"], ["python3"], ["python2"]], "allOf": [ { "$ref": "#/definitions/Either_for_Either_for_String_and_Array_of_String_and_Array_of_Either_for_String_and_Array_of_String" @@ -5502,10 +5110,7 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "py", - "ipynb" - ], + "default": ["py", "ipynb"], "type": "array", "items": { "type": "string" @@ -5519,8 +5124,7 @@ "Pipfile", "tox.ini", "setup.py", - "__init__.py", - "pixi.toml" + "__init__.py" ], "type": "array", "items": { @@ -5535,9 +5139,7 @@ } }, "detect_env_vars": { - "default": [ - "VIRTUAL_ENV" - ], + "default": ["VIRTUAL_ENV"], "type": "array", "items": { "type": "string" @@ -5596,18 +5198,14 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "qmd" - ], + "default": ["qmd"], "type": "array", "items": { "type": "string" } }, "detect_files": { - "default": [ - "_quarto.yml" - ], + "default": ["_quarto.yml"], "type": "array", "items": { "type": "string" @@ -5647,22 +5245,14 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "p6", - "pm6", - "pod6", - "raku", - "rakumod" - ], + "default": ["p6", "pm6", "pod6", "raku", "rakumod"], "type": "array", "items": { "type": "string" } }, "detect_files": { - "default": [ - "META6.json" - ], + "default": ["META6.json"], "type": "array", "items": { "type": "string" @@ -5702,10 +5292,7 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "red", - "reds" - ], + "default": ["red", "reds"], "type": "array", "items": { "type": "string" @@ -5752,31 +5339,21 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "R", - "Rd", - "Rmd", - "Rproj", - "Rsx" - ], + "default": ["R", "Rd", "Rmd", "Rproj", "Rsx"], "type": "array", "items": { "type": "string" } }, "detect_files": { - "default": [ - "DESCRIPTION" - ], + "default": ["DESCRIPTION"], "type": "array", "items": { "type": "string" } }, "detect_folders": { - "default": [ - ".Rproj.user" - ], + "default": [".Rproj.user"], "type": "array", "items": { "type": "string" @@ -5809,19 +5386,14 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "rb" - ], + "default": ["rb"], "type": "array", "items": { "type": "string" } }, "detect_files": { - "default": [ - "Gemfile", - ".ruby-version" - ], + "default": ["Gemfile", ".ruby-version"], "type": "array", "items": { "type": "string" @@ -5835,10 +5407,7 @@ } }, "detect_variables": { - "default": [ - "RUBY_VERSION", - "RBENV_VERSION" - ], + "default": ["RUBY_VERSION", "RBENV_VERSION"], "type": "array", "items": { "type": "string" @@ -5871,18 +5440,14 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "rs" - ], + "default": ["rs"], "type": "array", "items": { "type": "string" } }, "detect_files": { - "default": [ - "Cargo.toml" - ], + "default": ["Cargo.toml"], "type": "array", "items": { "type": "string" @@ -5922,30 +5487,21 @@ "type": "string" }, "detect_extensions": { - "default": [ - "sbt", - "scala" - ], + "default": ["sbt", "scala"], "type": "array", "items": { "type": "string" } }, "detect_files": { - "default": [ - ".scalaenv", - ".sbtenv", - "build.sbt" - ], + "default": [".scalaenv", ".sbtenv", "build.sbt"], "type": "array", "items": { "type": "string" } }, "detect_folders": { - "default": [ - ".metals" - ], + "default": [".metals"], "type": "array", "items": { "type": "string" @@ -5978,10 +5534,7 @@ "type": "string" }, "pwsh_indicator": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "ion_indicator": { "default": "ion", @@ -6105,9 +5658,7 @@ "type": "string" }, "compiler": { - "default": [ - "solc" - ], + "default": ["solc"], "allOf": [ { "$ref": "#/definitions/Either_for_String_and_Array_of_String" @@ -6115,9 +5666,7 @@ ] }, "detect_extensions": { - "default": [ - "sol" - ], + "default": ["sol"], "type": "array", "items": { "type": "string" @@ -6204,16 +5753,10 @@ "type": "string" }, "success_style": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "failure_style": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "map_symbol": { "default": false, @@ -6236,10 +5779,7 @@ "type": "string" }, "pipestatus_segment_format": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "disabled": { "default": true, @@ -6298,18 +5838,14 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "swift" - ], + "default": ["swift"], "type": "array", "items": { "type": "string" } }, "detect_files": { - "default": [ - "Package.swift" - ], + "default": ["Package.swift"], "type": "array", "items": { "type": "string" @@ -6349,11 +5885,7 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "tf", - "tfplan", - "tfstate" - ], + "default": ["tf", "tfplan", "tfstate"], "type": "array", "items": { "type": "string" @@ -6367,9 +5899,7 @@ } }, "detect_folders": { - "default": [ - ".terraform" - ], + "default": [".terraform"], "type": "array", "items": { "type": "string" @@ -6394,10 +5924,7 @@ "type": "boolean" }, "time_format": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "disabled": { "default": true, @@ -6438,18 +5965,14 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "typ" - ], + "default": ["typ"], "type": "array", "items": { "type": "string" } }, "detect_files": { - "default": [ - "template.typ" - ], + "default": ["template.typ"], "type": "array", "items": { "type": "string" @@ -6536,9 +6059,7 @@ } }, "detect_files": { - "default": [ - "Vagrantfile" - ], + "default": ["Vagrantfile"], "type": "array", "items": { "type": "string" @@ -6600,20 +6121,14 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "v" - ], + "default": ["v"], "type": "array", "items": { "type": "string" } }, "detect_files": { - "default": [ - "v.mod", - "vpkg.json", - ".vpkg-lock.json" - ], + "default": ["v.mod", "vpkg.json", ".vpkg-lock.json"], "type": "array", "items": { "type": "string" @@ -6653,9 +6168,7 @@ "type": "boolean" }, "detect_extensions": { - "default": [ - "zig" - ], + "default": ["zig"], "type": "array", "items": { "type": "string" @@ -6747,16 +6260,10 @@ } }, "os": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "use_stdin": { - "type": [ - "boolean", - "null" - ] + "type": ["boolean", "null"] }, "ignore_timeout": { "default": false, diff --git a/docs/config/README.md b/docs/config/README.md index 2e915893b..cdc9f027f 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -957,6 +957,7 @@ If you use [pixi](https://pixi.sh), you can disable pixi's prompt modifier by ru | `style` | `'bold green'` | The style for the module. | | `format` | `'via [$symbol$environment]($style) '` | The format for the module. | | `ignore_base` | `true` | Ignores `base` environment when activated. | +| `detect_env_vars` | `["!PIXI_ENVIRONMENT_NAME"]` | Which environment variable(s) should trigger this module. If it's a pixi environment, this module is not being triggered by default. | | `disabled` | `false` | Disables the `conda` module. | ### Variables @@ -3652,6 +3653,49 @@ The `pijul_channel` module shows the active channel of the repo in your current | `truncation_symbol` | `'…'` | The symbol used to indicate a branch name was truncated. | | `disabled` | `true` | Disables the `pijul` module. | +## Pixi + +The `pixi` module shows the installed [pixi](https://pixi.sh) version as well as the activated environment, if `$PIXI_ENVIRONMENT_NAME` is set. + +::: tip + +This does not suppress pixi's own prompt modifier, you may want to run `pixi config set change-ps1 false`. + +::: + +### Options + +| Option | Default | Description | +| -------------------------- | ------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `format` | `'via [$symbol($version )(\($environment\) )]($style)'` | The format for the module. | +| `version_format` | `'v${raw}'` | The version format. Available vars are `raw`, `major`, `minor`, & `patch`. | +| `symbol` | `'🧚 '` | The symbol used before the environment name. | +| `style` | `'yellow bold' | The style for the module. | +| `show_default_environment` | `true` | Whether to indicate that the `default` environment of your project is activated. | +| `pixi_binary` | `['pixi']` | Configures the pixi binary that Starship should execute when getting the version. | +| `detect_extensions` | `[]` | Which extensions should trigger this module. | +| `detect_files` | `['pixi.toml']` | Which filenames should trigger this module. | +| `detect_folders` | `['.pixi']` | Which folders should trigger this module. | +| `disabled` | `false` | Disables the `pixi` module. | + +### Variables + +| Variable | Example | Description | +| ----------- | --------- | ------------------------------------ | +| version | `v0.33.0` | The version of `pixi` | +| environment | `py311` | The current pixi environment | +| symbol | | Mirrors the value of option `symbol` | +| style | | Mirrors the value of option `style` | + +### Example + +```toml +# ~/.config/starship.toml + +[pixi] +format = '[$symbol$environment](yellow) ' +``` + ## Pulumi The `pulumi` module shows the current username, selected [Pulumi Stack](https://www.pulumi.com/docs/intro/concepts/stack/), and version. @@ -3770,26 +3814,25 @@ By default, the module will be shown if any of the following conditions are met: - The current directory contains a `requirements.txt` file - The current directory contains a `setup.py` file - The current directory contains a `tox.ini` file -- The current directory contains a `pixi.toml` file - The current directory contains a file with the `.py` extension. - The current directory contains a file with the `.ipynb` extension. - A virtual environment is currently activated ### Options -| Option | Default | Description | -| -------------------- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `format` | `'via [${symbol}${pyenv_prefix}(${version} )(\($virtualenv\) )]($style)'` | The format for the module. | -| `version_format` | `'v${raw}'` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `'🐍 '` | A format string representing the symbol of Python | -| `style` | `'yellow bold'` | The style for the module. | -| `pyenv_version_name` | `false` | Use pyenv to get Python version | -| `pyenv_prefix` | `'pyenv'` | Prefix before pyenv version display, only used if pyenv is used | -| `python_binary` | `['python', 'python3', 'python2']` | Configures the python binaries that Starship should executes when getting the version. | -| `detect_extensions` | `['py', 'ipynb']` | Which extensions should trigger this module | -| `detect_files` | `['.python-version', 'Pipfile', '__init__.py', 'pyproject.toml', 'requirements.txt', 'setup.py', 'tox.ini', 'pixi.toml']` | Which filenames should trigger this module | -| `detect_folders` | `[]` | Which folders should trigger this module | -| `disabled` | `false` | Disables the `python` module. | +| Option | Default | Description | +| -------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------- | +| `format` | `'via [${symbol}${pyenv_prefix}(${version} )(\($virtualenv\) )]($style)'` | The format for the module. | +| `version_format` | `'v${raw}'` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `'🐍 '` | A format string representing the symbol of Python | +| `style` | `'yellow bold'` | The style for the module. | +| `pyenv_version_name` | `false` | Use pyenv to get Python version | +| `pyenv_prefix` | `'pyenv'` | Prefix before pyenv version display, only used if pyenv is used | +| `python_binary` | `['python', 'python3', 'python2']` | Configures the python binaries that Starship should execute when getting the version. | +| `detect_extensions` | `['py', 'ipynb']` | Which extensions should trigger this module | +| `detect_files` | `['.python-version', 'Pipfile', '__init__.py', 'pyproject.toml', 'requirements.txt', 'setup.py', 'tox.ini']` | Which filenames should trigger this module | +| `detect_folders` | `[]` | Which folders should trigger this module | +| `disabled` | `false` | Disables the `python` module. | ::: tip diff --git a/docs/public/presets/toml/bracketed-segments.toml b/docs/public/presets/toml/bracketed-segments.toml index 0c6cc679a..c60e8574d 100644 --- a/docs/public/presets/toml/bracketed-segments.toml +++ b/docs/public/presets/toml/bracketed-segments.toml @@ -139,6 +139,9 @@ format = '\[[$symbol($version)]($style)\]' [pijul_channel] format = '\[[$symbol$channel]($style)\]' +[pixi] +format = '\[[$symbol$version( $environment)]($style)\]' + [pulumi] format = '\[[$symbol$stack]($style)\]' diff --git a/docs/public/presets/toml/gruvbox-rainbow.toml b/docs/public/presets/toml/gruvbox-rainbow.toml index 563726f75..c2321c4c0 100644 --- a/docs/public/presets/toml/gruvbox-rainbow.toml +++ b/docs/public/presets/toml/gruvbox-rainbow.toml @@ -23,6 +23,7 @@ $python\ [](fg:color_blue bg:color_bg3)\ $docker_context\ $conda\ +$pixi\ [](fg:color_bg3 bg:color_bg1)\ $time\ [ ](fg:color_bg1)\ @@ -156,6 +157,10 @@ format = '[[ $symbol( $context) ](fg:#83a598 bg:color_bg3)]($style)' style = "bg:color_bg3" format = '[[ $symbol( $environment) ](fg:#83a598 bg:color_bg3)]($style)' +[pixi] +style = "bg:color_bg3" +format = '[[ $symbol( $version)( $environment) ](fg:color_fg0 bg:color_bg3)]($style)' + [time] disabled = false time_format = "%R" diff --git a/docs/public/presets/toml/jetpack.toml b/docs/public/presets/toml/jetpack.toml index 3819b09f2..ce5dfea6a 100644 --- a/docs/public/presets/toml/jetpack.toml +++ b/docs/public/presets/toml/jetpack.toml @@ -73,6 +73,7 @@ $vagrant\ $zig\ $buf\ $conda\ +$pixi\ $meson\ $spack\ $memory_usage\ @@ -267,6 +268,10 @@ format = " [$symbol($version(-$name))]($style)" symbol = "◯ " format = " conda [$symbol$environment]($style)" +[pixi] +symbol = "■ " +format = " pixi [$symbol$version ($environment )]($style)" + [dart] symbol = "◁◅ " format = " dart [$symbol($version )]($style)" diff --git a/docs/public/presets/toml/nerd-font-symbols.toml b/docs/public/presets/toml/nerd-font-symbols.toml index 3f7cecce2..5f6df83ee 100644 --- a/docs/public/presets/toml/nerd-font-symbols.toml +++ b/docs/public/presets/toml/nerd-font-symbols.toml @@ -159,6 +159,9 @@ symbol = " " [pijul_channel] symbol = " " +[pixi] +symbol = "󰏗 " + [python] symbol = " " diff --git a/docs/public/presets/toml/no-runtime-versions.toml b/docs/public/presets/toml/no-runtime-versions.toml index 529fe8da8..50a47dfdd 100644 --- a/docs/public/presets/toml/no-runtime-versions.toml +++ b/docs/public/presets/toml/no-runtime-versions.toml @@ -82,6 +82,9 @@ format = 'via [$symbol]($style)' [perl] format = 'via [$symbol]($style)' +[pixi] +format = 'via [$symbol($environment )]($style)' + [php] format = 'via [$symbol]($style)' diff --git a/docs/public/presets/toml/plain-text-symbols.toml b/docs/public/presets/toml/plain-text-symbols.toml index 3ccb4b423..5fa653e87 100644 --- a/docs/public/presets/toml/plain-text-symbols.toml +++ b/docs/public/presets/toml/plain-text-symbols.toml @@ -204,6 +204,9 @@ symbol = "php " [pijul_channel] symbol = "pijul " +[pixi] +symbol = "pixi " + [pulumi] symbol = "pulumi " diff --git a/src/configs/conda.rs b/src/configs/conda.rs index 173b422f2..105d7de87 100644 --- a/src/configs/conda.rs +++ b/src/configs/conda.rs @@ -13,6 +13,7 @@ pub struct CondaConfig<'a> { pub symbol: &'a str, pub style: &'a str, pub ignore_base: bool, + pub detect_env_vars: Vec<&'a str>, pub disabled: bool, } @@ -24,6 +25,7 @@ impl Default for CondaConfig<'_> { symbol: "🅒 ", style: "green bold", ignore_base: true, + detect_env_vars: vec!["!PIXI_ENVIRONMENT_NAME"], disabled: false, } } diff --git a/src/configs/mod.rs b/src/configs/mod.rs index 6f583ab4b..52e9719a6 100644 --- a/src/configs/mod.rs +++ b/src/configs/mod.rs @@ -72,6 +72,7 @@ pub mod package; pub mod perl; pub mod php; pub mod pijul_channel; +pub mod pixi; pub mod pulumi; pub mod purescript; pub mod python; @@ -255,6 +256,8 @@ pub struct FullConfig<'a> { #[serde(borrow)] pijul_channel: pijul_channel::PijulConfig<'a>, #[serde(borrow)] + pixi: pixi::PixiConfig<'a>, + #[serde(borrow)] pulumi: pulumi::PulumiConfig<'a>, #[serde(borrow)] purescript: purescript::PureScriptConfig<'a>, diff --git a/src/configs/pixi.rs b/src/configs/pixi.rs new file mode 100644 index 000000000..8b5ef3a46 --- /dev/null +++ b/src/configs/pixi.rs @@ -0,0 +1,40 @@ +use serde::{Deserialize, Serialize}; + +use crate::config::VecOr; + +#[derive(Clone, Deserialize, Serialize)] +#[cfg_attr( + feature = "config-schema", + derive(schemars::JsonSchema), + schemars(deny_unknown_fields) +)] +#[serde(default)] +pub struct PixiConfig<'a> { + pub pixi_binary: VecOr<&'a str>, + pub show_default_environment: bool, + pub format: &'a str, + pub version_format: &'a str, + pub symbol: &'a str, + pub style: &'a str, + pub disabled: bool, + pub detect_extensions: Vec<&'a str>, + pub detect_files: Vec<&'a str>, + pub detect_folders: Vec<&'a str>, +} + +impl Default for PixiConfig<'_> { + fn default() -> Self { + PixiConfig { + pixi_binary: VecOr(vec!["pixi"]), + show_default_environment: true, + format: "via [$symbol($version )(\\($environment\\) )]($style)", + version_format: "v${raw}", + symbol: "🧚 ", + style: "yellow bold", + disabled: false, + detect_extensions: vec![], + detect_files: vec!["pixi.toml", "pixi.lock"], + detect_folders: vec![".pixi"], + } + } +} diff --git a/src/configs/python.rs b/src/configs/python.rs index c894180b8..c98b8c35b 100644 --- a/src/configs/python.rs +++ b/src/configs/python.rs @@ -48,7 +48,6 @@ impl Default for PythonConfig<'_> { "tox.ini", "setup.py", "__init__.py", - "pixi.toml", ], detect_folders: vec![], detect_env_vars: vec!["VIRTUAL_ENV"], diff --git a/src/configs/starship_root.rs b/src/configs/starship_root.rs index 2eb17dfa5..42556ca1d 100644 --- a/src/configs/starship_root.rs +++ b/src/configs/starship_root.rs @@ -106,6 +106,7 @@ pub const PROMPT_ORDER: &[&str] = &[ "guix_shell", "nix_shell", "conda", + "pixi", "meson", "spack", "memory_usage", diff --git a/src/module.rs b/src/module.rs index b0ece0702..f53a486a3 100644 --- a/src/module.rs +++ b/src/module.rs @@ -76,6 +76,7 @@ pub const ALL_MODULES: &[&str] = &[ "perl", "php", "pijul_channel", + "pixi", "pulumi", "purescript", "python", diff --git a/src/modules/conda.rs b/src/modules/conda.rs index fef82c89a..7d900a70a 100644 --- a/src/modules/conda.rs +++ b/src/modules/conda.rs @@ -20,6 +20,9 @@ pub fn module<'a>(context: &'a Context) -> Option> { if config.ignore_base && conda_env == "base" { return None; } + if !context.detect_env_vars(&config.detect_env_vars) { + return None; + } let conda_env = truncate(&conda_env, config.truncation_length).unwrap_or(conda_env); @@ -80,6 +83,18 @@ mod tests { assert_eq!(expected, actual); } + #[test] + fn ignore_pixi_envs() { + let actual = ModuleRenderer::new("conda") + .env("CONDA_DEFAULT_ENV", "my-env") + .env("PIXI_ENVIRONMENT_NAME", "my-env") + .collect(); + + let expected = None; + + assert_eq!(expected, actual); + } + #[test] fn env_set() { let actual = ModuleRenderer::new("conda") diff --git a/src/modules/mod.rs b/src/modules/mod.rs index dc4d3685c..feb7a85c9 100644 --- a/src/modules/mod.rs +++ b/src/modules/mod.rs @@ -69,6 +69,7 @@ mod package; mod perl; mod php; mod pijul_channel; +mod pixi; mod pulumi; mod purescript; mod python; @@ -183,6 +184,7 @@ pub fn handle<'a>(module: &str, context: &'a Context) -> Option> { "perl" => perl::module(context), "php" => php::module(context), "pijul_channel" => pijul_channel::module(context), + "pixi" => pixi::module(context), "pulumi" => pulumi::module(context), "purescript" => purescript::module(context), "python" => python::module(context), @@ -312,6 +314,9 @@ pub fn description(module: &str) -> &'static str { "perl" => "The currently installed version of Perl", "php" => "The currently installed version of PHP", "pijul_channel" => "The current channel of the repo in the current directory", + "pixi" => { + "The currently installed version of Pixi, and the active environment if $PIXI_ENVIRONMENT_NAME is set" + } "pulumi" => "The current username, stack, and installed version of Pulumi", "purescript" => "The currently installed version of PureScript", "python" => "The currently installed version of Python", diff --git a/src/modules/pixi.rs b/src/modules/pixi.rs new file mode 100644 index 000000000..54232554a --- /dev/null +++ b/src/modules/pixi.rs @@ -0,0 +1,139 @@ +use super::{Context, Module, ModuleConfig}; + +use crate::configs::pixi::PixiConfig; +use crate::formatter::{StringFormatter, VersionFormatter}; +use crate::utils::get_command_string_output; + +/// Creates a module with the current Pixi environment +/// +/// Will display the Pixi environment iff `$PIXI_ENVIRONMENT_NAME` is set. +/// Will display the Pixi version iff pixi files are detected or `$PIXI_ENVIRONMENT_NAME` is set. +pub fn module<'a>(context: &'a Context) -> Option> { + let mut module = context.new_module("pixi"); + let config: PixiConfig = PixiConfig::try_load(module.config); + + let pixi_environment_name = context.get_env("PIXI_ENVIRONMENT_NAME"); + let is_pixi_project = pixi_environment_name.is_some() + || context + .try_begin_scan()? + .set_files(&config.detect_files) + .set_extensions(&config.detect_extensions) + .set_folders(&config.detect_folders) + .is_match(); + if !is_pixi_project { + return None; + } + + let pixi_environment_name = if !config.show_default_environment + && pixi_environment_name == Some("default".to_string()) + { + None + } else { + pixi_environment_name + }; + + let parsed = StringFormatter::new(config.format).and_then(|formatter| { + formatter + .map_meta(|variable, _| match variable { + "symbol" => Some(config.symbol), + _ => None, + }) + .map_style(|variable| match variable { + "style" => Some(Ok(config.style)), + _ => None, + }) + .map(|variable| match variable { + "environment" => pixi_environment_name.clone().map(Ok), + "version" => { + let pixi_version = get_pixi_version(context, &config)?; + VersionFormatter::format_module_version( + module.get_name(), + &pixi_version, + config.version_format, + ) + .map(Ok) + } + _ => None, + }) + .parse(None, Some(context)) + }); + + module.set_segments(match parsed { + Ok(segments) => segments, + Err(error) => { + log::warn!("Error in module `pixi`:\n{}", error); + return None; + } + }); + + Some(module) +} + +fn get_pixi_version(context: &Context, config: &PixiConfig) -> Option { + let version = config + .pixi_binary + .0 + .iter() + .find_map(|binary| context.exec_cmd(binary, &["--version"])) + .map(get_command_string_output)?; + + Some(version.split_once(" ")?.1.trim().to_string()) +} + +#[cfg(test)] +mod tests { + use std::{fs::File, io}; + + use crate::test::ModuleRenderer; + use nu_ansi_term::Color; + + #[test] + fn not_in_env() { + let actual = ModuleRenderer::new("pixi").collect(); + + let expected = None; + + assert_eq!(expected, actual); + } + + #[test] + fn ignore_default_environment() { + let actual = ModuleRenderer::new("pixi") + .env("PIXI_ENVIRONMENT_NAME", "default") + .config(toml::toml! { + [pixi] + show_default_environment = false + }) + .collect(); + + let expected = Some(format!("via {}", Color::Yellow.bold().paint("🧚 v0.33.0 "))); + + assert_eq!(expected, actual); + } + + #[test] + fn env_set() { + let actual = ModuleRenderer::new("pixi") + .env("PIXI_ENVIRONMENT_NAME", "py312") + .collect(); + + let expected = Some(format!( + "via {}", + Color::Yellow.bold().paint("🧚 v0.33.0 (py312) ") + )); + + assert_eq!(expected, actual); + } + + #[test] + fn folder_with_pixi_toml() -> io::Result<()> { + let dir = tempfile::tempdir()?; + File::create(dir.path().join("pixi.toml"))?.sync_all()?; + + let actual = ModuleRenderer::new("pixi").path(dir.path()).collect(); + + let expected = Some(format!("via {}", Color::Yellow.bold().paint("🧚 v0.33.0 "))); + assert_eq!(expected, actual); + dir.close() + } +} diff --git a/src/modules/python.rs b/src/modules/python.rs index 37b1bef4d..1e059ab5b 100644 --- a/src/modules/python.rs +++ b/src/modules/python.rs @@ -289,18 +289,6 @@ Python 3.7.9 (7e6e2bb30ac5fbdbd443619cae28c51d5c162a02, Nov 24 2020, 10:03:59) dir.close() } - #[test] - fn folder_with_pixi_file() -> io::Result<()> { - let dir = tempfile::tempdir()?; - File::create(dir.path().join("pixi.toml"))?.sync_all()?; - - check_python2_renders(&dir, None); - check_python3_renders(&dir, None); - check_pyenv_renders(&dir, None); - check_multiple_binaries_renders(&dir, None); - dir.close() - } - #[test] fn folder_with_ipynb_file() -> io::Result<()> { let dir = tempfile::tempdir()?; diff --git a/src/utils.rs b/src/utils.rs index 7c778482e..5a6996214 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -440,6 +440,10 @@ WebAssembly: unavailable stdout: String::from("Outputting repository ↖"), stderr: String::default(), }), + "pixi --version" => Some(CommandOutput { + stdout: String::from("pixi 0.33.0"), + stderr: String::default(), + }), "pulumi version" => Some(CommandOutput { stdout: String::from("1.2.3-ver.1631311768+e696fb6c"), stderr: String::default(),