Skip to content

Commit

Permalink
powershell-editor-services: init at 4.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sharpchen committed Dec 15, 2024
1 parent c1ca89f commit 4ec8229
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions pkgs/by-name/po/powershell-editor-services/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
stdenvNoCC,
fetchzip,
lib,
powershell,
makeWrapper,
bash,
}:
let
owner = "PowerShell";
repo = "PowerShellEditorServices";
in
stdenvNoCC.mkDerivation rec {
pname = "powershell-editor-services";
version = "4.1.0";

src = fetchzip {
name = repo;
url = "https://github.com/${owner}/${repo}/releases/download/v${version}/${repo}.zip";
hash = "sha256-B6RF4RoJB+C5i6puZhfy6FZzyZ9eMo81dd0XsaIEK6Q=";
stripRoot = false;
};

nativeBuildInputs = [ makeWrapper ];

installPhase = ''
mkdir -p $out/{lib,bin}
mv * $out/lib/
cat > $out/bin/powershell-editor-services <<EOF
#! ${bash}/bin/bash -e
exec "${powershell}/bin/pwsh" -noprofile -nologo -c "$out/lib/PowerShellEditorServices/Start-EditorServices.ps1 \$@"
EOF
chmod +x $out/bin/*
'';

postInstall = ''
wrapProgram $out/bin/powershell-editor-services \
--prefix PATH : "$out/bin"
'';

meta = with lib; {
description = "Common platform for PowerShell development support in any editor or application!";
homepage = "https://github.com/PowerShell/PowerShellEditorServices";
changelog = "https://github.com/PowerShell/PowerShellEditorServices/releases/tag/v${version}";
platforms = platforms.unix;
license = licenses.mit;
maintainers = with maintainers; [ sharpchen ];
mainProgram = "powershell-editor-services";
sourceProvenance = with sourceTypes; [ binaryBytecode ];
};
}

0 comments on commit 4ec8229

Please sign in to comment.