Replace telegraf with node exporter
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -1,58 +0,0 @@
|
||||
{
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
port = 9273 + config.users.users.${user}.uid;
|
||||
hmConfig = config.home-manager.users.${user};
|
||||
in
|
||||
{
|
||||
home-manager.users.${user}.systemd.user.services.telegraf =
|
||||
let
|
||||
telegrafConfig = (pkgs.formats.toml { }).generate "config.toml" {
|
||||
agent.quiet = true;
|
||||
|
||||
outputs.prometheus_client = [ { listen = ":${builtins.toString port}"; } ];
|
||||
|
||||
inputs =
|
||||
{
|
||||
systemd_units = [
|
||||
{ scope = "user"; }
|
||||
];
|
||||
}
|
||||
// lib.attrsets.optionalAttrs hmConfig.services.podman.enable {
|
||||
docker = [
|
||||
{
|
||||
endpoint =
|
||||
let
|
||||
uid = builtins.toString config.users.users.${user}.uid;
|
||||
in
|
||||
"unix:///var/run/user/${uid}/podman/podman.sock";
|
||||
perdevice = false;
|
||||
perdevice_include = [
|
||||
"cpu"
|
||||
"blkio"
|
||||
"network"
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
Unit.Description = "Telegraf Agent";
|
||||
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
|
||||
Service = {
|
||||
ExecStart = "${config.services.telegraf.package}/bin/telegraf -config ${telegrafConfig}";
|
||||
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
||||
};
|
||||
};
|
||||
}
|
@@ -38,14 +38,14 @@ in
|
||||
EmailTracking = true;
|
||||
};
|
||||
FirefoxHome = {
|
||||
"Locked" = true;
|
||||
"Search" = true;
|
||||
"TopSites" = true;
|
||||
"SponsoredTopSites" = false;
|
||||
"Highlights" = false;
|
||||
"Pocket" = false;
|
||||
"SponsoredPocket" = false;
|
||||
"Snippets" = false;
|
||||
Locked = true;
|
||||
Search = true;
|
||||
TopSites = true;
|
||||
SponsoredTopSites = false;
|
||||
Highlights = false;
|
||||
Pocket = false;
|
||||
SponsoredPocket = false;
|
||||
Snippets = false;
|
||||
};
|
||||
NoDefaultBookmarks = true;
|
||||
OfferToSaveLogins = false;
|
||||
@@ -94,10 +94,10 @@ in
|
||||
];
|
||||
force = true;
|
||||
engines = {
|
||||
"google".metaData.alias = "@g";
|
||||
"ddg".metaData.alias = "@d";
|
||||
"wikipedia".metaData.alias = "@w";
|
||||
"nix" = {
|
||||
google.metaData.alias = "@g";
|
||||
ddg.metaData.alias = "@d";
|
||||
wikipedia.metaData.alias = "@w";
|
||||
nix = {
|
||||
urls = [
|
||||
{
|
||||
template = "https://mynixos.com/search";
|
||||
|
@@ -308,85 +308,85 @@ in
|
||||
settings = {
|
||||
"markerIconRules" = [
|
||||
{
|
||||
"ruleName" = "default";
|
||||
"preset" = true;
|
||||
"iconDetails" = {
|
||||
"prefix" = "fas";
|
||||
"icon" = "fa-circle";
|
||||
"markerColor" = "blue";
|
||||
ruleName = "default";
|
||||
preset = true;
|
||||
iconDetails = {
|
||||
prefix = "fas";
|
||||
icon = "fa-circle";
|
||||
markerColor = "blue";
|
||||
};
|
||||
}
|
||||
{
|
||||
"ruleName" = "#restaurant";
|
||||
"preset" = false;
|
||||
"iconDetails" = {
|
||||
"prefix" = "fas";
|
||||
"icon" = "fa-utensils";
|
||||
"markerColor" = "red";
|
||||
ruleName = "#restaurant";
|
||||
preset = false;
|
||||
iconDetails = {
|
||||
prefix = "fas";
|
||||
icon = "fa-utensils";
|
||||
markerColor = "red";
|
||||
};
|
||||
}
|
||||
{
|
||||
"ruleName" = "#bar";
|
||||
"preset" = false;
|
||||
"iconDetails" = {
|
||||
"prefix" = "fas";
|
||||
"icon" = "fa-martini-glass";
|
||||
"markerColor" = "purple";
|
||||
ruleName = "#bar";
|
||||
preset = false;
|
||||
iconDetails = {
|
||||
prefix = "fas";
|
||||
icon = "fa-martini-glass";
|
||||
markerColor = "purple";
|
||||
};
|
||||
}
|
||||
{
|
||||
"ruleName" = "#coffee";
|
||||
"preset" = false;
|
||||
"iconDetails" = {
|
||||
"prefix" = "fas";
|
||||
"icon" = "fa-mug-hot";
|
||||
"markerColor" = "purple";
|
||||
ruleName = "#coffee";
|
||||
preset = false;
|
||||
iconDetails = {
|
||||
prefix = "fas";
|
||||
icon = "fa-mug-hot";
|
||||
markerColor = "purple";
|
||||
};
|
||||
}
|
||||
{
|
||||
"ruleName" = "#culture";
|
||||
"preset" = false;
|
||||
"iconDetails" = {
|
||||
"prefix" = "fas";
|
||||
"icon" = "fa-building-columns";
|
||||
"markerColor" = "black";
|
||||
ruleName = "#culture";
|
||||
preset = false;
|
||||
iconDetails = {
|
||||
prefix = "fas";
|
||||
icon = "fa-building-columns";
|
||||
markerColor = "black";
|
||||
};
|
||||
}
|
||||
{
|
||||
"ruleName" = "#shopping";
|
||||
"preset" = false;
|
||||
"iconDetails" = {
|
||||
"prefix" = "fas";
|
||||
"icon" = "fa-shopping-bag";
|
||||
"markerColor" = "yellow";
|
||||
ruleName = "#shopping";
|
||||
preset = false;
|
||||
iconDetails = {
|
||||
prefix = "fas";
|
||||
icon = "fa-shopping-bag";
|
||||
markerColor = "yellow";
|
||||
};
|
||||
}
|
||||
{
|
||||
"ruleName" = "#entertainment";
|
||||
"preset" = false;
|
||||
"iconDetails" = {
|
||||
"prefix" = "fas";
|
||||
"icon" = "fa-microphone";
|
||||
"markerColor" = "pink";
|
||||
ruleName = "#entertainment";
|
||||
preset = false;
|
||||
iconDetails = {
|
||||
prefix = "fas";
|
||||
icon = "fa-microphone";
|
||||
markerColor = "pink";
|
||||
};
|
||||
}
|
||||
{
|
||||
"ruleName" = "#nature";
|
||||
"preset" = false;
|
||||
"iconDetails" = {
|
||||
"prefix" = "fas";
|
||||
"icon" = "fa-tree";
|
||||
"markerColor" = "green";
|
||||
ruleName = "#nature";
|
||||
preset = false;
|
||||
iconDetails = {
|
||||
prefix = "fas";
|
||||
icon = "fa-tree";
|
||||
markerColor = "green";
|
||||
};
|
||||
}
|
||||
];
|
||||
"searchProvider" = "google";
|
||||
"geocodingApiMethod" = "path";
|
||||
"geocodingApiPath" = hmConfig.sops.secrets."google/geocoding".path;
|
||||
"useGooglePlaces" = true;
|
||||
"letZoomBeyondMax" = true;
|
||||
"showGeolinkPreview" = true;
|
||||
"newNotePath" = "Inbox";
|
||||
searchProvider = "google";
|
||||
geocodingApiMethod = "path";
|
||||
geocodingApiPath = hmConfig.sops.secrets."google/geocoding".path;
|
||||
useGooglePlaces = true;
|
||||
letZoomBeyondMax = true;
|
||||
showGeolinkPreview = true;
|
||||
newNotePath = "Inbox";
|
||||
};
|
||||
}
|
||||
{
|
||||
|
@@ -64,8 +64,8 @@ in
|
||||
(lib.mkIf cfg.copilot.enable {
|
||||
"github.copilot.enable" = {
|
||||
"*" = true;
|
||||
"plaintext" = true;
|
||||
"markdown" = true;
|
||||
plaintext = true;
|
||||
markdown = true;
|
||||
};
|
||||
"chat.editing.alwaysSaveWithGeneratedChanges" = true;
|
||||
})
|
||||
|
Reference in New Issue
Block a user