From 9153af880963553e7e19207270521a7b13223d7e Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sat, 28 Jan 2023 22:05:02 +0100 Subject: [PATCH 1/6] terminal-life: switch from zsh to bash & starship --- modules/terminal-life/bash/default.nix | 71 +++++++++++ modules/terminal-life/default.nix | 22 ++-- modules/terminal-life/fzf/default.nix | 2 +- modules/terminal-life/starship.toml | 128 +++++++++++++++++++ modules/terminal-life/starship.toml.nix | 159 ++++++++++++++++++++++++ overlays/blesh.nix | 13 ++ pkgs/sway-launcher.nix | 3 +- profiles/base-user/default.nix | 1 - profiles/base-user/home.nix | 1 - 9 files changed, 385 insertions(+), 15 deletions(-) create mode 100644 modules/terminal-life/bash/default.nix create mode 100644 modules/terminal-life/starship.toml create mode 100644 modules/terminal-life/starship.toml.nix create mode 100644 overlays/blesh.nix diff --git a/modules/terminal-life/bash/default.nix b/modules/terminal-life/bash/default.nix new file mode 100644 index 0000000..05ea4ec --- /dev/null +++ b/modules/terminal-life/bash/default.nix @@ -0,0 +1,71 @@ +{ + config, + pkgs, + self, + ... +}: let + psCfg = config.pub-solar; + xdg = config.home-manager.users."${psCfg.user.name}".xdg; +in { + enable = true; + + historyControl = ["ignorespace"]; + + # Run when initializing a login shell + profileExtra = '' + [ "$(tty)" = "/dev/tty1" ] && exec ${pkgs.sway-service}/bin/sway-service + ''; + + # Run when initializing an interactive shell + initExtra = '' + # If a command is not found, show me where it is + source ${pkgs.nix-index}/etc/profile.d/command-not-found.sh + + # Helps you navigate directories faster + # https://github.com/gsamokovarov/jump + eval "$(${pkgs.jump}/bin/jump shell --bind=z)" + + eval "$(${pkgs.direnv}/bin/direnv hook bash)" + + # Syntax highlighting, auto suggestions, vim modes, etc. + # https://github.com/akinomyoga/ble.sh/wiki/Manual-A1-Installation#user-content-nixpkgs + source "$(blesh-share)" --attach=none + [[ ''${BLE_VERSION-} ]] && ble-attach + # ctrl + space to accept autocomplete suggestion + ble-bind -m 'auto_complete' -f 'C-@' 'auto_complete/insert-on-end' + # Meta (Alt) + Backspace to delete a word + ble-bind -m 'emacs' -f 'M-C-?' 'kill-backward-cword' + # Meta (Alt) + p to jump one word backwards + ble-bind -m 'emacs' -f M-p '@nomarked backward-cword' + # Meta (Alt) + n to jump one word forwards + ble-bind -m 'emacs' -f M-n '@nomarked forward-cword' + # Arrow up and Ctrl + p searches history for entered input + ble-bind -f up 'history-search-backward hide-status:immediate-accept:empty=emulate-readline:point=end' + ble-bind -f C-p 'history-search-backward hide-status:immediate-accept:empty=emulate-readline:point=end' + # Arrow down and Ctrl + n searches history for entered input + ble-bind -f down 'history-search-forward hide-status:immediate-accept:empty=emulate-readline:point=end' + ble-bind -f C-n 'history-search-forward hide-status:immediate-accept:empty=emulate-readline:point=end' + + bleopt filename_ls_colors="$LS_COLORS" + + source ${config.age.secrets.environment-secrets.path} + ''; + + shellAliases = { + nano = "nvim"; + vi = "nvim"; + vim = "nvim"; + mutt = "neomutt"; + ls = "exa"; + la = "exa --group-directories-first -lag"; + fm = "vifm ."; + vifm = "vifm ."; + wget = "wget --hsts-file=$XDG_CACHE_HOME/wget-hsts"; + irssi = "irssi --config=$XDG_CONFIG_HOME/irssi/config --home=$XDG_DATA_HOME/irssi"; + drone = "DRONE_TOKEN=$(secret-tool lookup drone token) drone"; + no = "manix \"\" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --preview=\"manix '{}'\" | xargs manix"; + # fix nixos-option + nixos-option = "nixos-option -I nixpkgs=${self}/lib/compat"; + myip = "dig +short myip.opendns.com @208.67.222.222 2>&1"; + }; +} diff --git a/modules/terminal-life/default.nix b/modules/terminal-life/default.nix index 3b58243..a47c4d2 100644 --- a/modules/terminal-life/default.nix +++ b/modules/terminal-life/default.nix @@ -24,27 +24,29 @@ in { config = mkIf cfg.enable { programs.command-not-found.enable = false; - # Needed to get zsh completion for system packages (e.g. systemd). - environment.pathsToLink = ["/share/zsh"]; - - environment.shells = with pkgs; [ - zsh - ]; - environment.systemPackages = with pkgs; [ screen ]; + # Starship is a fast and featureful shell prompt + # starship.toml has sane defaults that can be changed there + programs.starship = { + enable = true; + settings = import ./starship.toml.nix; + }; + home-manager = with pkgs; pkgs.lib.setAttrByPath ["users" psCfg.user.name] { home.packages = [ ack asciinema bat + blesh exa fd gh glow + jump nnn powerline silver-searcher @@ -52,18 +54,18 @@ in { watson ]; - programs.neovim = import ./nvim { + programs.bash = import ./bash { inherit config; inherit pkgs; + inherit self; }; programs.fzf = import ./fzf { inherit config; inherit pkgs; }; - programs.zsh = import ./zsh { + programs.neovim = import ./nvim { inherit config; inherit pkgs; - inherit self; }; }; }; diff --git a/modules/terminal-life/fzf/default.nix b/modules/terminal-life/fzf/default.nix index 0cc6fd9..372e768 100644 --- a/modules/terminal-life/fzf/default.nix +++ b/modules/terminal-life/fzf/default.nix @@ -10,5 +10,5 @@ "--color=fg:#d3d1d4,header:#7accd7,info:#e5c463,pointer:#ef9062" "--color=marker:#ef9062,fg+:#303030,prompt:#e5c463,hl+:#7accd7" ]; - enableZshIntegration = true; + enableBashIntegration = true; } diff --git a/modules/terminal-life/starship.toml b/modules/terminal-life/starship.toml new file mode 100644 index 0000000..1ef9ab7 --- /dev/null +++ b/modules/terminal-life/starship.toml @@ -0,0 +1,128 @@ +format = """ +[](#9A348E)\ +$character \ +[](bg:#DA627D fg:#9A348E)\ +$directory\ +[](fg:#DA627D bg:#FCA17D)\ +$git_branch\ +$git_status\ +[](fg:#FCA17D bg:#86BBD8)\ +$c\ +$deno\ +$golang\ +$haskell\ +$nix_shell\ +$nodejs\ +$php\ +$python\ +$ruby\ +$rust\ +$terraform\ +[](fg:#86BBD8 bg:#06969A)\ +$docker_context\ +[](fg:#06969A bg:#33658A)\ +$container \ +[](fg:#06969A bg:#33658A)\ +$time\ +[ ](fg:#33658A)\ +""" + +# Disable the blank line at the start of the prompt +# add_newline = false + +# You can also replace your username with a neat symbol like  to save some space +#[username] +#show_always = true +#style_user = "bg:#9A348E" +#style_root = "bg:#9A348E" +#format = '[$user ]($style)' +[character] +success_symbol = "[❯](bold purple)" +vicmd_symbol = "[❮](bold purple)" + +[directory] +style = "bg:#DA627D" +format = "[ $path ]($style)" +truncation_length = 3 +truncation_symbol = "…/" + +# Here is how you can shorten some long paths by text replacement +# similar to mapped_locations in Oh My Posh: +[directory.substitutions] +"Documents" = " " +"Downloads" = " " +"Music" = " " +"Pictures" = " " +# Keep in mind that the order matters. For example: +# "Important Documents" = "  " +# will not be replaced, because "Documents" was already substituted before. +# So either put "Important Documents" before "Documents" or use the substituted version: +# "Important  " = "  " + +[c] +symbol = " " +style = "bg:#86BBD8" +format = '[ $symbol ($version) ]($style)' + +[container] + +[custom] + +[docker_context] +symbol = " " +style = "bg:#06969A" +format = '[ $symbol $context ]($style) $path' + +[deno] + +[git_branch] +symbol = "" +style = "bg:#FCA17D" +format = '[ $symbol $branch ]($style)' + +[git_status] +style = "bg:#FCA17D" +format = '[$all_status$ahead_behind ]($style)' + +[golang] +symbol = " " +style = "bg:#86BBD8" +format = '[ $symbol ($version) ]($style)' + +[haskell] +symbol = " " +style = "bg:#86BBD8" +format = '[ $symbol ($version) ]($style)' + +[nix_shell] +format = '[$symbol$state]($style) ' +symbol = " " +pure_msg = "λ" +impure_msg = "⎔" + +[nodejs] +symbol = "" +style = "bg:#86BBD8" +format = '[ $symbol ($version) ]($style)' + +[php] +symbol = " " + +[python] +symbol = " " + +[ruby] +symbol = " " + +[rust] +symbol = "" +style = "bg:#86BBD8" +format = '[ $symbol ($version) ]($style)' + +[terraform] + +[time] +disabled = false +time_format = "%R" # Hour:Minute Format +style = "bg:#33658A" +format = '[ ♥ $time ]($style)' diff --git a/modules/terminal-life/starship.toml.nix b/modules/terminal-life/starship.toml.nix new file mode 100644 index 0000000..ab6dfa7 --- /dev/null +++ b/modules/terminal-life/starship.toml.nix @@ -0,0 +1,159 @@ +{ + format = "$directory($git_branch$git_commit$git_state$git_status)($c$deno$golang$haskell$nix_shell$nodejs$php$python$ruby$rust$terraform[](fg:#86BBD8 bg:#06969A))($docker_context[](fg:#06969A))($container)$fill(\${custom.triton})[ ](fg:#F85E84)$line_break$character"; + + # Disable the blank line at the start of the prompt + add_newline = false; + + # You can also replace your username with a neat symbol like  to save some space + #username = { + # show_always = true; + # style_user = "bg:#9A348E"; + # style_root = "bg:#9A348E"; + # format = ''[$user ]($style)''; + #}; + character = { + success_symbol = "[❯](bold purple)"; + error_symbol = "[✗](#ff4b00)"; + vicmd_symbol = "[❮](bold purple)"; + }; + + fill = { + symbol = "-"; + style = "bold green"; + }; + + directory = { + style = "#F85E84"; + truncate_to_repo = false; + fish_style_pwd_dir_length = 1; + truncation_symbol = "…/"; + format = "[](fg:black bg:#F85E84)[$path[$read_only](bg:$style fg:black)](bg:$style fg:black)[](fg:$style)"; + read_only = " "; + }; + + # Here is how you can shorten some long paths by text replacement + # similar to mapped_locations in Oh My Posh: + directory.substitutions = { + "Documents" = " "; + "Downloads" = " "; + "Music" = " "; + "Pictures" = " "; + }; + # Keep in mind that the order matters. For example: + # "Important Documents" = "  " + # will not be replaced, because "Documents" was already substituted before. + # So either put "Important Documents" before "Documents" or use the substituted version: + # "Important  " = "  " + + c = { + symbol = " "; + style = "bg:#86BBD8"; + format = ''[ $symbol ($version) ]($style)''; + }; + + #container = {}; + + custom = { + triton = { + command = "echo $TRITON_PROFILE"; + when = "test $TRITON_PROFILE"; + format = "[✚ ](fg:#F85E84 bg:#1A181A)[$output](fg:#F85E84 bg:#1A181A)"; + description = "The current triton profile"; + }; + }; + + docker_context = { + symbol = " "; + style = "bg:#06969A"; + format = ''[ $symbol $context ]($style) $path''; + }; + + #deno = {}; + + git_branch = { + style = "#E5C463"; + format = "[](fg:black bg:$style)[ $symbol$branch](fg:black bg:$style)[](fg:$style)"; + }; + + git_commit = { + style = "#E5C463"; + # ^H is the literal backspace character which renders to \b in the final + # starship config TOML, produced in insert mode via ctrl+v then ctrl+h. + # We use the literal character, because escaping a single \ doesn't work + # with pkgs.formats.toml, see: https://github.com/NixOS/nixpkgs/issues/97310 and + # https://jdhao.github.io/2020/10/07/nvim_insert_unicode_char/ + format = "[ ](bg:$style)[\\($hash$tag\\)](fg:black bg:$style)[](fg:$style)"; + }; + + git_state = { + style = "#E5C463"; + format = "[ ](bg:$style)[ \\($state( $progress_current/$progress_total)\\)](fg:black bg:$style)[](fg:$style)"; + }; + + git_status = { + style = "#E5C463"; + format = "([ ](bg:$style fg:black)$conflicted$staged$modified$renamed$deleted$untracked$stashed$ahead_behind[](fg:$style))"; + conflicted = "[ ](bold fg:88 bg:#E5C463)[  \${count} ](fg:black bg:#E5C463)"; + staged = "[ $count ](fg:black bg:#E5C463)"; + modified = "[ \${count} ](fg:black bg:#E5C463)"; + renamed = "[ \${count} ](fg:black bg:#E5C463)"; + deleted = "[ \${count} ](fg:black bg:#E5C463)"; + untracked = "[?\${count} ](fg:black bg:#E5C463)"; + stashed = "[ \${count} ](fg:black bg:#E5C463)"; + ahead = "[ \${count} ](fg:#523333 bg:#E5C463)"; + behind = "[ \${count} ](fg:black bg:#E5C463)"; + diverged = "[ ](fg:88 bg:#E5C463)[ נּ ](fg:black bg:#E5C463)[ \${ahead_count} ](fg:black bg:#E5C463)[ \${behind_count} ](fg:black bg:#E5C463)"; + }; + + golang = { + symbol = " "; + style = "bg:#86BBD8"; + format = ''[ $symbol ($version) ]($style)''; + }; + + haskell = { + symbol = " "; + style = "bg:#86BBD8"; + format = ''[ $symbol ($version) ]($style)''; + }; + + nix_shell = { + format = ''[$symbol$state]($style) ''; + symbol = " "; + pure_msg = "λ"; + impure_msg = "⎔"; + }; + + nodejs = { + symbol = ""; + style = "bg:#86BBD8"; + format = ''[ $symbol ($version) ]($style)''; + }; + + php = { + symbol = " "; + }; + + python = { + symbol = " "; + }; + + ruby = { + symbol = " "; + }; + + rust = { + symbol = ""; + style = "bg:#86BBD8"; + format = ''[ $symbol ($version) ]($style)''; + }; + + #terraform = {}; + + time = { + disabled = false; + time_format = "%R"; # Hour:Minute Format + style = "bg:#33658A"; + format = ''[ ♥ $time ]($style)''; + }; +} diff --git a/overlays/blesh.nix b/overlays/blesh.nix new file mode 100644 index 0000000..01874da --- /dev/null +++ b/overlays/blesh.nix @@ -0,0 +1,13 @@ +final: prev: { + blesh = prev.blesh.overrideAttrs (oldAttrs: rec { + version = "unstable-2022-12-15"; + src = prev.fetchFromGitHub { + owner = "akinomyoga"; + repo = "ble.sh"; + rev = "32277dae20f004c3a65aeb3adae881b8b8e0318f"; + hash = "sha256-qh5z0rkDOKhgi4/LQX2WHShzqwlOUpe+CuJArEmuKMo="; + fetchSubmodules = true; + leaveDotGit = true; + }; + }); +} diff --git a/pkgs/sway-launcher.nix b/pkgs/sway-launcher.nix index aed2cd1..1ace27b 100644 --- a/pkgs/sway-launcher.nix +++ b/pkgs/sway-launcher.nix @@ -1,7 +1,6 @@ self: with self; '' - #!/usr/bin/env zsh - # terminal application launcher for sway, using fzf + #!/usr/bin/env bash # original command: # Based on: https://github.com/swaywm/sway/issues/1367 # bindsym $altkey+space exec termite --name=launcher -e \ diff --git a/profiles/base-user/default.nix b/profiles/base-user/default.nix index 92e297d..a2c82d9 100644 --- a/profiles/base-user/default.nix +++ b/profiles/base-user/default.nix @@ -31,7 +31,6 @@ in { if psCfg.user.password != null then psCfg.user.password else ""; - shell = pkgs.zsh; openssh.authorizedKeys.keys = if psCfg.user.publicKeys != null then psCfg.user.publicKeys diff --git a/profiles/base-user/home.nix b/profiles/base-user/home.nix index 9c96451..3d801ba 100644 --- a/profiles/base-user/home.nix +++ b/profiles/base-user/home.nix @@ -26,7 +26,6 @@ in { fonts.fontconfig.enable = mkForce true; programs.dircolors.enable = true; - programs.dircolors.enableZshIntegration = true; home.file."xinitrc".source = ./.xinitrc; From a50ae3df100f2707bd4ea794a3451ff9407a7542 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Thu, 2 Feb 2023 17:28:43 +0100 Subject: [PATCH 2/6] bash: ble.sh tweaks and starship ricing --- modules/terminal-life/bash/default.nix | 11 ++++++++++- modules/terminal-life/starship.toml.nix | 19 +++++++++++-------- overlays/blesh.nix | 6 +++--- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/modules/terminal-life/bash/default.nix b/modules/terminal-life/bash/default.nix index 05ea4ec..3be672a 100644 --- a/modules/terminal-life/bash/default.nix +++ b/modules/terminal-life/bash/default.nix @@ -30,7 +30,6 @@ in { # Syntax highlighting, auto suggestions, vim modes, etc. # https://github.com/akinomyoga/ble.sh/wiki/Manual-A1-Installation#user-content-nixpkgs source "$(blesh-share)" --attach=none - [[ ''${BLE_VERSION-} ]] && ble-attach # ctrl + space to accept autocomplete suggestion ble-bind -m 'auto_complete' -f 'C-@' 'auto_complete/insert-on-end' # Meta (Alt) + Backspace to delete a word @@ -46,9 +45,19 @@ in { ble-bind -f down 'history-search-forward hide-status:immediate-accept:empty=emulate-readline:point=end' ble-bind -f C-n 'history-search-forward hide-status:immediate-accept:empty=emulate-readline:point=end' + function my/complete-load-hook { + bleopt complete_auto_delay=300 + } + blehook/eval-after-load complete my/complete-load-hook + + bleopt exec_errexit_mark= + bleopt history_share=1 bleopt filename_ls_colors="$LS_COLORS" source ${config.age.secrets.environment-secrets.path} + + # end of .bashrc + [[ ''${BLE_VERSION-} ]] && ble-attach ''; shellAliases = { diff --git a/modules/terminal-life/starship.toml.nix b/modules/terminal-life/starship.toml.nix index ab6dfa7..0fd21ad 100644 --- a/modules/terminal-life/starship.toml.nix +++ b/modules/terminal-life/starship.toml.nix @@ -1,5 +1,5 @@ { - format = "$directory($git_branch$git_commit$git_state$git_status)($c$deno$golang$haskell$nix_shell$nodejs$php$python$ruby$rust$terraform[](fg:#86BBD8 bg:#06969A))($docker_context[](fg:#06969A))($container)$fill(\${custom.triton})[ ](fg:#F85E84)$line_break$character"; + format = "$directory($git_branch$git_commit$git_state$git_status)($c$deno$golang$haskell$nodejs$php$python$ruby$rust$terraform[](fg:#86BBD8 bg:#06969A))($docker_context[](fg:#06969A))($container)$fill(\${custom.triton})$nix_shell$status[ |](fg:#F85E84)$line_break$character"; # Disable the blank line at the start of the prompt add_newline = false; @@ -13,13 +13,18 @@ #}; character = { success_symbol = "[❯](bold purple)"; - error_symbol = "[✗](#ff4b00)"; - vicmd_symbol = "[❮](bold purple)"; + error_symbol = "[✗](#FF4B00)"; + }; + + status = { + disabled = false; + style = "#FF4B00"; }; fill = { symbol = "-"; - style = "bold green"; + #style = "bold green"; + style = "black"; }; directory = { @@ -118,10 +123,8 @@ }; nix_shell = { - format = ''[$symbol$state]($style) ''; - symbol = " "; - pure_msg = "λ"; - impure_msg = "⎔"; + format = ''[$symbol]($style) ''; + symbol = " "; }; nodejs = { diff --git a/overlays/blesh.nix b/overlays/blesh.nix index 01874da..72fd6bc 100644 --- a/overlays/blesh.nix +++ b/overlays/blesh.nix @@ -1,11 +1,11 @@ final: prev: { blesh = prev.blesh.overrideAttrs (oldAttrs: rec { - version = "unstable-2022-12-15"; + version = "unstable-2023-02-01"; src = prev.fetchFromGitHub { owner = "akinomyoga"; repo = "ble.sh"; - rev = "32277dae20f004c3a65aeb3adae881b8b8e0318f"; - hash = "sha256-qh5z0rkDOKhgi4/LQX2WHShzqwlOUpe+CuJArEmuKMo="; + rev = "0ceb0cb38157c2c37650ffb069098783338eb02c"; + hash = "sha256-f3w3gHKysRafBGcZbCPUvy9e/fOrQc9TBZAjb0ioxpo="; fetchSubmodules = true; leaveDotGit = true; }; From 35c276bb495e7d7c996a0fea34d5ced3bb1b768d Mon Sep 17 00:00:00 2001 From: teutat3s Date: Thu, 2 Feb 2023 17:46:00 +0100 Subject: [PATCH 3/6] bash: clean up unneeded starship.toml --- modules/terminal-life/starship.toml | 128 ---------------------------- 1 file changed, 128 deletions(-) delete mode 100644 modules/terminal-life/starship.toml diff --git a/modules/terminal-life/starship.toml b/modules/terminal-life/starship.toml deleted file mode 100644 index 1ef9ab7..0000000 --- a/modules/terminal-life/starship.toml +++ /dev/null @@ -1,128 +0,0 @@ -format = """ -[](#9A348E)\ -$character \ -[](bg:#DA627D fg:#9A348E)\ -$directory\ -[](fg:#DA627D bg:#FCA17D)\ -$git_branch\ -$git_status\ -[](fg:#FCA17D bg:#86BBD8)\ -$c\ -$deno\ -$golang\ -$haskell\ -$nix_shell\ -$nodejs\ -$php\ -$python\ -$ruby\ -$rust\ -$terraform\ -[](fg:#86BBD8 bg:#06969A)\ -$docker_context\ -[](fg:#06969A bg:#33658A)\ -$container \ -[](fg:#06969A bg:#33658A)\ -$time\ -[ ](fg:#33658A)\ -""" - -# Disable the blank line at the start of the prompt -# add_newline = false - -# You can also replace your username with a neat symbol like  to save some space -#[username] -#show_always = true -#style_user = "bg:#9A348E" -#style_root = "bg:#9A348E" -#format = '[$user ]($style)' -[character] -success_symbol = "[❯](bold purple)" -vicmd_symbol = "[❮](bold purple)" - -[directory] -style = "bg:#DA627D" -format = "[ $path ]($style)" -truncation_length = 3 -truncation_symbol = "…/" - -# Here is how you can shorten some long paths by text replacement -# similar to mapped_locations in Oh My Posh: -[directory.substitutions] -"Documents" = " " -"Downloads" = " " -"Music" = " " -"Pictures" = " " -# Keep in mind that the order matters. For example: -# "Important Documents" = "  " -# will not be replaced, because "Documents" was already substituted before. -# So either put "Important Documents" before "Documents" or use the substituted version: -# "Important  " = "  " - -[c] -symbol = " " -style = "bg:#86BBD8" -format = '[ $symbol ($version) ]($style)' - -[container] - -[custom] - -[docker_context] -symbol = " " -style = "bg:#06969A" -format = '[ $symbol $context ]($style) $path' - -[deno] - -[git_branch] -symbol = "" -style = "bg:#FCA17D" -format = '[ $symbol $branch ]($style)' - -[git_status] -style = "bg:#FCA17D" -format = '[$all_status$ahead_behind ]($style)' - -[golang] -symbol = " " -style = "bg:#86BBD8" -format = '[ $symbol ($version) ]($style)' - -[haskell] -symbol = " " -style = "bg:#86BBD8" -format = '[ $symbol ($version) ]($style)' - -[nix_shell] -format = '[$symbol$state]($style) ' -symbol = " " -pure_msg = "λ" -impure_msg = "⎔" - -[nodejs] -symbol = "" -style = "bg:#86BBD8" -format = '[ $symbol ($version) ]($style)' - -[php] -symbol = " " - -[python] -symbol = " " - -[ruby] -symbol = " " - -[rust] -symbol = "" -style = "bg:#86BBD8" -format = '[ $symbol ($version) ]($style)' - -[terraform] - -[time] -disabled = false -time_format = "%R" # Hour:Minute Format -style = "bg:#33658A" -format = '[ ♥ $time ]($style)' From c5c6f1b098649cd157a4ceba4efabfaef48dbc9d Mon Sep 17 00:00:00 2001 From: teutat3s Date: Thu, 2 Feb 2023 17:50:23 +0100 Subject: [PATCH 4/6] bash: agenix secret only exists in teutat3s branch --- modules/terminal-life/bash/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/terminal-life/bash/default.nix b/modules/terminal-life/bash/default.nix index 3be672a..c35763c 100644 --- a/modules/terminal-life/bash/default.nix +++ b/modules/terminal-life/bash/default.nix @@ -54,8 +54,6 @@ in { bleopt history_share=1 bleopt filename_ls_colors="$LS_COLORS" - source ${config.age.secrets.environment-secrets.path} - # end of .bashrc [[ ''${BLE_VERSION-} ]] && ble-attach ''; From fb01e684a8b113c0567b4c2bc3ce3e99cac941d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Fri, 3 Feb 2023 01:31:34 +0100 Subject: [PATCH 5/6] Working bash system --- profiles/base-user/default.nix | 1 + users/ben/home.nix | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/profiles/base-user/default.nix b/profiles/base-user/default.nix index a2c82d9..9d07011 100644 --- a/profiles/base-user/default.nix +++ b/profiles/base-user/default.nix @@ -27,6 +27,7 @@ in { "lp" "scanner" ]; + shell = pkgs.bash; initialHashedPassword = if psCfg.user.password != null then psCfg.user.password diff --git a/users/ben/home.nix b/users/ben/home.nix index 4a50273..ef87279 100644 --- a/users/ben/home.nix +++ b/users/ben/home.nix @@ -107,9 +107,10 @@ in { xdg.configFile."msmtp/config".source = ./.config/msmtp/config; # xdg.configFile."wallpaper.jpg".source = ./assets/wallpaper.jpg; - programs.zsh = { - initExtra = import ./zshrc.nix {inherit config;}; - }; + # + # programs.zsh = { + # initExtra = import ./zshrc.nix {inherit config;}; + # }; }; age.secrets."mopidy.conf" = { From 5da339191daae0c2c13bcee237c64aa09be30b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Tue, 7 Feb 2023 13:14:30 +0100 Subject: [PATCH 6/6] Add changed vi keybindings --- modules/terminal-life/bash/default.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/terminal-life/bash/default.nix b/modules/terminal-life/bash/default.nix index c35763c..59552d4 100644 --- a/modules/terminal-life/bash/default.nix +++ b/modules/terminal-life/bash/default.nix @@ -54,6 +54,23 @@ in { bleopt history_share=1 bleopt filename_ls_colors="$LS_COLORS" + # Bash vim mode keybindings + if [[ $- == *i* ]]; then # in interactive session + set -o vi + + ble-bind -m vi_imap -f 'ENTER' 'vi_imap/complete' + ble-bind -m vi_imap -f 'TAB' 'vi_imap/complete' + + ble-bind -m vi_imap -f 'j j' 'vi_imap/normal-mode' + ble-bind -m vi_imap -f 'ESC' 'vi_imap/normal-mode' + + ble-bind -m vi_nmap -f 'h' 'vi_nmap/insert-mode' + ble-bind -m vi_nmap -f 'i' 'vi-command/backward-line' + ble-bind -m vi_nmap -f 'j' 'vi-command/backward-char' + ble-bind -m vi_nmap -f 'k' 'vi-command/forward-line' + ble-bind -m vi_nmap -f 'l' 'vi-command/forward-char' + fi + # end of .bashrc [[ ''${BLE_VERSION-} ]] && ble-attach '';