starship: enable
authorJulien Moutinho <julm+julm-nix@sourcephile.fr>
Fri, 31 May 2024 00:41:48 +0000 (02:41 +0200)
committerJulien Moutinho <julm+julm-nix@sourcephile.fr>
Sat, 1 Jun 2024 20:29:46 +0000 (22:29 +0200)
home-manager/profiles/emacs.nix
home-manager/profiles/starship.nix [new file with mode: 0644]
home-manager/profiles/urxvt.nix
homes/julm/hosts/aubergine.nix
homes/julm/hosts/carotte.nix
homes/julm/hosts/losurdo.nix
homes/julm/hosts/mermet.nix
homes/julm/hosts/oignon.nix

index 3eee19f6bee04221338baae9296ef74a5504a509..5ed867fada9023ac1150270c017c3568d6b272d3 100644 (file)
     sqlite
     #editorconfig-core-c
     #emacs-all-the-icons-fonts
-    (nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; })
+    (nerdfonts.override {
+      fonts = [
+        "NerdFontsSymbolsOnly"
+      ];
+    })
   ];
   home.sessionPath = [ "${config.xdg.configHome}/emacs/bin" ];
   home.sessionVariables = {
diff --git a/home-manager/profiles/starship.nix b/home-manager/profiles/starship.nix
new file mode 100644 (file)
index 0000000..21fc830
--- /dev/null
@@ -0,0 +1,332 @@
+{ pkgs, lib, config, ... }:
+{
+  programs.starship = {
+    enable = true;
+    enableBashIntegration = config.programs.bash.enable;
+    # DOC: https://starship.rs/config/
+    settings = {
+      add_newline = false;
+      command_timeout = 100;
+      continuation_prompt = "[↳](bright-black) ";
+      format = "$username$hostname$localip$shlvl$git_branch$git_commit$git_state$git_metrics$git_status$c$container$ocaml$purescript$nix_shell$haskell$memory_usage$sudo$cmd_duration$time$line_break$jobs$battery$directory$status$character";
+      right_format = "";
+      scan_timeout = 30;
+
+      battery = {
+        format = "[$symbol$percentage]($style) ";
+        charging_symbol = " ";
+        discharging_symbol = " ";
+        empty_symbol = " ";
+        full_symbol = " ";
+        unknown_symbol = " ";
+        disabled = false;
+        display = [
+          {
+            style = "red bold";
+            threshold = 50;
+          }
+        ];
+      };
+      character = {
+        format = "$symbol ";
+        vicmd_symbol = "[❮](bold green)";
+        disabled = false;
+        success_symbol = "[➜](bold green)";
+        error_symbol = "[✗](bold red)";
+      };
+      cmd_duration = {
+        min_time = 2000;
+        format = "[($duration )]($style)";
+        style = "bright-black bold";
+        show_milliseconds = false;
+        disabled = false;
+        show_notifications = false;
+        min_time_to_notify = 45000;
+      };
+      container = {
+        format = "[$symbol [$name]]($style) ";
+        symbol = "⬢";
+        style = "red bold dimmed";
+        disabled = false;
+      };
+      directory = {
+        disabled = false;
+        fish_style_pwd_dir_length = 0;
+        format = "[$path]($style)[$read_only]($read_only_style) ";
+        home_symbol = "~";
+        #before_repo_root_style = "bold gray";
+        #repo_root_style = "bold cyan";
+        read_only = " RO";
+        #read_only_style = "orange";
+        #repo_root_format = "[$before_root_path]($style)[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style) ";
+        style = "bold green";
+        truncate_to_repo = true;
+        truncation_length = 3;
+        truncation_symbol = "…/";
+        use_logical_path = true;
+        use_os_path_sep = true;
+      };
+      directory.substitutions = {
+        ## Here is how you can shorten some long paths by text replacement;
+        ## similar to mapped_locations in Oh My Posh:;
+        #"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  " = "  ";
+        #"Important " = " ";
+      };
+      env_var = { };
+      env_var.SHELL = {
+        format = "[$symbol($env_value )]($style)";
+        style = "bright-black bold italic dimmed";
+        symbol = "e:";
+        disabled = true;
+        variable = "SHELL";
+        default = "unknown shell";
+      };
+      env_var.USER = {
+        format = "[$symbol($env_value )]($style)";
+        style = "bright-black bold italic dimmed";
+        symbol = "e:";
+        disabled = true;
+        default = "unknown user";
+      };
+      fill = {
+        style = "bold black";
+        symbol = " ";
+        disabled = false;
+      };
+      git_branch = {
+        format = "[$symbol$branch(:$remote_branch)]($style) ";
+        symbol = " ";
+        style = "bold purple bg:0xFCA17D";
+        truncation_length = 9223372036854775807;
+        truncation_symbol = "…";
+        only_attached = false;
+        always_show_remote = false;
+        ignore_branches = [ ];
+        disabled = false;
+      };
+      git_commit = {
+        commit_hash_length = 7;
+        format = "[($hash$tag)]($style) ";
+        style = "green bold";
+        only_detached = true;
+        disabled = false;
+        tag_symbol = " 🏷  ";
+        tag_disabled = true;
+      };
+      git_metrics = {
+        added_style = "bold green";
+        deleted_style = "bold red";
+        only_nonzero_diffs = true;
+        format = "([+$added]($added_style) )([-$deleted]($deleted_style) )";
+        disabled = false;
+      };
+      git_state = {
+        am = "AM";
+        am_or_rebase = "AM/REBASE";
+        bisect = "BISECTING";
+        cherry_pick = "🍒PICKING(bold red)";
+        disabled = false;
+        format = "([$state( $progress_current/$progress_total)]($style)) ";
+        merge = "MERGING";
+        rebase = "REBASING";
+        revert = "REVERTING";
+        style = "bold yellow";
+      };
+      git_status = {
+        format = "([$all_status( $ahead_behind)]($style) )";
+        style = "purple bold";
+        ahead = "⇡\${count}";
+        diverged = "⇡\${ahead_count}⇣\${behind_count}";
+        behind = "⇣\${count}";
+        /*
+        ahead = "🏎💨$count";
+        behind = "😰$count";
+        conflicted = "🏳";
+        deleted = "🗑";
+        disabled = false;
+        diverged = "😵";
+        format = "([$all_status$ahead_behind]($style) )";
+        ignore_submodules = false;
+        modified = "📝";
+        renamed = "👅";
+        staged = "[++($count)](green)";
+        stashed = "📦";
+        style = "red bold bg:0xFCA17D";
+        untracked = "🤷";
+        up_to_date = "✓";
+        */
+      };
+      haskell = {
+        format = "[$symbol($version )]($style)";
+        version_format = "v$raw";
+        symbol = "λ ";
+        style = "yellow bold";
+        disabled = false;
+        detect_extensions = [
+          "hs"
+          "lhs"
+          "cabal"
+          "hs-boot"
+        ];
+        detect_files = [
+          "stack.yaml"
+          "cabal.project"
+        ];
+        detect_folders = [ ];
+      };
+      hostname = {
+        disabled = false;
+        format = "[$hostname]($style) ";
+        ssh_only = true;
+        style = "red dimmed bold";
+        trim_at = ".";
+      };
+      jobs = {
+        threshold = 1;
+        symbol_threshold = 1;
+        number_threshold = 1;
+        format = "[$symbol$number]($style) ";
+        symbol = "&";
+        style = "yellow bold";
+        disabled = false;
+      };
+      line_break = {
+        disabled = false;
+      };
+      localip = {
+        disabled = true;
+        format = "[@$localipv4]($style) ";
+        ssh_only = false;
+        style = "yellow bold";
+      };
+      memory_usage = {
+        disabled = true;
+        format = "$symbol[$ram( | $swap)]($style) ";
+        style = "white bold dimmed";
+        symbol = " ";
+        # threshold = 75;
+        threshold = -1;
+      };
+      nix_shell = {
+        format = "[$symbol]($style) ";
+        #format = "[$symbol$state( \\($name\\))]($style)";
+        disabled = false;
+        impure_msg = "";
+        #impure_msg = "[impure](bold red)";
+        pure_msg = "[pure](bold green)";
+        style = "bold blue";
+        symbol = "❄️";
+        #heuristic = true;
+      };
+      ocaml = {
+        format = "[$symbol($version )(($switch_indicator$switch_name) )]($style)";
+        global_switch_indicator = "";
+        local_switch_indicator = "*";
+        style = "bold yellow";
+        symbol = "🐫 ";
+        version_format = "v$raw";
+        disabled = true;
+        detect_extensions = [
+          "opam"
+          "ml"
+          "mli"
+          "re"
+          "rei"
+        ];
+        detect_files = [
+          "dune"
+          "dune-project"
+          "jbuild"
+          "jbuild-ignore"
+          ".merlin"
+        ];
+        detect_folders = [
+          "_opam"
+          "esy.lock"
+        ];
+      };
+      purescript = {
+        format = "[$symbol($version )]($style)";
+        version_format = "v$raw";
+        symbol = "<=> ";
+        style = "bold white";
+        disabled = true;
+        detect_extensions = [ "purs" ];
+        detect_files = [ "spago.dhall" ];
+        detect_folders = [ ];
+      };
+      rlang = {
+        format = "[$symbol($version )]($style)";
+        version_format = "v$raw";
+        style = "blue bold";
+        symbol = "📐 ";
+        disabled = true;
+        detect_extensions = [
+          "R"
+          "Rd"
+          "Rmd"
+          "Rproj"
+          "Rsx"
+        ];
+        detect_files = [ ".Rprofile" ];
+        detect_folders = [ ".Rproj.user" ];
+      };
+      shlvl = {
+        threshold = 2;
+        format = "[$symbol$shlvl]($style) ";
+        symbol = "↕️  ";
+        repeat = false;
+        style = "bold yellow";
+        disabled = true;
+      };
+      status = {
+        format = "[$symbol$status]($style) ";
+        map_symbol = true;
+        not_executable_symbol = "🚫";
+        not_found_symbol = "🔍";
+        pipestatus = false;
+        pipestatus_format = "[$pipestatus] => [$symbol$common_meaning$signal_name$maybe_int]($style)";
+        pipestatus_separator = "|";
+        recognize_signal_code = true;
+        signal_symbol = "⚡";
+        style = "bold red bg:blue";
+        success_symbol = "🟢 SUCCESS";
+        symbol = "🔴 ";
+        disabled = true;
+      };
+      sudo = {
+        format = "[as $symbol]($style)";
+        symbol = "🧙 ";
+        style = "bold blue";
+        allow_windows = false;
+        disabled = true;
+      };
+      time = {
+        format = "[\\[$time\\]]($style)";
+        style = "bright-black bold";
+        use_12hr = false;
+        disabled = false;
+        utc_time_offset = "local";
+        # time_format = "%R"; # Hour:Minute Format;
+        time_format = "%T"; # Hour:Minute:Seconds Format;
+        time_range = "-";
+      };
+      username = {
+        format = "[$user]($style) ";
+        show_always = true;
+        style_root = "red bold bg:0x9A348E";
+        style_user = "bright-black bold bg:0x9A348E";
+        disabled = false;
+      };
+      custom = { };
+    };
+  };
+}
index 1ced417aab933ada4f50958ac615a65e5b3b2332..439c2a32a8495335c5aaf4f65ccab0cffe949caa 100644 (file)
@@ -1,7 +1,13 @@
 { pkgs, ... }:
 {
   home.packages = [
-    pkgs.rxvt-unicode-emoji
+    pkgs.rxvt-unicode
+    (pkgs.nerdfonts.override {
+      fonts = [
+        #"DejaVuSansMono"
+        "NerdFontsSymbolsOnly"
+      ];
+    })
   ];
   systemd.user.services.urxvt = {
     Unit = {
@@ -10,7 +16,7 @@
       PartOf = [ "graphical-session.target" ];
     };
     Service = {
-      ExecStart = "${pkgs.rxvt-unicode-emoji}/bin/urxvtd -q -o";
+      ExecStart = "${pkgs.rxvt-unicode}/bin/urxvtd -q -o";
       Restart = "always";
     };
     Install = { WantedBy = [ "graphical-session.target" ]; };
@@ -22,9 +28,9 @@
     "URxvt*cursorColor" = "#00B10B";
     "URxvt*cursorColor2" = "black";
     "URxvt*cutchars" = ''"()*,;<>[]{}|│`\"'#:、。"'';
-    "URxvt*depth" = "32";
+    "URxvt*depth" = "33";
     "URxvt*fading" = "0";
-    "URxvt*font" = "xft:DejaVu Sans Mono:size=6";
+    "URxvt*font" = "xft:DejaVu Sans Mono:size=6,xft:,xft:SymbolsNerdFont-Regular:size=6";
     "URxvt*font-size.step" = "1";
     "URxvt*foreground" = "white";
     "URxvt*geometry" = "61x20";
index 3fc40cfe759ed4a7c080d9fd814cbb1ac4682b18..663702f15e28441edb557da722209f058cd333f4 100644 (file)
@@ -11,5 +11,7 @@
     ../../../home-manager/profiles/networking.nix
     ../../../home-manager/profiles/nix.nix
     #../../../home-manager/profiles/vim.nix
+
+    ../../../home-manager/profiles/starship.nix
   ];
 }
index 6d25376881b69d65fcb3af5586704f79a67682b6..6d4077f40e7578fa6a7c16229eb32c87a034a84d 100644 (file)
@@ -3,6 +3,7 @@
   imports = [
     #../../../home-manager/profiles/graphical.nix
     #../../../home-manager/profiles/networking.nix
+    #../../../home-manager/profiles/starship.nix
   ];
   programs.vim.enable = false;
   # Does not cross-compile:
index 458e05ae38f01422712d4b35ccbd69cb5e46f94a..69c0abf34dacfbf93cb7d7b80664dbffd280e8b7 100644 (file)
@@ -17,6 +17,7 @@
     ../../../home-manager/profiles/yt-dlp.nix
 
     ../../../home-manager/profiles/firefox.nix
+    ../../../home-manager/profiles/starship.nix
     ../../../home-manager/profiles/xmonad.nix
   ];
   services.gpg-agent.pinentryPackage = lib.mkForce pkgs.pinentry-curses;
index e3adfe97e4e4f2d44796995ab18a5093a2d7419a..e489debd3947a405662be09e7ad73d12691a0c75 100644 (file)
@@ -7,5 +7,6 @@
     ../../../home-manager/profiles/mutt.nix
     ../../../home-manager/profiles/networking.nix
     ../../../home-manager/profiles/vim.nix
+    ../../../home-manager/profiles/starship.nix
   ];
 }
index d4f807b69c0cc9017607bd8fa2215d5e5d857489..5750dc0f4a4cc42c8c32f833e7aa99262e93aa6d 100644 (file)
@@ -22,8 +22,9 @@
 
     ../../../home-manager/profiles/emacs.nix
     ../../../home-manager/profiles/firefox.nix
-    ../../../home-manager/profiles/xmonad.nix
     ../../../home-manager/profiles/ghc.nix
+    ../../../home-manager/profiles/starship.nix
+    ../../../home-manager/profiles/xmonad.nix
 
     ../mails.nix
   ];