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

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