feat: add wireguard client config for vpn.dryb.org
This commit is contained in:
parent
5d47e3f94a
commit
9400db3cb6
6 changed files with 96 additions and 34 deletions
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, nixosConfig, ... }:
|
||||
{ pkgs, nixosConfig, lib, ... }:
|
||||
let
|
||||
check-battery = pkgs.writeShellScript "check-battery" ''
|
||||
bat=/sys/class/power_supply/BAT0
|
||||
|
|
@ -18,18 +18,18 @@ let
|
|||
rm $FILE
|
||||
fi
|
||||
'';
|
||||
tailscale-status = pkgs.writeShellScript "tailscale-status" ''
|
||||
if ${nixosConfig.services.tailscale.package}/bin/tailscale status > /dev/null 2>&1; then
|
||||
vpn-dryb-org-status = pkgs.writeShellScript "vpn-dryb-org-status" ''
|
||||
if ${nixosConfig.systemd.package}/bin/systemctl is-active wg-quick-vpn.dryb.org > /dev/null 2>&1; then
|
||||
echo " "
|
||||
else
|
||||
echo " "
|
||||
fi
|
||||
'';
|
||||
tailscale-toggle = pkgs.writeShellScript "tailscale-toggle" ''
|
||||
if ${nixosConfig.services.tailscale.package}/bin/tailscale status > /dev/null 2>&1; then
|
||||
pkexec ${nixosConfig.services.tailscale.package}/bin/tailscale down
|
||||
vpn-dryb-org-toggle = pkgs.writeShellScript "vpn-dryb-org-toggle" ''
|
||||
if ${nixosConfig.systemd.package}/bin/systemctl is-active wg-quick-vpn.dryb.org > /dev/null 2>&1; then
|
||||
pkexec ${nixosConfig.systemd.package}/bin/systemctl stop wg-quick-vpn.dryb.org
|
||||
else
|
||||
pkexec ${nixosConfig.services.tailscale.package}/bin/tailscale up --accept-routes --exit-node=j4m35-bl0nd
|
||||
pkexec ${nixosConfig.systemd.package}/bin/systemctl start wg-quick-vpn.dryb.org
|
||||
fi
|
||||
'';
|
||||
in
|
||||
|
|
@ -133,6 +133,7 @@ in
|
|||
"modules-right": [
|
||||
"tray",
|
||||
"network",
|
||||
${lib.optionalString (nixosConfig.bchmnn.collections.vpn.enable && nixosConfig.bchmnn.collections.vpn.dryborg.enable) "custom/vpndryborg,"}
|
||||
"custom/separator",
|
||||
"pulseaudio",
|
||||
"custom/separator",
|
||||
|
|
@ -151,19 +152,19 @@ in
|
|||
"name": "swaybar",
|
||||
"network": {
|
||||
"format": "{ifname}",
|
||||
"format-disconnected": " ",
|
||||
"format-ethernet": "eth ",
|
||||
"format-wifi": "{signalStrength}% ",
|
||||
"format-disconnected": "",
|
||||
"format-ethernet": "eth ",
|
||||
"format-wifi": "{signalStrength}% ",
|
||||
"interval": 1,
|
||||
"tooltip-format": "{ifname} via {gwaddr} ",
|
||||
"tooltip-format": "{ifname} via {gwaddr} ",
|
||||
"tooltip-format-disconnected": "Disconnected",
|
||||
"tooltip-format-ethernet": "{ifname} ",
|
||||
"tooltip-format-wifi": "{essid} ({signalStrength}%) "
|
||||
"tooltip-format-ethernet": "{ifname} ",
|
||||
"tooltip-format-wifi": "{essid} ({signalStrength}%) "
|
||||
},
|
||||
"custom/tailscale": {
|
||||
"exec": "${tailscale-status}",
|
||||
"interval": 1,
|
||||
"on-click": "${tailscale-toggle}",
|
||||
"custom/vpndryborg": {
|
||||
"exec": "${vpn-dryb-org-status}",
|
||||
"interval": 10,
|
||||
"on-click": "${vpn-dryb-org-toggle}",
|
||||
},
|
||||
"pulseaudio": {
|
||||
"format": "{volume}% {icon} {format_source}",
|
||||
|
|
@ -301,7 +302,7 @@ in
|
|||
background: transparent;
|
||||
}
|
||||
|
||||
window.swaybar #custom-tailscale {
|
||||
window.swaybar #custom-vpndryborg {
|
||||
padding-right: 6px;
|
||||
transition: none;
|
||||
color: black;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue