praca nad stworzeniem defaultowego profilu, z którego kolejne profile będą dziedziczyć.

This commit is contained in:
installer
2025-06-05 15:48:21 +02:00
parent 1cdac1fd73
commit 644f85194b
10 changed files with 1293 additions and 265 deletions

View File

@@ -0,0 +1,23 @@
{...}: {
# This function merges a default profile with specific overrides
# It takes the default profile settings, extensions, keybindings, etc., and merges them with profile-specific ones
mergeProfile = defaultProfile: specificProfile: {
extensions = (defaultProfile.extensions or []) ++ (specificProfile.extensions or []);
userSettings = (defaultProfile.userSettings or {}) // (specificProfile.userSettings or {});
# Merge keybindings by concatenating arrays
keybindings = (defaultProfile.keybindings or []) ++ (specificProfile.keybindings or []);
languageSnippets =
(defaultProfile.languageSnippets or {})
// (let
snippets = specificProfile.languageSnippets or {};
mergeSnippets = language: defaultSnippets:
if builtins.hasAttr language snippets
then defaultSnippets // snippets.${language}
else defaultSnippets;
in
builtins.mapAttrs mergeSnippets (defaultProfile.languageSnippets or {}));
};
}