-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
{ ... environment.systemPackages = with pkgs; [ ... tailscale wireguard-tools ... ]; environment.etc = { ... # optional, only necessary if you persist /etc config and secrets to somewhere other than /etc "tailscale".source = "/persist/etc/tailscale/"; ... }; networking.firewall = { enable = true; # always allow traffic from your Tailscale network trustedInterfaces = [ "tailscale0" ]; # allow the Tailscale UDP port through the firewall allowedUDPPorts = [ config.services.tailscale.port ]; }; networking.wireguard.interfaces.wg0 = { generatePrivateKeyFile = true; privateKeyFile = "/persist/etc/wireguard/wg0"; }; # Tailscale config, based on: # https://tailscale.com/blog/nixos-minecraft/ services.tailscale.enable = true; # create a oneshot job to authenticate to Tailscale.com systemd.services.tailscale-autoconnect = { description = "Automatic connection to Tailscale"; # make sure tailscale is running locally before trying to connect to Tailscale.com after = [ "network-pre.target" "tailscale.service" ]; wants = [ "network-pre.target" "tailscale.service" ]; wantedBy = [ "multi-user.target" ]; # set this service as a oneshot job serviceConfig.Type = "oneshot"; # have the job run this shell script to authenticate with Tailscale.com script = with pkgs; '' # wait for tailscaled to settle # (as of tailscale 1.4 this should no longer be necessary, but I find it still is) echo "Waiting for tailscale service start completion ..." sleep 5 # check if we are already authenticated to tailscale echo "Checking if already authenticated to Tailscale ..." status="$(${tailscale}/bin/tailscale status -json | ${jq}/bin/jq -r .BackendState)" if [ $status = "Running" ]; then # do nothing echo "Already authenticated to Tailscale, exiting." exit 0 fi # otherwise authenticate with tailscale echo "Authenticating with Tailscale ..." ${tailscale}/bin/tailscale up --authkey $(cat /etc/tailscale/tskey-reusable) ''; };
Whenever possible it's best to let NixOS handle system/service/program config. You can quickly check if that's possible by opening search.nixos.org, clicking Options at the top, and searching for the service you want to run. If it's there, then use those config options in your configuration.nix.