feat: add starship module that allows 3-nested maps and use my starship patch

This commit is contained in:
oddlama 2023-09-17 21:52:16 +02:00
parent bac1f9e07a
commit 365736b42a
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
3 changed files with 193 additions and 11 deletions

View file

@ -1,6 +1,28 @@
{lib, ...}: {
{
lib,
pkgs,
...
}: {
disabledModules = ["programs/starship.nix"];
imports = [./starship-module.nix];
programs.starship = {
enable = true;
package = let
src = pkgs.fetchFromGitHub {
owner = "oddlama";
repo = "starship";
rev = "feat-more-dynamic-username-and-hostname";
hash = "sha256-me6GC1NTSEfdTdSbhwbmwMlzIhSmcs1PSUFCWu+2LG0=";
};
in
pkgs.starship.overrideAttrs (_finalAttrs: previousAttrs: {
inherit src;
cargoDeps = previousAttrs.cargoDeps.overrideAttrs (_: {
inherit src;
outputHash = "sha256-L4N55ghbPsBrESRK0vHGDSDytFCnib7ghoMKnWFIZvw=";
});
});
settings = {
add_newline = false;
format = lib.concatStrings [
@ -21,18 +43,18 @@
"($rust )"
"$time"
];
username = {
format = "[$user]($style)";
style_root = "red";
style_user = "cyan";
show_always = true;
format = "[$user]($style) ";
show_if_root = false;
show_if_ssh = false;
style = "yellow";
};
hostname = {
format = "[$hostname]($style)[$ssh_symbol](green)";
ssh_only = false;
ssh_symbol = "󰣀";
style = "cyan";
ssh_symbol = " 󰣀";
style = "bold purple";
user_overrides.root.style = "bold red";
};
directory = {
format = "[$path]($style)[$read_only]($read_only_style)";