новый файл: flake.lock

новый файл:    flake.nix
	новый файл:    pkgs/codesys2/default.nix
	новый файл:    pkgs/codesys2/setup.iss
	новый файл:    pkgs/codesys3/default.nix
	новый файл:    pkgs/mfc42/default.nix
	новый файл:    pkgs/mspaintxp/default.nix
	новый файл:    pkgs/vcredist2019/default.nix
This commit is contained in:
Gregory Bednov 2026-09-02 11:08:59 +03:00
commit 04398840c0
8 changed files with 411 additions and 0 deletions

72
pkgs/codesys3/default.nix Normal file
View file

@ -0,0 +1,72 @@
{
stdenv,
makeWrapper,
makeDesktopItem,
copyDesktopItems,
wineWowPackages,
vcredist2019,
# Full win64 Wine prefix produced by installing CODESYS 3.5.15.20 interactively
# (with dotnet462, msxml4/6 via winetricks). See pkgs/codesys3/README for steps.
src,
}:
let
wine = wineWowPackages.stable;
in
stdenv.mkDerivation {
pname = "codesys3";
version = "3.5.15.20";
inherit src;
sourceRoot = ".";
nativeBuildInputs = [
makeWrapper
copyDesktopItems
];
desktopItems = [
(makeDesktopItem {
name = "codesys3";
desktopName = "CODESYS 3.5";
genericName = "PLC Programming";
exec = "codesys3";
categories = [ "Development" ];
startupWMClass = "CODESYS.exe";
})
];
installPhase = ''
runHook preInstall
# The src is a full wine prefix (win64). Copy it to the store as a read-only
# template; the wrapper inflates it to ~/.local/share/codesys3 on first run.
install -d $out/share/codesys3-prefix
cp -r . $out/share/codesys3-prefix/
# Also expose the vcredist2019 DLLs so the wrapper can drop them in on demand.
install -d $out/share/codesys3-windll
cp ${vcredist2019}/windll/*.dll $out/share/codesys3-windll/
makeWrapper ${wine}/bin/wine $out/bin/codesys3 \
--run '
PREFIX="$HOME/.local/share/codesys3-prefix"
if [ ! -f "$PREFIX/.codesys3-ready" ]; then
echo "Setting up CODESYS 3 prefix (first run, may take a moment)..."
rm -rf "$PREFIX"
cp -r '"$out/share/codesys3-prefix"' "$PREFIX"
chmod -R u+w "$PREFIX"
touch "$PREFIX/.codesys3-ready"
fi
export WINEPREFIX="$PREFIX"
export WINEARCH=win64
export WINEDEBUG=-all
' \
--add-flags '"C:\\Program Files\\CODESYS 3.5.15.20\\CODESYS\\Common\\CODESYS.exe"'
runHook postInstall
'';
meta.mainProgram = "codesys3";
}