Change:
Initially, I opened this issue to get vmagent removed in favour of victoriametrics. Instead, we propose that vmagent be based on the victoriametrics package. The package provides a subset of the programs provided by the package. This package should be removed (and aliased to victoriametrics).
Correct me if I'm wrong, but it seems as if vmagent could be useful without the whole victoriametrics package. Maybe someone wants that without also having vmbackup, vmrestore and so on?
So could all of the other programs in the package. :D If removal is not the best option, is there a way to provide all or some of the programs as individual packages without maintaining versions in ?
cc
i played a bit around with the code. Would something like that fulfill the goal? vmagent as client tool could then be exposed like that If yes i could create a pr for that. i tried to put those into groups that might make sense setup wise.
That looks good to me! :)
That looks good to me as well
Cool, that looks like a reasonable solution! :) I'll leave this issue open to be closed by merging the PR.
As in the issue was some response and the PR did not attract any deeper looks yet, does some from here feel comfortable in peeking at the linked pr?
Sorry, I haven't been checking my GitHub notifications since. The merged solution looks good to me. Especially leaving the vmalert program in the victoriametrics package. :)

Discussion:
<del> { lib, buildGoModule, fetchFromGitHub, nixosTests }: </del> <ins> { lib, buildGoModule, fetchFromGitHub, nixosTests, withServer ? true, # the actual metrics server withVmAgent ? true, # Agent to collect metrics withVmAlert ? true, # Alert Manager withVmAuth ? true, # HTTP proxy for authentication withBackupTools ? true, # vmbackup, vmrestore withVmctl ? true, # vmctl is used to migrate time series withVictoriaLogs ? true, # logs server }: </ins> buildGoModule rec { pname = "VictoriaMetrics"; version = "1.101.0"; src = fetchFromGitHub { <del> owner = pname; repo = pname; </del> <ins> owner = "VictoriaMetrics"; repo = "VictoriaMetrics"; </ins> rev = "v${version}"; hash = "sha256-Jjz/CbVCvc9NFbvzYTFthG8cov4pYpc6y1A1Kmd3Mjg="; }; vendorHash = null; <del> subPackages = [ "app/victoria-logs" "app/victoria-metrics" "app/vlinsert" "app/vlselect" "app/vlstorage" "app/vmagent" "app/vmalert-tool" "app/vmalert" "app/vmauth" "app/vmctl" "app/vminsert" "app/vmselect" "app/vmstorage" "app/vmbackup" "app/vmrestore" "app/vmui" ]; </del> <ins> subPackages = lib.optionals withServer [ "app/victoria-metrics" "app/vminsert" "app/vmselect" "app/vmstorage" "app/vmui" ] ++ lib.optionals withVmAgent [ "app/vmagent" ] ++ lib.optionals withVmAlert [ "app/vmalert" "app/vmalert-tool" ] ++ lib.optionals withVmAuth [ "app/vmauth" ] ++ lib.optionals withVmctl [ "app/vmctl" ] ++ lib.optionals withBackupTools [ "app/vmbackup" "app/vmrestore" ] ++ lib.optionals withVictoriaLogs [ "app/victoria-logs" "app/vlinsert" "app/vlselect" "app/vlstorage" ]; </ins> postPatch = '' # main module (github.com/VictoriaMetrics/VictoriaMetrics) does not contain package

--replace "time.NewTimer(time.Second * 10)" "time.NewTimer(time.Second * 120)"  ''; <del> ldflags = [ "-s" "-w" "-X github.com/VictoriaMetrics/VictoriaMetrics/lib/buildinfo.Version=${version}" ]; </del> <ins> ldflags = [ "-s" "-w" "-X github.com/VictoriaMetrics/VictoriaMetrics/lib/buildinfo.Version=${version}" ]; </ins> preCheck = '' # `lib/querytracer/tracer_test.go` expects `buildinfo.Version` to be unset

__darwinAllowLocalNetworking = true; <del> passthru.tests = { inherit (nixosTests) victoriametrics; }; </del> <ins> passthru.tests = { inherit (nixosTests) victoriametrics; }; </ins> meta = with lib; { homepage = "https://victoriametrics.com/"; description = "fast, cost-effective and scalable time series database, long-term remote storage for Prometheus"; license = licenses.asl20; <del> maintainers = with maintainers; [ yorickvp ivan ]; </del> <ins> maintainers = with maintainers; [ yorickvp ivan nullx76 leona shawn8901 ]; </ins> changelog = "https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v${version}"; mainProgram = "victoria-metrics"; };

<ins> { lib, victoriametrics }: lib.addMetaAttrs { mainProgram = "vmagent"; } ( victoriametrics.override { withServer = false; withVictoriaLogs = false; withVmAlert = false; withVmAuth = false; withBackupTools = false; withVmctl = false; withVmAgent = true; } ) </ins>

<del> { lib, fetchFromGitHub, buildGoModule }: buildGoModule rec { pname = "vmagent"; version = "1.101.0"; src = fetchFromGitHub { owner = "VictoriaMetrics"; repo = "VictoriaMetrics"; rev = "v${version}"; sha256 = "sha256-Jjz/CbVCvc9NFbvzYTFthG8cov4pYpc6y1A1Kmd3Mjg="; }; ldflags = [ "-s" "-w" "-X github.com/VictoriaMetrics/VictoriaMetrics/lib/buildinfo.Version=${version}" ]; vendorHash = null; subPackages = [ "app/vmagent" ]; meta = with lib; { homepage = "https://github.com/VictoriaMetrics/VictoriaMetrics/tree/master/app/vmagent"; description = "VictoriaMetrics metrics scraper"; mainProgram = "vmagent"; license = licenses.asl20; platforms = platforms.linux; maintainers = with maintainers; [ nullx76 leona ]; }; } </del>

virtualenv-clone = with python3Packages; toPythonApplication virtualenv-clone; <del> vmagent = callPackage ../servers/monitoring/vmagent { }; </del> vsftpd = callPackage ../servers/ftp/vsftpd { }; wallabag = callPackage ../servers/web-apps/wallabag { };