mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +08:00
mullvad-vpn: deduplicate platform-dependent files
This commit is contained in:
committed by
Austin Horstman
parent
e69fbc243a
commit
802ce0a7b1
@@ -7,6 +7,8 @@
|
||||
let
|
||||
cfg = config.programs.mullvad-vpn;
|
||||
jsonFormat = pkgs.formats.json { };
|
||||
configDir =
|
||||
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome;
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ lib.maintainers.da157 ];
|
||||
@@ -42,11 +44,8 @@ in
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
home.file."${
|
||||
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome
|
||||
}/Mullvad VPN/gui_settings.json" =
|
||||
lib.mkIf (cfg.settings != { }) {
|
||||
source = jsonFormat.generate "mullvad-gui-settings" cfg.settings;
|
||||
};
|
||||
home.file."${configDir}/Mullvad VPN/gui_settings.json" = lib.mkIf (cfg.settings != { }) {
|
||||
source = jsonFormat.generate "mullvad-gui-settings" cfg.settings;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user