mirror of
https://github.com/davegallant/nix-config
synced 2025-08-07 17:32:26 +00:00
Add updated wsl configuration
This commit is contained in:
33
machines/aether/nixos-wsl/modules/tailscale.nix
Normal file
33
machines/aether/nixos-wsl/modules/tailscale.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with builtins;
|
||||
with lib; {
|
||||
options.wsl.tailscale = with types; {
|
||||
enable = mkEnableOption "Tailscale for WSL";
|
||||
};
|
||||
|
||||
config = let
|
||||
cfg = config.wsl.tailscale;
|
||||
in
|
||||
mkIf (config.wsl.enable && cfg.enable) {
|
||||
environment.systemPackages = with pkgs; [
|
||||
tailscale
|
||||
];
|
||||
|
||||
systemd.services.tailscaled = {
|
||||
description = "Tailscale WSL";
|
||||
script = ''
|
||||
${pkgs.tailscale}/bin/tailscaled
|
||||
'';
|
||||
wantedBy = ["multi-user.target"];
|
||||
serviceConfig = {
|
||||
Restart = "on-failure";
|
||||
RestartSec = "30s";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user