From f860f0b9848c4dbbd739d8c3e4374de83f9657dd Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sun, 7 Jul 2019 19:15:47 +0200 Subject: [PATCH] vscode: fix configuration path for Darwin Fixes #737 --- modules/programs/vscode.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/programs/vscode.nix b/modules/programs/vscode.nix index 0ebbb8eb1..3a82816f5 100644 --- a/modules/programs/vscode.nix +++ b/modules/programs/vscode.nix @@ -6,6 +6,12 @@ let cfg = config.programs.vscode; + configFilePath = + if pkgs.stdenv.hostPlatform.isDarwin then + "Library/Application Support/Code/User/settings.json" + else + "${config.xdg.configHome}/Code/User/settings.json"; + in { @@ -23,8 +29,8 @@ in } ''; description = '' - Configuration written to - ~/.config/Code/User/settings.json. + Configuration written to Visual Studio Code's + settings.json. ''; }; @@ -47,7 +53,6 @@ in }) ]; - xdg.configFile."Code/User/settings.json".text = - builtins.toJSON cfg.userSettings; + home.file."${configFilePath}".text = builtins.toJSON cfg.userSettings; }; }