mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 21:01:34 +01:00
Fix tailscale serve in nspawn containers
This commit is contained in:
parent
5ce0d85d6e
commit
946ef625fc
3 changed files with 3 additions and 4 deletions
|
|
@ -48,7 +48,7 @@ in
|
||||||
|
|
||||||
bindMounts = {
|
bindMounts = {
|
||||||
# Secrets
|
# Secrets
|
||||||
"/run/secrets/container/tailscale-auth-key" = { };
|
"/run/secrets/tailscale-auth-key".hostPath = "/run/secrets/container/tailscale-auth-key";
|
||||||
"/run/secrets/container/${name}".isReadOnly = false;
|
"/run/secrets/container/${name}".isReadOnly = false;
|
||||||
"/run/secrets/restic".isReadOnly = false;
|
"/run/secrets/restic".isReadOnly = false;
|
||||||
"/run/secrets/healthchecks-ping-key".isReadOnly = false;
|
"/run/secrets/healthchecks-ping-key".isReadOnly = false;
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,6 @@ in
|
||||||
myConfig.tailscale = {
|
myConfig.tailscale = {
|
||||||
inherit subdomain;
|
inherit subdomain;
|
||||||
serve = "3000";
|
serve = "3000";
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ in
|
||||||
|
|
||||||
systemd.services.tailscaled-set.after = [ "tailscaled-autoconnect.service" ];
|
systemd.services.tailscaled-set.after = [ "tailscaled-autoconnect.service" ];
|
||||||
|
|
||||||
systemd.services.tailscale-serve = lib.mkIf (cfg.serve != null) {
|
systemd.services.tailscaled-serve = lib.mkIf (cfg.serve != null) {
|
||||||
after = [
|
after = [
|
||||||
"tailscaled.service"
|
"tailscaled.service"
|
||||||
"tailscaled-autoconnect.service"
|
"tailscaled-autoconnect.service"
|
||||||
|
|
@ -51,7 +51,7 @@ in
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
script = ''
|
script = ''
|
||||||
${lib.getExe pkgs.tailscale} cert ${config.networking.fqdn}
|
${lib.getExe pkgs.tailscale} cert ${cfg.subdomain}.${config.networking.domain}
|
||||||
${lib.getExe pkgs.tailscale} serve reset
|
${lib.getExe pkgs.tailscale} serve reset
|
||||||
${lib.getExe pkgs.tailscale} serve --bg ${cfg.serve}
|
${lib.getExe pkgs.tailscale} serve --bg ${cfg.serve}
|
||||||
'';
|
'';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue