refactor: moved modules to legacy-modules
This commit is contained in:
parent
d646b954ac
commit
db7ac35613
233 changed files with 5 additions and 5 deletions
|
|
@ -1,49 +0,0 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
options.programs.vscode.profiles = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submodule ({config, ...}: {
|
||||
options = {
|
||||
extraExtensions.openDyslexicFont = {
|
||||
enable = lib.mkEnableOption "should OpenDyslexic font be set as the default font for VSCode";
|
||||
package = lib.mkPackageOption pkgs "nerd-fonts.open-dyslexic" {
|
||||
default = ["nerd-fonts" "open-dyslexic"];
|
||||
};
|
||||
};
|
||||
};
|
||||
config = lib.mkIf config.extraExtensions.openDyslexicFont.enable {
|
||||
userSettings = {
|
||||
"editor.fontFamily" = "'OpenDyslexicM Nerd Font Mono', Droid Sans Mono, monospace";
|
||||
"editor.fontSize" = 14;
|
||||
"editor.letterSpacing" = -0.3;
|
||||
};
|
||||
};
|
||||
}));
|
||||
};
|
||||
|
||||
config = let
|
||||
enabledProfiles =
|
||||
lib.filter (profile: profile.extraExtensions.openDyslexicFont.enable or false)
|
||||
(lib.attrValues config.programs.vscode.profiles);
|
||||
|
||||
anyProfileUsesOpenDyslexicFont = enabledProfiles != [];
|
||||
|
||||
fontPackages = lib.unique (map (profile: profile.extraExtensions.openDyslexicFont.package) enabledProfiles);
|
||||
in {
|
||||
# Ensure OpenDyslexic font packages are installed when any VSCode profile uses them
|
||||
home.packages = fontPackages;
|
||||
|
||||
fonts.fontconfig.enable = lib.mkIf anyProfileUsesOpenDyslexicFont true;
|
||||
|
||||
# Add assertion to ensure the fonts are available
|
||||
assertions =
|
||||
map (fontPkg: {
|
||||
assertion = lib.elem fontPkg config.home.packages;
|
||||
message = "OpenDyslexic font package '${fontPkg.name or "unknown"}' must be installed when using openDyslexicFont extension for VSCode.";
|
||||
})
|
||||
fontPackages;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue