From c11376bc26d2d9ab497ccc77cb0c41729e4c3449 Mon Sep 17 00:00:00 2001 From: Lorenzo Good Date: Wed, 24 Dec 2025 14:35:48 -0600 Subject: [PATCH] Add emacs alias. --- common/#bash.nix# | 109 ++++++++++++++++++++++++++++++++++++++++++++++ common/bash.nix | 1 + 2 files changed, 110 insertions(+) create mode 100644 common/#bash.nix# diff --git a/common/#bash.nix# b/common/#bash.nix# new file mode 100644 index 0000000..a207dd9 --- /dev/null +++ b/common/#bash.nix# @@ -0,0 +1,109 @@ +{lib, ...}: { + programs.bash = { + enable = true; +q + initExtra = '' + source /etc/profile + + export PATH=$PATH:/usr/local/bin:/usr/bin:/bin + ''; + bashrcExtra = '' + export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" + ''; + }; + + home = { + sessionVariables = { + EDITOR = "nvim"; + GOPATH = "$HOME/tmp/go"; + }; + + shellAliases = { + vi = "nvim"; + vim = "nvim"; + tl = "tmux list-sessions"; + ta = "tmux attach"; + rfc_date = "date --rfc-3339='seconds'"; + lg = "lazygit"; + }; + }; + + programs.starship = { + enable = true; + + settings = { + format = lib.concatStrings [ + "[\\[](green)" + "$username" + "[@](blue)" + "$hostname" + ":" + "$directory" + "[$git_branch$git_status](yellow)" + "$nix_shell" + "[\\]\\$](green) " + ]; + + username = { + style_root = "red"; + style_user = "green"; + format = "[$user]($style)"; + show_always = true; + aliases = { + foehammer = "foe"; + }; + }; + + hostname = { + ssh_only = false; + ssh_symbol = "!"; + trim_at = "."; + style = "green"; + format = "[$hostname]($style)[$ssh_symbol](red)"; + }; + + directory = { + truncation_length = 3; + truncate_to_repo = true; + style = "green"; + read_only = "(ro)"; + read_only_style = "red"; + home_symbol = "~"; + use_os_path_sep = true; + + format = "[$path]($style)[$read_only]($read_only_style)"; + }; + + git_branch = { + symbol = ""; + always_show_remote = false; + truncation_symbol = ".."; + ignore_branches = []; + truncation_length = 7; + + format = "\\(g-$branch"; + }; + + nix_shell = { + format = "[\\($symbol$pure_msg$impure_msg\\)]($style)"; + symbol = "n"; + style = "blue"; + impure_msg = " - \\(impure\\)"; + pure_msg = "p"; + }; + + git_status = { + style = "white"; + format = "$ahead_behind$conflicted$modified\\)"; + ahead = ">"; + behind = "<"; + diverged = "%"; + up_to_date = ""; + conflicted = "[!c](red)"; + modified = "*"; + }; + }; + + enableBashIntegration = true; + }; +} diff --git a/common/bash.nix b/common/bash.nix index 96c8f00..6950ec0 100644 --- a/common/bash.nix +++ b/common/bash.nix @@ -19,6 +19,7 @@ }; shellAliases = { + emacs = "emacs -nw"; vi = "nvim"; vim = "nvim"; tl = "tmux list-sessions";