fontconfig: make fonts accessible when in NixOS module
This commit is contained in:
parent
127e28c7d8
commit
4b7809efff
|
@ -28,14 +28,32 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enableProfileFonts {
|
config = mkMerge [
|
||||||
xdg.configFile."fontconfig/conf.d/10-nix-profile-fonts.conf".text = ''
|
(mkIf cfg.enableProfileFonts {
|
||||||
<?xml version='1.0'?>
|
xdg.configFile."fontconfig/conf.d/10-nix-profile-fonts.conf".text = ''
|
||||||
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
|
<?xml version='1.0'?>
|
||||||
<fontconfig>
|
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
|
||||||
<dir>${config.home.profileDirectory}/lib/X11/fonts</dir>
|
<fontconfig>
|
||||||
<dir>${config.home.profileDirectory}/share/fonts</dir>
|
<dir>${config.home.profileDirectory}/lib/X11/fonts</dir>
|
||||||
</fontconfig>
|
<dir>${config.home.profileDirectory}/share/fonts</dir>
|
||||||
'';
|
</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