treewide: replace attrs by formats or types.anything

This commit is contained in:
Nicolas Berbiche 2020-11-29 21:54:55 -05:00
parent c1faa848c5
commit 44f9d68d8c
No known key found for this signature in database
GPG key ID: F3308ADE984B83CB
20 changed files with 134 additions and 64 deletions

View file

@ -8,6 +8,8 @@ let
vscodePname = cfg.package.pname;
jsonFormat = pkgs.formats.json { };
configDir = {
"vscode" = "Code";
"vscode-insiders" = "Code - Insiders";
@ -46,7 +48,7 @@ in {
};
userSettings = mkOption {
type = types.attrs;
type = jsonFormat.type;
default = { };
example = literalExample ''
{
@ -125,10 +127,10 @@ in {
toSymlink = concatMap toPaths cfg.extensions;
in foldr (a: b: a // b) {
"${configFilePath}" = mkIf (cfg.userSettings != { }) {
text = builtins.toJSON cfg.userSettings;
source = jsonFormat.generate "vscode-user-settings" cfg.userSettings;
};
"${keybindingsFilePath}" = mkIf (cfg.keybindings != [ ]) {
text = builtins.toJSON cfg.keybindings;
source = jsonFormat.generate "vscode-keybindings" cfg.keybindings;
};
} toSymlink;
};