Files
dotfiles/modules/home/tailscale.nix
uttarayan21 13dedfa654 feat: Added stuff from steamdeck
Signed-off-by: uttarayan21 <email@uttarayan.me>
2025-05-04 05:53:14 +05:30

29 lines
713 B
Nix

{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.services.tailscale;
in {
options = {
services.tailscale = {
enable = mkEnableOption "tailscale";
package = mkPackageOption pkgs "tailscale" {};
};
};
config = {
home.packages = mkIf cfg.enable [cfg.package];
# This doesn't work since we don't have root
home.activation.copyTailscaledService = mkIf cfg.enable (let
tailscaleService = "${cfg.package}/lib/systemd/system/tailscaled.service";
in
lib.hm.dag.entryAfter ["installPackages"] ''
verboseEcho Copying the tailscale systemd files to /etc
run cp ${tailscaleService} /etc/systemd/system/tailscaled.service
'');
};
}