From ded6790dcf932b5871596781275a1e41b95f07f4 Mon Sep 17 00:00:00 2001 From: ChaotiCryptidz Date: Wed, 9 Mar 2022 21:11:42 +0000 Subject: [PATCH] maybe darwin --- home/programming/editors/vscode.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/home/programming/editors/vscode.nix b/home/programming/editors/vscode.nix index df083a9..337bf24 100644 --- a/home/programming/editors/vscode.nix +++ b/home/programming/editors/vscode.nix @@ -1,6 +1,10 @@ -{ config, pkgs, ... }: - -{ +{ config, pkgs, ... }: let + configDir = "Code"; + userDir = if pkgs.stdenv.hostPlatform.isDarwin then + "Library/Application Support/${configDir}/User" + else + "${config.xdg.configHome}/${configDir}/User"; +in { programs.vscode = { enable = true; userSettings = { @@ -24,7 +28,7 @@ after = [ "writeBoundary" ]; before = [ ]; data = '' - vscodeDir=$HOME/.config/Code/User + vscodeDir=$HOME/${userDir} $DRY_RUN_CMD cat $vscodeDir/settings.json > $vscodeDir/settings_whatever.json $DRY_RUN_CMD rm -f $vscodeDir/settings.json $DRY_RUN_CMD cp $vscodeDir/settings_whatever.json $vscodeDir/settings.json