zsh/starship: Remove custom patch

Upstream added a patch that should avoid situations in which my patch
was needed.
This commit is contained in:
Simon Bruder 2022-12-10 14:48:04 +01:00
parent 81e22d4eba
commit f32e2a5842
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC
2 changed files with 0 additions and 74 deletions

View file

@ -1,52 +0,0 @@
From 3ded2fd2f67357b986821a36d815853b16c19411 Mon Sep 17 00:00:00 2001
From: Simon Bruder <simon@sbruder.de>
Date: Tue, 9 Aug 2022 00:55:55 +0200
Subject: [PATCH] feat(directory): allow disabling repo integration
If the directory is a network mount, this can be slowing starship down
which makes the shell feel unresponsive.
---
src/configs/directory.rs | 2 ++
src/modules/directory.rs | 6 +++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/configs/directory.rs b/src/configs/directory.rs
index 32c72fb6..fce3fd76 100644
--- a/src/configs/directory.rs
+++ b/src/configs/directory.rs
@@ -21,6 +21,7 @@ pub struct DirectoryConfig<'a> {
pub truncation_symbol: &'a str,
pub home_symbol: &'a str,
pub use_os_path_sep: bool,
+ pub disable_repo: bool,
}
impl<'a> Default for DirectoryConfig<'a> {
@@ -41,6 +42,7 @@ impl<'a> Default for DirectoryConfig<'a> {
truncation_symbol: "",
home_symbol: "~",
use_os_path_sep: true,
+ disable_repo: false,
}
}
}
diff --git a/src/modules/directory.rs b/src/modules/directory.rs
index 873dfde9..03c31314 100644
--- a/src/modules/directory.rs
+++ b/src/modules/directory.rs
@@ -51,7 +51,11 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
// Attempt repository path contraction (if we are in a git repository)
// Otherwise use the logical path, automatically contracting
- let repo = context.get_repo().ok();
+ let repo = if config.disable_repo {
+ None
+ } else {
+ context.get_repo().ok()
+ };
let dir_string = if config.truncate_to_repo {
repo.and_then(|r| r.workdir.as_ref())
.filter(|&root| root != &home_dir)
--
2.36.0

View file

@ -55,22 +55,10 @@ in
nix-direnv = {
enable = true;
};
config = {
whitelist = {
exact = [
"${config.home.homeDirectory}/mounts/.envrc"
];
};
};
};
nix-index.enable = true;
starship = {
enable = true;
package = pkgs.starship.overrideAttrs (o: o // {
patches = o.patches ++ [
./0001-feat-directory-allow-disabling-repo-integration.patch
];
});
settings = {
add_newline = false;
};
@ -134,14 +122,4 @@ in
];
};
};
home.file."mounts/.envrc".text = ''
export STARSHIP_CONFIG=${(pkgs.formats.toml { }).generate "starship-config-network" (config.programs.starship.settings // {
directory.disable_repo = true; # custom option, patched (see above)
git_branch.disabled = true;
git_commit.disabled = true;
git_state.disabled = true;
git_status.disabled = true;
})}
'';
}