aboutsummaryrefslogtreecommitdiffstats
path: root/modules/tools/starship/default.nix
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar@proton.me>2026-01-16 00:50:23 +0530
committerArpit Chakladar <arpitchakladar@proton.me>2026-01-16 00:50:23 +0530
commitd214d4acf062417f3d071f427da4d8e96c051bfd (patch)
treeefd15b86239995d93b76f0dc56a3894ab321e998 /modules/tools/starship/default.nix
parent38d8d0e4e427ffaf8eb8419b14a3347a73e3ca76 (diff)
downloadhome-manager-config-d214d4acf062417f3d071f427da4d8e96c051bfd.tar.gz
home-manager-config-d214d4acf062417f3d071f427da4d8e96c051bfd.zip
Using starship for the prompt rather than raw zsh
Diffstat (limited to 'modules/tools/starship/default.nix')
-rw-r--r--modules/tools/starship/default.nix62
1 files changed, 62 insertions, 0 deletions
diff --git a/modules/tools/starship/default.nix b/modules/tools/starship/default.nix
new file mode 100644
index 0000000..f59e762
--- /dev/null
+++ b/modules/tools/starship/default.nix
@@ -0,0 +1,62 @@
+{ config, lib, ... }:
+
+{
+ options.tools.starship = {
+ enable = lib.mkEnableOption "Enables starship.";
+ };
+
+ config = lib.mkIf config.tools.starship.enable {
+ programs.starship = {
+ enable = true;
+ enableZshIntegration = config.tools.zsh.enable;
+ settings =
+ let
+ mkSegment = content: ''[┄\[](red)[${content}]($style)[\]](red)'';
+ in {
+ add_newline = true;# Single line layout
+
+ format = ''
+[╭─\[](red)[$username](bold green)[@](red)[$hostname](bold blue)[\]](red)$directory$git_branch$git_status
+[╰─](red)$status$character
+'';
+
+ character.format = "[>](bold red)";
+
+ username = {
+ style_user = "green";
+ style_root = "red bold";
+ format = "[$user]($style)";
+ show_always = true;
+ };
+
+ hostname = {
+ ssh_only = false;
+ style = "blue";
+ format = "[$hostname]($style)";
+ };
+
+ directory = {
+ style = "purple";
+ truncate_to_repo = false;
+ format = mkSegment "$path";
+ };
+
+ git_branch = {
+ style = "bold yellow";
+ format = mkSegment "$symbol$branch(:$remote_branch)";
+ };
+
+ git_status = {
+ format = mkSegment "$all_status$ahead_behind";
+ style = "cyan";
+ };
+
+ status = {
+ disabled = false;
+ format = ''${mkSegment "$symbol $status"}[┄─](red)'';
+ style = "cyan";
+ };
+ };
+ };
+ };
+}