mirror of
https://codeberg.org/muon/home.git
synced 2025-12-06 08:07:45 +00:00
Add tailscale and openvpn
This commit is contained in:
parent
86cf85a517
commit
41f182ca22
4 changed files with 37 additions and 4 deletions
|
|
@ -1,3 +1,21 @@
|
|||
{ pkgs, lib, ... }: {
|
||||
networking.networkmanager.enable = true;
|
||||
{ pkgs, lib, config, ... }: {
|
||||
options.mods = {
|
||||
openvpn.enable = lib.mkEnableOption "enables openvpn config";
|
||||
openvpn.config = let
|
||||
username = "${config.mods.user.name}";
|
||||
folder = "${config.users.users.${username}.home}/documents/openvpn/";
|
||||
file = "${config.mods.user.name}.ovpn";
|
||||
in lib.mkOption {
|
||||
description = "the config location";
|
||||
default = "${folder}${file}";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
networking.networkmanager.enable = true;
|
||||
services.tailscale.enable = true;
|
||||
services.openvpn.servers = lib.mkIf config.mods.openvpn.enable {
|
||||
remote.config = ''config ${config.mods.openvpn.config}'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue