make vscode's configuration file writable at runtime
This commit is contained in:
parent
92ed8a4d48
commit
1ced704a40
1 changed files with 24 additions and 2 deletions
|
@ -1,7 +1,26 @@
|
||||||
{ pkgs, system, inputs, ... }: {
|
{ pkgs, config, system, inputs, ... }: rec {
|
||||||
|
|
||||||
|
# Make VSCode config writable
|
||||||
|
# https://github.com/nix-community/home-manager/issues/1800#issuecomment-2262881846
|
||||||
|
home.activation.makeVSCodeConfigWritable = let
|
||||||
|
configDirName = {
|
||||||
|
"vscode" = "Code";
|
||||||
|
"vscode-insiders" = "Code - Insiders";
|
||||||
|
"vscodium" = "VSCodium";
|
||||||
|
}.${programs.vscode.package.pname};
|
||||||
|
configPath = "${config.xdg.configHome}/${configDirName}/User/settings.json";
|
||||||
|
in {
|
||||||
|
after = [ "writeBoundary" ];
|
||||||
|
before = [ ];
|
||||||
|
data = ''
|
||||||
|
install -m 0640 "$(readlink ${configPath})" ${configPath}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
programs.vscode = {
|
programs.vscode = {
|
||||||
enable = true;
|
enable = true;
|
||||||
#package = pkgs.vscode.fhsWithPackages (ps: [ ]);
|
package = pkgs.vscode.fhsWithPackages
|
||||||
|
(ps: with pkgs; [ dotnetCorePackages.sdk_8_0 mypy ]);
|
||||||
extensions =
|
extensions =
|
||||||
with inputs.nix-vscode-extensions.extensions.${system}.vscode-marketplace;
|
with inputs.nix-vscode-extensions.extensions.${system}.vscode-marketplace;
|
||||||
with inputs.nix-vscode-extensions.extensions.${system}.vscode-marketplace-release; [
|
with inputs.nix-vscode-extensions.extensions.${system}.vscode-marketplace-release; [
|
||||||
|
@ -140,6 +159,9 @@
|
||||||
d-koppenhagen.file-tree-to-text-generator
|
d-koppenhagen.file-tree-to-text-generator
|
||||||
];
|
];
|
||||||
userSettings = {
|
userSettings = {
|
||||||
|
"DO-NOT-EDIT-1" = "This file is managed by the Nix module located at `/etc/nixos/home-manager/vscode.nix`.";
|
||||||
|
"DO-NOT-EDIT-2" = "Changes will be overwritten when VSCode is restarted.";
|
||||||
|
"DO-NOT-EDIT-3" = "To persist changes, edit the module and run `upd` in your terminal.";
|
||||||
"editor.tokenColorCustomizations" = {
|
"editor.tokenColorCustomizations" = {
|
||||||
"[Catppuccin*]" = {
|
"[Catppuccin*]" = {
|
||||||
"variables" = "#82eaf0";
|
"variables" = "#82eaf0";
|
||||||
|
|
Loading…
Reference in a new issue