more
Some checks are pending
CI Tests / dotnet (push) Waiting to run
CI Tests / dotnet-1 (push) Waiting to run
CI Tests / dotnet-2 (push) Waiting to run
Emacs End-to-End Tests / ert (push) Waiting to run
Vim End-to-End Tests / themis (push) Waiting to run

This commit is contained in:
fwastring 2026-02-18 13:14:45 +01:00
parent baa0056244
commit e1c0d950e0
2 changed files with 61 additions and 35 deletions

View file

@ -6,24 +6,28 @@ let
url = "https://www.powershellgallery.com/api/v2/package/PSReadLine/2.4.5"; url = "https://www.powershellgallery.com/api/v2/package/PSReadLine/2.4.5";
sha256 = "12pwy5b426lv7cmlasa7ajy202a0vjjs9drfyg2q5zwqxhj8g8cz"; sha256 = "12pwy5b426lv7cmlasa7ajy202a0vjjs9drfyg2q5zwqxhj8g8cz";
stripRoot = false; stripRoot = false;
extension = "zip";
}; };
psscriptanalyzer = pkgs.fetchzip { psscriptanalyzer = pkgs.fetchzip {
url = "https://www.powershellgallery.com/api/v2/package/PSScriptAnalyzer/1.24.0"; url = "https://www.powershellgallery.com/api/v2/package/PSScriptAnalyzer/1.24.0";
sha256 = "03bz9f5rcx749758h6l9wsv86300s0a34qgd522v6166crbpvg2p"; sha256 = "03bz9f5rcx749758h6l9wsv86300s0a34qgd522v6166crbpvg2p";
stripRoot = false; stripRoot = false;
extension = "zip";
}; };
invokebuild = pkgs.fetchzip { invokebuild = pkgs.fetchzip {
url = "https://www.powershellgallery.com/api/v2/package/InvokeBuild/5.12.2"; url = "https://www.powershellgallery.com/api/v2/package/InvokeBuild/5.12.2";
sha256 = "0cry70c6ndlv4y0fmlg5iip0ix1r51p7i6dxx3y2zzczbkz2mn6m"; sha256 = "0cry70c6ndlv4y0fmlg5iip0ix1r51p7i6dxx3y2zzczbkz2mn6m";
stripRoot = false; stripRoot = false;
extension = "zip";
}; };
platyps = pkgs.fetchzip { platyps = pkgs.fetchzip {
url = "https://www.powershellgallery.com/api/v2/package/platyPS/0.14.2"; url = "https://www.powershellgallery.com/api/v2/package/platyPS/0.14.2";
sha256 = "13m11mf42blcn2327m9a4dqfg8sgjjg1vg9dmiwvnbq7wpam260q"; sha256 = "13m11mf42blcn2327m9a4dqfg8sgjjg1vg9dmiwvnbq7wpam260q";
stripRoot = false; stripRoot = false;
extension = "zip";
}; };
in in
pkgs.stdenv.mkDerivation { pkgs.stdenv.mkDerivation {
@ -31,6 +35,13 @@ pkgs.stdenv.mkDerivation {
version = "4.4.0"; version = "4.4.0";
src = ./.; src = ./.;
phases = [
"unpackPhase"
"patchPhase"
"buildPhase"
"installPhase"
];
nativeBuildInputs = [ nativeBuildInputs = [
pkgs.dotnet-sdk_8 pkgs.dotnet-sdk_8
pkgs.git pkgs.git
@ -41,6 +52,7 @@ pkgs.stdenv.mkDerivation {
export HOME=$TMPDIR export HOME=$TMPDIR
export DOTNET_CLI_TELEMETRY_OPTOUT=1 export DOTNET_CLI_TELEMETRY_OPTOUT=1
export NUGET_PACKAGES=$TMPDIR/nuget export NUGET_PACKAGES=$TMPDIR/nuget
export NUGET_CONFIG_FILE=$PWD/nuget.config
git init -q git init -q
git config user.email "nix@local" git config user.email "nix@local"
@ -58,7 +70,7 @@ pkgs.stdenv.mkDerivation {
export PSModulePath="$TMPDIR/psmodules${"PSModulePath:+:$PSModulePath"}" export PSModulePath="$TMPDIR/psmodules${"PSModulePath:+:$PSModulePath"}"
pwsh -NoLogo -NoProfile -Command \ pwsh -NoLogo -NoProfile -Command \
"Import-Module InvokeBuild; Invoke-Build -File PowerShellEditorServices.build.ps1 -Task AssembleModule -Configuration Release" "Import-Module InvokeBuild; Invoke-Build -File PowerShellEditorServices.build.ps1 -Task Build,AssembleModule -Configuration Release"
''; '';
installPhase = '' installPhase = ''

View file

@ -13,68 +13,82 @@
url = "https://www.powershellgallery.com/api/v2/package/PSReadLine/2.4.5"; url = "https://www.powershellgallery.com/api/v2/package/PSReadLine/2.4.5";
sha256 = "12pwy5b426lv7cmlasa7ajy202a0vjjs9drfyg2q5zwqxhj8g8cz"; sha256 = "12pwy5b426lv7cmlasa7ajy202a0vjjs9drfyg2q5zwqxhj8g8cz";
stripRoot = false; stripRoot = false;
extension = "zip";
}; };
psscriptanalyzer = pkgs.fetchzip { psscriptanalyzer = pkgs.fetchzip {
url = "https://www.powershellgallery.com/api/v2/package/PSScriptAnalyzer/1.24.0"; url = "https://www.powershellgallery.com/api/v2/package/PSScriptAnalyzer/1.24.0";
sha256 = "03bz9f5rcx749758h6l9wsv86300s0a34qgd522v6166crbpvg2p"; sha256 = "03bz9f5rcx749758h6l9wsv86300s0a34qgd522v6166crbpvg2p";
stripRoot = false; stripRoot = false;
extension = "zip";
}; };
invokebuild = pkgs.fetchzip { invokebuild = pkgs.fetchzip {
url = "https://www.powershellgallery.com/api/v2/package/InvokeBuild/5.12.2"; url = "https://www.powershellgallery.com/api/v2/package/InvokeBuild/5.12.2";
sha256 = "0cry70c6ndlv4y0fmlg5iip0ix1r51p7i6dxx3y2zzczbkz2mn6m"; sha256 = "0cry70c6ndlv4y0fmlg5iip0ix1r51p7i6dxx3y2zzczbkz2mn6m";
stripRoot = false; stripRoot = false;
extension = "zip";
}; };
platyps = pkgs.fetchzip { platyps = pkgs.fetchzip {
url = "https://www.powershellgallery.com/api/v2/package/platyPS/0.14.2"; url = "https://www.powershellgallery.com/api/v2/package/platyPS/0.14.2";
sha256 = "13m11mf42blcn2327m9a4dqfg8sgjjg1vg9dmiwvnbq7wpam260q"; sha256 = "13m11mf42blcn2327m9a4dqfg8sgjjg1vg9dmiwvnbq7wpam260q";
stripRoot = false; stripRoot = false;
extension = "zip";
}; };
in in
{ {
packages.${system}.pses = pkgs.stdenv.mkDerivation { packages.${system} = rec {
pname = "powershell-editor-services"; pses = pkgs.stdenv.mkDerivation {
version = "4.4.0"; pname = "powershell-editor-services";
src = ./.; version = "4.4.0";
src = ./.;
nativeBuildInputs = [ phases = [
pkgs.dotnet-sdk_8 "unpackPhase"
pkgs.git "patchPhase"
pkgs.powershell "buildPhase"
]; "installPhase"
];
buildPhase = '' nativeBuildInputs = [
export HOME=$TMPDIR pkgs.dotnet-sdk_8
export DOTNET_CLI_TELEMETRY_OPTOUT=1 pkgs.git
export NUGET_PACKAGES=$TMPDIR/nuget pkgs.powershell
];
git init -q buildPhase = ''
git config user.email "nix@local" export HOME=$TMPDIR
git config user.name "nix" export DOTNET_CLI_TELEMETRY_OPTOUT=1
git add -A export NUGET_PACKAGES=$TMPDIR/nuget
git commit -qm "nix build" export NUGET_CONFIG_FILE=$PWD/nuget.config
mkdir -p module git init -q
cp -r ${psreadline} module/PSReadLine git config user.email "nix@local"
cp -r ${psscriptanalyzer} module/PSScriptAnalyzer git config user.name "nix"
git add -A
git commit -qm "nix build"
mkdir -p $TMPDIR/psmodules mkdir -p module
cp -r ${invokebuild} $TMPDIR/psmodules/InvokeBuild cp -r ${psreadline} module/PSReadLine
cp -r ${platyps} $TMPDIR/psmodules/platyPS cp -r ${psscriptanalyzer} module/PSScriptAnalyzer
export PSModulePath="$TMPDIR/psmodules${"PSModulePath:+:$PSModulePath"}"
pwsh -NoLogo -NoProfile -Command \ mkdir -p $TMPDIR/psmodules
"Import-Module InvokeBuild; Invoke-Build -File PowerShellEditorServices.build.ps1 -Task AssembleModule -Configuration Release" cp -r ${invokebuild} $TMPDIR/psmodules/InvokeBuild
''; cp -r ${platyps} $TMPDIR/psmodules/platyPS
export PSModulePath="$TMPDIR/psmodules''${PSModulePath:+:$PSModulePath}"
installPhase = '' pwsh -NoLogo -NoProfile -Command \
mkdir -p $out/share/powershell/Modules "Import-Module InvokeBuild; Invoke-Build -File PowerShellEditorServices.build.ps1 -Task Build,AssembleModule -Configuration Release"
cp -r module/* $out/share/powershell/Modules/ '';
'';
installPhase = ''
mkdir -p $out/share/powershell/Modules
cp -r module/* $out/share/powershell/Modules/
'';
};
default = pses;
}; };
packages.${system}.default = self.packages.${system}.pses;
}; };
} }