pinwheel: Add enable option to mullvad module

This commit is contained in:
Alexander Heldt
2024-07-19 12:07:36 +02:00
parent 79d5c1c0d6
commit 83523c73eb
2 changed files with 24 additions and 11 deletions

View File

@@ -21,7 +21,9 @@ in
git.enable = true; git.enable = true;
zsh.enable = true; zsh.enable = true;
openvpn.enable = true; openvpn.enable = true;
mullvad.enable = true;
c.enable = true; c.enable = true;
go.enable = true; go.enable = true;

View File

@@ -1,19 +1,30 @@
{ pkgs, ... }: { pkgs, lib, config, ... }:
let
enabled = config.mod.mullvad.enable;
in
{ {
services.mullvad-vpn = { options = {
enable = true; mod.mullvad = {
package = pkgs.mullvad-vpn; enable = lib.mkEnableOption "enable mullvad module";
};
}; };
age.secrets = { config = lib.mkIf enabled {
"mullvad-device" = { services.mullvad-vpn = {
file = ../../../../secrets/pinwheel/mullvad-device.age; enable = true;
path = "/etc/mullvad-vpn/device.json"; package = pkgs.mullvad-vpn;
}; };
"mullvad-account-history" = { age.secrets = {
file = ../../../../secrets/pinwheel/mullvad-account-history.age; "mullvad-device" = {
path = "/etc/mullvad-vpn/account-history.json"; 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";
};
}; };
}; };
} }