diff --git a/nixos/boxes/brix/tailscale-brix.nix b/nixos/boxes/brix/tailscale-brix.nix index 23b51a2d..502a1529 100644 --- a/nixos/boxes/brix/tailscale-brix.nix +++ b/nixos/boxes/brix/tailscale-brix.nix @@ -1,7 +1,10 @@ { config, pkgs, inputs, lib, ... }: -{ - systemd.services.tailscale-autoconnect = { - description = "Automatic connection to Tailscale"; +let + tailscale = inputs.nixpkgs-nixos-unstable.legacyPackages."x86_64-linux".tailscale; +in + { + systemd.services.tailscale-autoconnect = { + description = "Automatic connection to Tailscale"; # make sure tailscale is running before trying to connect to tailscale after = [ "network-pre.target" "tailscale.service" ]; @@ -12,18 +15,18 @@ serviceConfig.Type = "oneshot"; # have the job run this shell script - script = with pkgs; '' + script = '' # wait for tailscaled to settle sleep 2 # check if we are already authenticated to tailscale - status="$(${tailscale}/bin/tailscale status -json | ${jq}/bin/jq -r .BackendState)" + status="$(${tailscale}/bin/tailscale status -json | ${pkgs.jq}/bin/jq -r .BackendState)" if [ $status = "Running" ]; then # if so, then do nothing exit 0 fi # otherwise authenticate with tailscale - ${tailscale}/bin/tailscale up -authkey tskey-abb12c2c0f365cfda4f897c7 + ${tailscale}/bin/tailscale up -authkey tskey-bd6b308c9c22272a0a66c442 ''; }; } diff --git a/nixos/boxes/foureighty/tailscale-foureighty.nix b/nixos/boxes/foureighty/tailscale-foureighty.nix index d76a0673..502a1529 100644 --- a/nixos/boxes/foureighty/tailscale-foureighty.nix +++ b/nixos/boxes/foureighty/tailscale-foureighty.nix @@ -1,7 +1,10 @@ { config, pkgs, inputs, lib, ... }: -{ - systemd.services.tailscale-autoconnect = { - description = "Automatic connection to Tailscale"; +let + tailscale = inputs.nixpkgs-nixos-unstable.legacyPackages."x86_64-linux".tailscale; +in + { + systemd.services.tailscale-autoconnect = { + description = "Automatic connection to Tailscale"; # make sure tailscale is running before trying to connect to tailscale after = [ "network-pre.target" "tailscale.service" ]; @@ -12,18 +15,18 @@ serviceConfig.Type = "oneshot"; # have the job run this shell script - script = with pkgs; '' + script = '' # wait for tailscaled to settle sleep 2 # check if we are already authenticated to tailscale - status="$(${tailscale}/bin/tailscale status -json | ${jq}/bin/jq -r .BackendState)" + status="$(${tailscale}/bin/tailscale status -json | ${pkgs.jq}/bin/jq -r .BackendState)" if [ $status = "Running" ]; then # if so, then do nothing exit 0 fi # otherwise authenticate with tailscale - ${tailscale}/bin/tailscale up -authkey tskey-c1640a3f2a7ea4c7b7d96c39 + ${tailscale}/bin/tailscale up -authkey tskey-bd6b308c9c22272a0a66c442 ''; }; } diff --git a/nixos/boxes/skinnyv/tailscale-skinnyv.nix b/nixos/boxes/skinnyv/tailscale-skinnyv.nix index 23b51a2d..502a1529 100644 --- a/nixos/boxes/skinnyv/tailscale-skinnyv.nix +++ b/nixos/boxes/skinnyv/tailscale-skinnyv.nix @@ -1,7 +1,10 @@ { config, pkgs, inputs, lib, ... }: -{ - systemd.services.tailscale-autoconnect = { - description = "Automatic connection to Tailscale"; +let + tailscale = inputs.nixpkgs-nixos-unstable.legacyPackages."x86_64-linux".tailscale; +in + { + systemd.services.tailscale-autoconnect = { + description = "Automatic connection to Tailscale"; # make sure tailscale is running before trying to connect to tailscale after = [ "network-pre.target" "tailscale.service" ]; @@ -12,18 +15,18 @@ serviceConfig.Type = "oneshot"; # have the job run this shell script - script = with pkgs; '' + script = '' # wait for tailscaled to settle sleep 2 # check if we are already authenticated to tailscale - status="$(${tailscale}/bin/tailscale status -json | ${jq}/bin/jq -r .BackendState)" + status="$(${tailscale}/bin/tailscale status -json | ${pkgs.jq}/bin/jq -r .BackendState)" if [ $status = "Running" ]; then # if so, then do nothing exit 0 fi # otherwise authenticate with tailscale - ${tailscale}/bin/tailscale up -authkey tskey-abb12c2c0f365cfda4f897c7 + ${tailscale}/bin/tailscale up -authkey tskey-bd6b308c9c22272a0a66c442 ''; }; } diff --git a/nixos/boxes/vultr1/tailscale-vultr1.nix b/nixos/boxes/vultr1/tailscale-vultr1.nix index 94a0b90e..502a1529 100644 --- a/nixos/boxes/vultr1/tailscale-vultr1.nix +++ b/nixos/boxes/vultr1/tailscale-vultr1.nix @@ -1,7 +1,10 @@ { config, pkgs, inputs, lib, ... }: -{ - systemd.services.tailscale-autoconnect = { - description = "Automatic connection to Tailscale"; +let + tailscale = inputs.nixpkgs-nixos-unstable.legacyPackages."x86_64-linux".tailscale; +in + { + systemd.services.tailscale-autoconnect = { + description = "Automatic connection to Tailscale"; # make sure tailscale is running before trying to connect to tailscale after = [ "network-pre.target" "tailscale.service" ]; @@ -12,18 +15,18 @@ serviceConfig.Type = "oneshot"; # have the job run this shell script - script = with pkgs; '' + script = '' # wait for tailscaled to settle sleep 2 # check if we are already authenticated to tailscale - status="$(${tailscale}/bin/tailscale status -json | ${jq}/bin/jq -r .BackendState)" + status="$(${tailscale}/bin/tailscale status -json | ${pkgs.jq}/bin/jq -r .BackendState)" if [ $status = "Running" ]; then # if so, then do nothing exit 0 fi # otherwise authenticate with tailscale - ${tailscale}/bin/tailscale up -authkey tskey-d6d3e4b981980045e18d0e64 + ${tailscale}/bin/tailscale up -authkey tskey-bd6b308c9c22272a0a66c442 ''; }; }