mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +01:00
fontconfig: make fonts accessible when in NixOS module
This commit is contained in:
parent
127e28c7d8
commit
4b7809efff
1 changed files with 28 additions and 10 deletions
|
@ -28,7 +28,8 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enableProfileFonts {
|
config = mkMerge [
|
||||||
|
(mkIf cfg.enableProfileFonts {
|
||||||
xdg.configFile."fontconfig/conf.d/10-nix-profile-fonts.conf".text = ''
|
xdg.configFile."fontconfig/conf.d/10-nix-profile-fonts.conf".text = ''
|
||||||
<?xml version='1.0'?>
|
<?xml version='1.0'?>
|
||||||
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
|
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
|
||||||
|
@ -37,5 +38,22 @@ in
|
||||||
<dir>${config.home.profileDirectory}/share/fonts</dir>
|
<dir>${config.home.profileDirectory}/share/fonts</dir>
|
||||||
</fontconfig>
|
</fontconfig>
|
||||||
'';
|
'';
|
||||||
};
|
})
|
||||||
|
|
||||||
|
# If we are inside a NixOS system configuration then packages are
|
||||||
|
# installed through the NixOS `users.users.<name?>.packages`
|
||||||
|
# option. Unfortunately fontconfig does not know about the
|
||||||
|
# per-user installation directory so we have to add that directory
|
||||||
|
# in a extra configuration file.
|
||||||
|
(mkIf config.submoduleSupport.enable {
|
||||||
|
xdg.configFile."fontconfig/conf.d/10-nix-per-user-fonts.conf".text = ''
|
||||||
|
<?xml version='1.0'?>
|
||||||
|
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
|
||||||
|
<fontconfig>
|
||||||
|
<dir>/etc/profiles/per-user/${config.home.username}/lib/X11/fonts</dir>
|
||||||
|
<dir>/etc/profiles/per-user/${config.home.username}/share/fonts</dir>
|
||||||
|
</fontconfig>
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue