summaryrefslogtreecommitdiff
path: root/modules/nixosModules/desktop/tailscale.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/nixosModules/desktop/tailscale.nix')
-rw-r--r--modules/nixosModules/desktop/tailscale.nix75
1 files changed, 75 insertions, 0 deletions
diff --git a/modules/nixosModules/desktop/tailscale.nix b/modules/nixosModules/desktop/tailscale.nix
new file mode 100644
index 0000000..f2ab9fc
--- /dev/null
+++ b/modules/nixosModules/desktop/tailscale.nix
@@ -0,0 +1,75 @@
+{ lib, ... }: {
+ flake.nixosModules.tailscaleDesktop = { config, ... }: {
+ services.tailscale = {
+ enable = true;
+ useRoutingFeatures = "client";
+ openFirewall = true;
+ };
+
+ networking.firewall = {
+ enable = lib.mkDefault true;
+ trustedInterfaces = [ "tailscale0" ];
+ allowedUDPPorts = [ config.services.tailscale.port ];
+ };
+ };
+
+ flake.nixosModules.nasClient = { pkgs, ... }: {
+ boot.supportedFilesystems = [ "nfs" ];
+
+ environment.systemPackages = with pkgs; [ nfs-utils ];
+
+ fileSystems."/mnt/data" = {
+ device = "100.64.0.2:/tank/data";
+ fsType = "nfs4";
+
+ options = [
+ "x-systemd.automount"
+ "noauto"
+ "nofail"
+ "_netdev"
+
+ "hard"
+ "noatime"
+
+ "x-systemd.mount-timeout=10"
+ "x-systemd.idle-timeout=600"
+ ];
+ };
+
+ fileSystems."/mnt/backups" = {
+ device = "100.64.0.2:/tank/backups";
+ fsType = "nfs4";
+
+ options = [
+ "x-systemd.automount"
+ "noauto"
+ "nofail"
+ "_netdev"
+
+ "hard"
+ "noatime"
+
+ "x-systemd.mount-timeout=10"
+ "x-systemd.idle-timeout=600"
+ ];
+ };
+
+ fileSystems."/mnt/media" = {
+ device = "100.64.0.2:/tank/media";
+ fsType = "nfs4";
+
+ options = [
+ "x-systemd.automount"
+ "noauto"
+ "nofail"
+ "_netdev"
+
+ "hard"
+ "noatime"
+
+ "x-systemd.mount-timeout=10"
+ "x-systemd.idle-timeout=600"
+ ];
+ };
+ };
+}