Last active
August 9, 2022 18:13
-
-
Save pveierland/b8a6068c6a12f972ccc7980d9dbd63c3 to your computer and use it in GitHub Desktop.
VSCode Nix Home Manager Settings Hack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, lib, ... }: | |
let | |
codeSettingsPath = "${config.home.homeDirectory}/.config/Code/User/settings.json"; | |
in | |
{ | |
home.activation.codeSettingsHackRemove = lib.hm.dag.entryBefore [ "checkLinkTargets" ] '' | |
if [ -e "${codeSettingsPath}" ]; then | |
rm -f "${codeSettingsPath}" | |
fi | |
''; | |
home.activation.codeSettingsHackApply = lib.hm.dag.entryAfter [ "linkGeneration" ] '' | |
if [ -L "${codeSettingsPath}" ] && [ -e "${codeSettingsPath}" ]; then | |
cp --remove-destination "$(readlink ${codeSettingsPath})" "${codeSettingsPath}" | |
chmod u+w "${codeSettingsPath}" | |
fi | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment