-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update fonts cache #520
Comments
Currently I use the following hack: {config, pkgs, lib, ...}:
let
cfg = config.fonts;
in
with lib;
{
options = {
fonts.fonts = mkOption {
type = types.listOf types.package;
default = [];
example = literalExample "[ pkgs.dejavu_fonts ]";
description = "List of fonts.";
};
};
config = {
home.packages = cfg.fonts;
home.file."${config.xdg.cacheHome}/hm-fonts" = let
getHash = drv: builtins.elemAt (builtins.match "${builtins.storeDir}/([a-z0-9]{32})-.*.drv" drv.drvPath) 0;
in {
text = concatMapStringsSep "\n" getHash cfg.fonts;
onChange = ''
echo "Caching fonts"
$DRY_RUN_CMD fc-cache -f
'';
};
};
} It just saves a list of hashes of fonts derivations in a file and updates cache when the list changes. @rycee Do you think it'll be useful to include it in some form in home-manager? |
This looks like a good idea to me 👍 |
There is already |
Oh, there is. Makes sense to follow NixOS then. I'd probably have chosen |
Also deprecates the `fonts.fontconfig.enableProfileFonts` option. The configuration is now always generated if `fonts.fontconfig.enable` is set. Fixes #520
Also deprecates the `fonts.fontconfig.enableProfileFonts` option. The configuration is now always generated if `fonts.fontconfig.enable` is set. Fixes #520
Also deprecates the `fonts.fontconfig.enableProfileFonts` option. The configuration is now always generated if `fonts.fontconfig.enable` is set. Fixes #520
Also deprecates the `fonts.fontconfig.enableProfileFonts` option. The configuration is now always generated if `fonts.fontconfig.enable` is set. Fixes #520
If anybody is able to try it out then please have a look at #682, which I believe will resolve this issue. Note, you will have to add
to your configuration for it it take effect. |
Also deprecates the `fonts.fontconfig.enableProfileFonts` option. The configuration is now always generated if `fonts.fontconfig.enable` is set. Fixes #520
When
fonts.fonts = [ ];
list is modified in nixos, it causes fonts cache update. It'd be handy to have such option for fonts installed via home-manager so that you don't need to executefc-cache -f
manually.The text was updated successfully, but these errors were encountered: