pinwheel: Remove mullvad
This commit is contained in:
@@ -27,7 +27,6 @@ in
|
||||
zsh.enable = true;
|
||||
|
||||
openvpn.enable = true;
|
||||
mullvad.enable = true;
|
||||
|
||||
c.enable = true;
|
||||
go.enable = true;
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
enabled = config.mod.mullvad.enable;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
mod.mullvad = {
|
||||
enable = lib.mkEnableOption "enable mullvad module";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf enabled {
|
||||
services.mullvad-vpn = {
|
||||
enable = true;
|
||||
package = pkgs.mullvad-vpn;
|
||||
};
|
||||
|
||||
age.secrets = {
|
||||
"mullvad-device" = {
|
||||
file = ../../../../secrets/pinwheel/mullvad-device.age;
|
||||
path = "/etc/mullvad-vpn/device.json";
|
||||
};
|
||||
|
||||
"mullvad-account-history" = {
|
||||
file = ../../../../secrets/pinwheel/mullvad-account-history.age;
|
||||
path = "/etc/mullvad-vpn/account-history.json";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -84,52 +84,6 @@ let
|
||||
esac
|
||||
'';
|
||||
|
||||
mullvad = pkgs.writeShellScript "mullvad" ''
|
||||
STATUS_DISCONNECTING="Disconnecting"
|
||||
STATUS_DISCONNECTED="Disconnected"
|
||||
STATUS_CONNECTING="Connecting"
|
||||
STATUS_CONNECTED="Connected"
|
||||
|
||||
status() {
|
||||
STATUS=$(${pkgs.mullvad}/bin/mullvad status | ${pkgs.gawk}/bin/awk 'NR==1{print $1}')
|
||||
echo $STATUS
|
||||
}
|
||||
|
||||
output() {
|
||||
case $(status) in
|
||||
$STATUS_DISCONNECTED)
|
||||
echo '{ "text": "", "class": "disconnected" }' ;;
|
||||
$STATUS_CONNECTING)
|
||||
echo '{ "text": "", "tooltip": "Connecting", "class": "disconnected" }' ;;
|
||||
$STATUS_CONNECTED)
|
||||
TOOLTIP=$(${pkgs.mullvad}/bin/mullvad status | ${pkgs.gawk}/bin/awk 'NR==1')
|
||||
echo "{ \"text\": \"\", \"tooltip\":\"$TOOLTIP\" }" ;;
|
||||
$STATUS_DISCONNECTING)
|
||||
echo '{ "text": "", "tooltip": "Disconnecting", "class": "disconnected" }' ;;
|
||||
*)
|
||||
echo '{ "text": "", "tooltip": "Status unknown", "class": "disconnected" }' ;;
|
||||
esac
|
||||
}
|
||||
|
||||
toggle() {
|
||||
CURRENT_STATUS=$(status)
|
||||
|
||||
case "$CURRENT_STATUS" in
|
||||
$STATUS_DISCONNECTED)
|
||||
${pkgs.mullvad}/bin/mullvad connect --wait > /dev/null && ${pkgs.libnotify}/bin/notify-send "Connected to VPN";;
|
||||
$STATUS_CONNECTED)
|
||||
${pkgs.mullvad}/bin/mullvad disconnect --wait > /dev/null && ${pkgs.libnotify}/bin/notify-send "Disconnected from VPN";;
|
||||
esac
|
||||
}
|
||||
|
||||
case $1 in
|
||||
--toggle)
|
||||
toggle ;;
|
||||
--output)
|
||||
output ;;
|
||||
esac
|
||||
'';
|
||||
|
||||
work-vpn-status = pkgs.writeShellScript "work-vpn-status" ''
|
||||
STAGING=$(systemctl is-active openvpn-work-staging.service)
|
||||
[ "$STAGING" == "active" ] && echo "WORK-VPN STAGING ON" && exit 0
|
||||
@@ -175,7 +129,6 @@ in
|
||||
"custom/spotify"
|
||||
"custom/container-status"
|
||||
"custom/dunst"
|
||||
"custom/mullvad"
|
||||
"bluetooth"
|
||||
"wireplumber"
|
||||
"custom/tailscale"
|
||||
@@ -216,13 +169,6 @@ in
|
||||
interval = 2;
|
||||
};
|
||||
|
||||
"custom/mullvad" = {
|
||||
exec = "${mullvad} --output";
|
||||
return-type = "json";
|
||||
on-click-right = "${mullvad} --toggle";
|
||||
interval = 2;
|
||||
};
|
||||
|
||||
bluetooth = {
|
||||
"format-off" = "";
|
||||
"format-on" = "";
|
||||
@@ -339,10 +285,6 @@ in
|
||||
color: #${config.lib.colors.warning};
|
||||
}
|
||||
|
||||
#custom-mullvad.disconnected {
|
||||
color: #${config.lib.colors.warning};
|
||||
}
|
||||
|
||||
#custom-work-vpn-status {
|
||||
color: #${config.lib.colors.warning};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user