silenceLogs is not picked up

Result:
$ cat result/etc/systemd/system/tailscaled.service
[Unit]
Description=Tailscale node agent
Documentation=https://tailscale.com/kb/
Wants=network-pre.target
After=network-pre.target NetworkManager.service systemd-resolved.service

[Service]
ExecStartPre=/nix/store/gr38ww9sj0qbcs8sb17iq9871qvmhfjw-tailscale-1.42.0/bin/tailscaled --cleanup
ExecStart=/nix/store/gr38ww9sj0qbcs8sb17iq9871qvmhfjw-tailscale-1.42.0/bin/tailscaled --state=/var/lib/tailscale/tailscaled.state --socket=/run/tailscale/tailscaled.sock --port=
ExecStopPost=/nix/store/gr38ww9sj0qbcs8sb17iq9871qvmhfjw-tailscale-1.42.0/bin/tailscaled --cleanup

Restart=on-failure

RuntimeDirectory=tailscale
RuntimeDirectoryMode=0755
StateDirectory=tailscale
StateDirectoryMode=0700
CacheDirectory=tailscale
CacheDirectoryMode=0750
Type=notify

[Install]
WantedBy=multi-user.target
This commit is contained in:
Motiejus Jakštys 2023-09-14 15:03:00 +03:00
parent 76c07129f3
commit b73f671bc0

View File

@ -4,23 +4,27 @@
pkgs, pkgs,
myData, myData,
... ...
}: { }: let
options.mj.services.tailscale = with lib.types; { cfg = config.mj.services.tailscale;
enable = lib.mkEnableOption "Enable tailscale"; inherit (lib) mkMerge types mkEnableOption mkOption mkIf;
in {
options.mj.services.tailscale = with types; {
enable = mkEnableOption "Enable tailscale";
# https://github.com/tailscale/tailscale/issues/1548 # https://github.com/tailscale/tailscale/issues/1548
silenceLogs = lib.mkOption { silenceLogs = mkOption {
type = bool; type = bool;
default = false; default = false;
}; };
}; };
config = with config.mj.services.tailscale; config = mkIf (cfg.enable) (mkMerge [
lib.mkIf enable { {
services.tailscale.enable = true; services.tailscale.enable = true;
networking.firewall.checkReversePath = "loose"; networking.firewall.checkReversePath = "loose";
networking.firewall.allowedUDPPorts = [myData.ports.tailscale]; networking.firewall.allowedUDPPorts = [myData.ports.tailscale];
#} }
#// lib.mkIf silenceLogs { (mkIf cfg.silenceLogs {
# systemd.services.tailscaled.serviceConfig."StandardOutput" = "null"; systemd.services.tailscaled.serviceConfig."StandardOutput" = "null";
}; })
]);
} }