feat(devkit): starship wrapper

This commit is contained in:
Guz
2025-02-12 11:22:27 -03:00
parent a880f24799
commit 179af779f4
3 changed files with 40 additions and 0 deletions

View File

@@ -2,4 +2,5 @@
ghostty = pkgs.callPackage ./ghostty {};
git = pkgs.callPackage ./git {};
lazygit = pkgs.callPackage ./lazygit {};
starship = pkgs.callPackage ./starship {};
}

View File

View File

@@ -0,0 +1,39 @@
{
symlinkJoin,
makeWrapper,
pkgs,
lib,
starship ? pkgs.starship,
}: let
drv = symlinkJoin ({
paths = starship;
nativeBuildInputs = [makeWrapper];
postBuild = ''
wrapProgram $out/bin/starship \
--set-default 'STARSHIP_CONFIG' '${./config.toml}'
'';
}
// {inherit (starship) name pname meta;});
in
pkgs.stdenv.mkDerivation (rec {
name = drv.name;
pname = drv.pname;
buildCommand = let
desktopEntry = pkgs.makeDesktopItem {
name = pname;
desktopName = name;
exec = "${lib.getExe drv}";
terminal = true;
};
in ''
mkdir -p $out/bin
cp ${lib.getExe drv} $out/bin
mkdir -p $out/share/applications
cp ${desktopEntry}/share/applications/${pname}.desktop $out/share/applications/${pname}.desktop
'';
}
// {inherit (starship) meta;})