mirror of
https://codeberg.org/muon/home.git
synced 2026-03-10 04:13:13 +00:00
Fix shell for nu
This commit is contained in:
parent
a8c48415a4
commit
dcce5135aa
3 changed files with 358 additions and 4 deletions
|
|
@ -12,9 +12,16 @@ in {
|
|||
options.mods.terminal.hr.enable = lib.mkEnableOption "Hefring (Work Tooling)";
|
||||
|
||||
config = lib.mkIf cfg.hr.enable {
|
||||
programs.nushell = lib.mkIf cfg.nushell.enable {
|
||||
extraConfig = ''
|
||||
$env.PROJECT_ID = if ($env | get -o PROJECT_ID | is-empty) { "mk2-test" } else { $env.PROJECT_ID }
|
||||
'' + builtins.readFile ./hr.nu;
|
||||
};
|
||||
|
||||
programs.starship.settings.custom.project_id = {
|
||||
command = "if echo \"$PROJECT_ID\" | grep -q \"prod\"; then printf \"\\033[1;33m \\033[1;34m$PROJECT_ID\\033[0m\"; else printf \"\\033[1;34m$PROJECT_ID\\033[0m\"; fi";
|
||||
when = "test -n \"$PROJECT_ID\"";
|
||||
command = "if $env.PROJECT_ID =~ 'prod' { $'(ansi yellow_bold) (ansi blue_bold)($env.PROJECT_ID)(ansi reset)' } else { $'(ansi blue_bold)($env.PROJECT_ID)(ansi reset)' }";
|
||||
when = "not ($env | get -o PROJECT_ID | is-empty)";
|
||||
shell = ["nu" "--no-config-file" "-c"];
|
||||
format = "on $output ";
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue