mirror of
https://github.com/callumio/nixfiles.git
synced 2026-08-06 20:49:17 +01:00
move aspects into folder
This commit is contained in:
parent
bcf0553529
commit
8229eb8fba
8 changed files with 2 additions and 2 deletions
42
modules/aspects/tailscale.nix
Normal file
42
modules/aspects/tailscale.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{ ... }:
|
||||
{
|
||||
flake.nixosModules.tailscale =
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.c.services.mesh;
|
||||
in
|
||||
{
|
||||
options.c.services.mesh = {
|
||||
enable = mkEnableOption "Enable tailscale daemon.";
|
||||
exitNode = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Enable advertising as an exit node.";
|
||||
};
|
||||
keyFile = mkOption {
|
||||
type = types.path;
|
||||
description = "Path to key file.";
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
authKeyFile = cfg.keyFile;
|
||||
extraUpFlags = [
|
||||
"--login-server"
|
||||
"https://mesh.cleslie.uk"
|
||||
];
|
||||
extraSetFlags = [ (mkIf cfg.exitNode "--advertise-exit-node") ];
|
||||
};
|
||||
networking.firewall = {
|
||||
trustedInterfaces = [ config.services.tailscale.interfaceName ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue