added tailscale and telegraf services
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
git.nix
|
git.nix
|
||||||
|
*.env
|
||||||
|
|||||||
@@ -13,15 +13,12 @@ in
|
|||||||
(modulesPath + "/virtualisation/proxmox-lxc.nix")
|
(modulesPath + "/virtualisation/proxmox-lxc.nix")
|
||||||
(import "${builtins.fetchTarball https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz}/nixos")
|
(import "${builtins.fetchTarball https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz}/nixos")
|
||||||
(fetchTarball "https://github.com/nix-community/nixos-vscode-server/tarball/master")
|
(fetchTarball "https://github.com/nix-community/nixos-vscode-server/tarball/master")
|
||||||
|
./telegraf.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
(pkgs.writeShellScriptBin "nrbs" ''
|
(pkgs.writeShellScriptBin "nrbs" "sudo nixos-rebuild switch")
|
||||||
sudo nixos-rebuild switch
|
(pkgs.writeShellScriptBin "nrbsu" "sudo nix-channel --update && sudo nixos-rebuild switch")
|
||||||
'')
|
|
||||||
(pkgs.writeShellScriptBin "nrbsu" ''
|
|
||||||
sudo nix-channel --update && sudo nixos-rebuild switch
|
|
||||||
'')
|
|
||||||
(pkgs.writeShellScriptBin "ad-clone" ''
|
(pkgs.writeShellScriptBin "ad-clone" ''
|
||||||
if [ ! -d ${adPath} ]; then
|
if [ ! -d ${adPath} ]; then
|
||||||
sudo git clone -b ${adBranch} ${adRepo} ${adPath}
|
sudo git clone -b ${adBranch} ${adRepo} ${adPath}
|
||||||
@@ -40,6 +37,7 @@ in
|
|||||||
virtualisation.docker.enable = true;
|
virtualisation.docker.enable = true;
|
||||||
services.vscode-server.enable = true;
|
services.vscode-server.enable = true;
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
services.tailscale.enable = true;
|
||||||
|
|
||||||
system.activationScripts.ensureDirectory = ''
|
system.activationScripts.ensureDirectory = ''
|
||||||
if [ ! -d /conf ]; then
|
if [ ! -d /conf ]; then
|
||||||
|
|||||||
41
telegraf.nix
Normal file
41
telegraf.nix
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
services.telegraf = {
|
||||||
|
enable = true;
|
||||||
|
environmentFiles = [ ./telegraf.env ];
|
||||||
|
extraConfig = {
|
||||||
|
agent = {
|
||||||
|
interval = "10s";
|
||||||
|
round_interval = true;
|
||||||
|
metric_batch_size = 1000;
|
||||||
|
metric_buffer_limit = 10000;
|
||||||
|
collection_jitter = "0s";
|
||||||
|
flush_interval = "10s";
|
||||||
|
flush_jitter = "0s";
|
||||||
|
precision = "";
|
||||||
|
hostname = "";
|
||||||
|
omit_hostname = false;
|
||||||
|
};
|
||||||
|
inputs = {
|
||||||
|
docker = {
|
||||||
|
endpoint = "unix:///var/run/docker.sock";
|
||||||
|
gather_services = false;
|
||||||
|
source_tag = false;
|
||||||
|
container_name_include = [];
|
||||||
|
timeout = "5s";
|
||||||
|
perdevice_include = ["cpu" "blkio" "network"];
|
||||||
|
total = false;
|
||||||
|
docker_label_include = [];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
outputs = {
|
||||||
|
influxdb_v2 = {
|
||||||
|
urls = ["http://panoptes.john-stream.com:8086"];
|
||||||
|
token = "$INFLUX_WRITE_TOKEN";
|
||||||
|
organization = "homelab";
|
||||||
|
bucket = "docker";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user