Skip to content

Commit

Permalink
🔖 Bump bash-prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
Freed-Wu committed Dec 21, 2024
1 parent b57a675 commit 928c44b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 11 deletions.
11 changes: 11 additions & 0 deletions _sources/generated.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@
sha256 = "sha256-2akB42TCpcrQQAHSKP5yRJUjRm0lN8DR70Uw/B4m/9M=";
};
};
bash-prompt = {
pname = "bash-prompt";
version = "0.0.1";
src = fetchFromGitHub {
owner = "Freed-Wu";
repo = "bash-prompt";
rev = "0.0.1";
fetchSubmodules = false;
sha256 = "sha256-64KFbS63jyPhl4z0tsS+7vg6b2XrL2uIzhzWtOepu5k=";
};
};
expect-language-server = {
pname = "expect-language-server";
version = "0.0.1";
Expand Down
4 changes: 4 additions & 0 deletions nvfetcher.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,7 @@ fetch.pypi = "mulimgviewer"
[pyrime]
src.pypi = "pyrime"
fetch.pypi = "pyrime"

[bash-prompt]
src.github_tag = "Freed-Wu/bash-prompt"
fetch.github = "Freed-Wu/bash-prompt"
25 changes: 14 additions & 11 deletions pkgs/shells/bash/bash-prompt/default.nix
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
{
mySources,
lib,
stdenvNoCC,
zsh-powerlevel10k,
fetchFromGitHub,
wakatime,
procps,
git,
ncurses
}:
stdenvNoCC.mkDerivation rec {
name = "bash-prompt";
src = fetchFromGitHub {
owner = "Freed-Wu";
repo = name;
rev = "f6d81a940afb00fc19fa0c87b6ce2bfe623aabb8";
hash = "sha256-Yu+eeDBbTkp3bPXKlGGz3K/PbZCsGRgd9XEUUvkggTU=";
};
stdenvNoCC.mkDerivation {
inherit (mySources.bash-prompt) pname version src;

dontConfigure = true;
dontBuild = true;
Expand All @@ -26,8 +23,14 @@ stdenvNoCC.mkDerivation rec {
install -Dm644 prompt.sh -t $out/share/bash-prompt
'';
fixupPhase = ''
sed -i '1,15d' $out/share/bash-prompt/prompt.sh
sed -i '1i. ${zsh-powerlevel10k.out}/share/zsh-powerlevel10k/gitstatus/gitstatus.prompt.sh' $out/share/bash-prompt/prompt.sh
sed -i -e'1,15d' \
-e'16i. ${zsh-powerlevel10k}/share/zsh-powerlevel10k/gitstatus/gitstatus.prompt.sh' \
-e's/has_cmd \S\+ && //' \
-e's|\\wakatime|${wakatime}/bin/wakatime-cli|g' \
-e's|\\ps|${procps}/bin/ps|g' \
-e's|\\git|${git}/bin/git|g' \
-e's|\\tput|${ncurses}/bin/tput|g' \
$out/share/bash-prompt/prompt.sh
'';

meta = with lib; {
Expand Down
9 changes: 9 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{ pkgs ? import <nixpkgs> { } }:

with pkgs;
mkShell {
name = "nur-packages";
buildInputs = [
nvfetcher
];
}

0 comments on commit 928c44b

Please sign in to comment.