various updates
This commit is contained in:
parent
56b6195620
commit
d1cdaf176d
5 changed files with 39 additions and 63 deletions
|
@ -35,6 +35,7 @@
|
|||
"https://hyprland.cachix.org"
|
||||
"https://0x76-infra.cachix.org"
|
||||
"https://webcord.cachix.org"
|
||||
"https://cache.garnix.io"
|
||||
];
|
||||
trusted-public-keys = [
|
||||
"cachix.cachix.org-1:eWNHQldwUO7G2VkjpnjDbWwy4KQ/HNxht7H4SSoMckM="
|
||||
|
@ -44,6 +45,7 @@
|
|||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||
"0x76-infra.cachix.org-1:dC1qp+VEN3jj5pdK4URlXR9hf3atT+MnpKGu6PZjMc8="
|
||||
"webcord.cachix.org-1:l555jqOZGHd2C9+vS8ccdh8FhqnGe8L78QrHNn+EFEs="
|
||||
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
|
||||
];
|
||||
};
|
||||
optimise = {
|
||||
|
|
|
@ -3,8 +3,7 @@ with lib;
|
|||
let
|
||||
cfg = config.services.vmagent;
|
||||
settingsFormat = pkgs.formats.json { };
|
||||
in
|
||||
{
|
||||
in {
|
||||
options.services.vmagent = {
|
||||
enable = mkEnableOption "vmagent";
|
||||
|
||||
|
@ -50,9 +49,7 @@ in
|
|||
};
|
||||
|
||||
prometheusConfig = mkOption {
|
||||
type = lib.types.submodule {
|
||||
freeformType = settingsFormat.type;
|
||||
};
|
||||
type = lib.types.submodule { freeformType = settingsFormat.type; };
|
||||
description = ''
|
||||
Config for prometheus style metrics
|
||||
'';
|
||||
|
@ -76,7 +73,7 @@ in
|
|||
vmagent = {
|
||||
group = cfg.group;
|
||||
shell = pkgs.bashInteractive;
|
||||
description = "vmagent Daemon user";
|
||||
description = "vmagent daemon user";
|
||||
home = cfg.dataDir;
|
||||
isSystemUser = true;
|
||||
};
|
||||
|
@ -86,23 +83,25 @@ in
|
|||
networking.firewall.allowedTCPPorts = mkIf (cfg.openFirewall) [ 8429 ];
|
||||
|
||||
# The actual service
|
||||
systemd.services.vmagent =
|
||||
let prometheusConfig = settingsFormat.generate "prometheusConfig.yaml" cfg.prometheusConfig;
|
||||
in {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
description = "vmagent system service";
|
||||
serviceConfig = {
|
||||
User = cfg.user;
|
||||
Group = cfg.group;
|
||||
Type = "simple";
|
||||
Restart = "on-failure";
|
||||
WorkingDirectory = cfg.dataDir;
|
||||
ExecStart =
|
||||
"${cfg.package}/bin/vmagent -remoteWrite.url=${cfg.remoteWriteUrl} -promscrape.config=${prometheusConfig}";
|
||||
};
|
||||
systemd.services.vmagent = let
|
||||
prometheusConfig =
|
||||
settingsFormat.generate "prometheusConfig.yaml" cfg.prometheusConfig;
|
||||
in {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
description = "vmagent system service";
|
||||
serviceConfig = {
|
||||
User = cfg.user;
|
||||
Group = cfg.group;
|
||||
Type = "simple";
|
||||
Restart = "on-failure";
|
||||
WorkingDirectory = cfg.dataDir;
|
||||
ExecStart =
|
||||
"${cfg.package}/bin/vmagent -remoteWrite.url=${cfg.remoteWriteUrl} -promscrape.config=${prometheusConfig}";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = [ "d '${cfg.dataDir}' 0755 ${cfg.user} ${cfg.group} -" ];
|
||||
systemd.tmpfiles.rules =
|
||||
[ "d '${cfg.dataDir}' 0755 ${cfg.user} ${cfg.group} -" ];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue