diff --git a/pkgs/by-name/ar/arduino-create-agent/package.nix b/pkgs/by-name/ar/arduino-create-agent/package.nix new file mode 100644 index 0000000000000..1f3a0995cad8b --- /dev/null +++ b/pkgs/by-name/ar/arduino-create-agent/package.nix @@ -0,0 +1,40 @@ +{ + lib, + stdenv, + buildGoModule, + fetchFromGitHub, + go-task, +}: + +buildGoModule rec { + pname = "arduino-create-agent"; + version = "1.6.1"; + + src = fetchFromGitHub { + owner = "arduino"; + repo = "arduino-create-agent"; + rev = "${version}"; + hash = "sha256-TWyjF/2F3ub+sGFOTWc3kv2w6SRrvDaBSztOki32oxc="; + }; + + patches = [ + ./updater.patch + ]; + + vendorHash = "sha256-SV0Cw0MrAufBleloG1m4qNPme03cBj0UgQGL7jY1wY4="; + + ldflags = [ + "-X github.com/arduino/arduino-create-agent/version.versionString=${version}" + "-X github.com/arduino/arduino-create-agent/version.commit=unknown" + ]; + + doCheck = false; # require network connectivity + + meta = { + description = "Agent to upload code to any USB connected Arduino board directly from the browser"; + homepage = "https://github.com/arduino/arduino-create-agent"; + changelog = "https://github.com/arduino/arduino-create-agent/releases/tag/${version}"; + license = lib.licenses.agpl3Plus; + maintainers = with lib.maintainers; [ kilimnik ]; + }; +} diff --git a/pkgs/by-name/ar/arduino-create-agent/updater.patch b/pkgs/by-name/ar/arduino-create-agent/updater.patch new file mode 100644 index 0000000000000..ba58d2bac6ffa --- /dev/null +++ b/pkgs/by-name/ar/arduino-create-agent/updater.patch @@ -0,0 +1,25 @@ +diff --git a/main.go b/main.go +index 65b8219..8be36c6 100755 +--- a/main.go ++++ b/main.go +@@ -399,7 +399,6 @@ func loop() { + r.Handle("WSS", "/socket.io/", socketHandler) + r.GET("/info", infoHandler) + r.POST("/pause", pauseHandler) +- r.POST("/update", updateHandler) + + // Mount goa handlers + goa := v2.Server(config.GetDataDir().String(), Index) +diff --git a/updater/updater.go b/updater/updater.go +index db4e545..693431a 100644 +--- a/updater/updater.go ++++ b/updater/updater.go +@@ -34,7 +34,7 @@ import ( + // binary to be executed to perform the update. If no update has been downloaded + // it returns an empty string. + func Start(src string) string { +- return start(src) ++ return "" + } + + // CheckForUpdates checks if there is a new version of the binary available and