Compare commits

..

No commits in common. "ba7a9102aa214f09704a72ddd5007e9f375a12ab" and "60b228a4d83074caeb887e771274489eaabaaa2b" have entirely different histories.

7 changed files with 76 additions and 30 deletions

View File

@ -25,7 +25,6 @@
home.packages = with pkgs; [
git
kdePackages.kdeconnect-kde
nix-prefetch
];
programs.home-manager = {
enable = true;

View File

@ -0,0 +1,68 @@
{ lib
, mkWindowsAppNoCC
, wine
, makeDesktopItem
, copyDesktopItems
}: mkWindowsAppNoCC rec {
inherit wine;
pname = "ecuflash";
version = "1.44";
version_raw = "1444870";
src = builtins.fetchurl {
sha256 = "sha256-6SQtiIJTD8MgFk8T5BB87/nIYvW9Lmbevb6+SJX/+gs=";
url = "https://www.tactrix.com/downloads/ecuflash_1444870_win.exe";
};
dontUnpack = true;
wineArch = "win64";
enableInstallNotification = true;
fileMapDuringAppInstall = false;
persistRegistry = true;
persistRuntimeLayer = true;
inputHashMethod = "store-path";
nativeBuildInputs = [ copyDesktopItems ];
winAppInstall = ''
d="$WINEPREFIX/drive_c/Program Files (x86)/OpenECU/${pname}/"
mkdir -p "$d"
cp ${src} "$d/${pname}_${version_raw}.exe"
wine "$WINEPREFIX/drive_c/Program Files (x86)/OpenECU/${pname}/${pname}_${version_raw}.exe"
'';
winAppPreRun = ''
'';
winAppRun = ''
echo "src: ${src}"
ls "$WINEPREFIX/drive_c/Program Files (x86)/OpenECU/${pname}"
wine "$WINEPREFIX/drive_c/Program Files (x86)/OpenECU/EcuFlash/${pname}.exe"
'';
winAppPostRun = "";
installPhase = ''
runHook preInstall
ln -s $out/bin/.launcher $out/bin/${pname}
runHook postInstall
'';
desktopItems = makeDesktopItem {
name = pname;
exec = pname;
icon = pname;
mimeTypes = [ "application/octet-stream" ];
desktopName = "EcuFlash";
genericName = "ROM Editor";
categories = [ "Development" "Electronics" "Java" ];
};
meta = with lib; {
description = "EcuFlash is Tactrix' free software used with the Openport 2.0 to give you the power to tune and reflash many Subaru and Mitsubishi vehicles.";
homepage = "https://www.tactrix.com/";
license = {
url = "https://www.tactrix.com/index.php?option=com_content&view=article&id=79:eula&catid=36:downloads-ecuflash&Itemid=57";
free = false;
redistributable = true;
};
maintainers = with maintainers; [ jafner ];
platforms = [ "x86_64-linux" ];
};
}

View File

@ -1,20 +1,21 @@
{
description = "A Nix flake with tools for working with ECUs";
description = "A Nix flake for EcuFlash";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
erosanix.url = "github:emmanuelrosa/erosanix";
};
outputs = { self, nixpkgs }: {
outputs = { self, nixpkgs, erosanix }: {
packages.x86_64-linux = let
pkgs = import "${nixpkgs}" {
system = "x86_64-linux";
};
in with pkgs; {
in with (pkgs // erosanix.packages.x86_64-linux // erosanix.lib.x86_64-linux); {
default = self.packages.x86_64-linux.ecuflash;
j2534 = callPackage ./j2534.nix {
inherit libusb1 pkg-config;
inherit fetchFromGitHub;
inherit stdenv;
ecuflash = callPackage ./ecuflash.nix {
inherit mkWindowsAppNoCC;
wine = wineWowPackages.full;
};
};

View File

@ -1 +0,0 @@
SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", ATTR{idProduct}=="cc4d", GROUP="dialout", MODE="0666"

View File

@ -1,21 +0,0 @@
{ stdenv, fetchFromGitHub, libusb1, pkg-config }:
stdenv.mkDerivation rec {
pname = "j2534";
version = "678252b";
src = fetchFromGitHub {
owner = "dschultzca";
repo = "j2534";
rev = "678252bbd0492f48df5e2d94e89cb5485b76d02f";
sha256 = "sha256-V76NtilaKjiT203lX8J0xGG1AZzdZK8Y66hynlQtqW0=";
};
dontDisableStatic = true;
buildInputs = [ libusb1 pkg-config ];
buildPhase = {
makefile = "j2534/makefile";
};
installPhase = ''
mkdir -p $out/lib
cp j2534.so $out/lib/${pname}.so
install -D ${./99-j2534.rules} $out/lib/udev/rules.d/99-j2534.rules
'';
}