From 2edf3980f003e519559d7a54d873a0b49b4162d4 Mon Sep 17 00:00:00 2001 From: Alexander Heldt Date: Thu, 12 Sep 2024 15:32:58 +0200 Subject: [PATCH] pinwheel: Remove `mullvad` --- hosts/pinwheel/modules/default.nix | 1 - hosts/pinwheel/modules/mullvad/default.nix | 35 ------------- hosts/pinwheel/modules/waybar/default.nix | 58 ---------------------- secrets/secrets.nix | 2 - 4 files changed, 96 deletions(-) delete mode 100644 hosts/pinwheel/modules/mullvad/default.nix diff --git a/hosts/pinwheel/modules/default.nix b/hosts/pinwheel/modules/default.nix index 8bc8eff..f24c910 100644 --- a/hosts/pinwheel/modules/default.nix +++ b/hosts/pinwheel/modules/default.nix @@ -27,7 +27,6 @@ in zsh.enable = true; openvpn.enable = true; - mullvad.enable = true; c.enable = true; go.enable = true; diff --git a/hosts/pinwheel/modules/mullvad/default.nix b/hosts/pinwheel/modules/mullvad/default.nix deleted file mode 100644 index 3d226bf..0000000 --- a/hosts/pinwheel/modules/mullvad/default.nix +++ /dev/null @@ -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"; - }; - }; - }; -} diff --git a/hosts/pinwheel/modules/waybar/default.nix b/hosts/pinwheel/modules/waybar/default.nix index 9c8862c..b6a8053 100644 --- a/hosts/pinwheel/modules/waybar/default.nix +++ b/hosts/pinwheel/modules/waybar/default.nix @@ -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}; } diff --git a/secrets/secrets.nix b/secrets/secrets.nix index a42a7e7..0923d5b 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -7,8 +7,6 @@ let in { "pinwheel/syncthing-cert.age".publicKeys = [ pinwheel alex ]; "pinwheel/syncthing-key.age".publicKeys = [ pinwheel alex ]; - "pinwheel/mullvad-device.age".publicKeys = [ pinwheel alex ]; - "pinwheel/mullvad-account-history.age".publicKeys = [ pinwheel alex ]; "pinwheel/tailscale-preferred-exit-node.age".publicKeys = [ pinwheel alex ]; "pinwheel/alex.pinwheel-backwards.age".publicKeys = [ pinwheel alex ]; "pinwheel/alex.pinwheel-backwards.pub.age".publicKeys = [ pinwheel backwards alex ];