tailscale

This commit is contained in:
Julian Sutter 2025-08-06 11:10:43 -07:00
parent bf8c3116e8
commit 3cdec3c55c

View file

@ -1,37 +1,21 @@
{ pkgs, ... }:
{
description = "NixOS with Tailscale + Plasma tray";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
services.tailscale = {
enable = true;
openFirewall = true;
extraUpFlags = [ "--ssh" ];
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
in {
nixosConfigurations.my-host = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
({ pkgs, ... }: {
networking.hostName = "my-host";
environment.systemPackages = [ pkgs.tail-tray ]; # or pkgs.trayscale
services.tailscale = {
enable = true;
openFirewall = true;
extraUpFlags = [ "--ssh" ];
};
environment.systemPackages = [ pkgs.tail-tray ];
systemd.user.services.tail-tray = {
description = "Tailscale tray (Plasma)";
wantedBy = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${pkgs.tail-tray}/bin/tail-tray";
Restart = "on-failure";
};
};
})
];
systemd.user.services.tail-tray = {
description = "Tailscale tray (Plasma)";
wantedBy = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${pkgs.tail-tray}/bin/tail-tray";
Restart = "on-failure";
};
};
}