diff --git a/_sources/generated.nix b/_sources/generated.nix index 6a9c54b..e819b0e 100644 --- a/_sources/generated.nix +++ b/_sources/generated.nix @@ -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"; diff --git a/nvfetcher.toml b/nvfetcher.toml index 8f2f2d8..965a836 100644 --- a/nvfetcher.toml +++ b/nvfetcher.toml @@ -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" diff --git a/pkgs/shells/bash/bash-prompt/default.nix b/pkgs/shells/bash/bash-prompt/default.nix index adc5a6e..3c75a36 100644 --- a/pkgs/shells/bash/bash-prompt/default.nix +++ b/pkgs/shells/bash/bash-prompt/default.nix @@ -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; @@ -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; { diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..f81f29f --- /dev/null +++ b/shell.nix @@ -0,0 +1,9 @@ +{ pkgs ? import { } }: + +with pkgs; +mkShell { + name = "nur-packages"; + buildInputs = [ + nvfetcher + ]; +}