Compare commits
2 Commits
b4653b20a2
...
bd92076291
Author | SHA1 | Date | |
---|---|---|---|
bd92076291 | |||
9cbe774c5a |
|
@ -30,6 +30,30 @@ let
|
||||||
nerdfontPkgs = builtins.map
|
nerdfontPkgs = builtins.map
|
||||||
(f: pkgs.nerdfonts.override { fonts = [ f ]; })
|
(f: pkgs.nerdfonts.override { fonts = [ f ]; })
|
||||||
wantedNerdfonts;
|
wantedNerdfonts;
|
||||||
|
|
||||||
|
# see: <repo:nixos/nixpkgs:nixos/modules/config/fonts/fontconfig.nix>
|
||||||
|
# and: <repo:nixos/nixpkgs:pkgs/development/libraries/fontconfig/make-fonts-cache.nix>
|
||||||
|
# nixpkgs creates a fontconfig cache, but only when *not* cross compiling.
|
||||||
|
# but the alternative is that fonts are cached purely at runtime, in ~/.cache/fontconfig,
|
||||||
|
# and that needs to either be added to the sandbox of *every* app,
|
||||||
|
# or font-heavy apps are several *seconds* slower to launch.
|
||||||
|
#
|
||||||
|
# TODO: upstream this into `make-fonts-cache.nix`?
|
||||||
|
cache = (pkgs.makeFontsCache { fontDirectories = config.fonts.packages; }).overrideAttrs (upstream: {
|
||||||
|
buildCommand = lib.replaceStrings
|
||||||
|
[ "fc-cache" ]
|
||||||
|
[ "${pkgs.stdenv.hostPlatform.emulator pkgs.buildPackages} ${pkgs.fontconfig.bin}/bin/fc-cache" ]
|
||||||
|
upstream.buildCommand
|
||||||
|
;
|
||||||
|
});
|
||||||
|
cacheConf = pkgs.writeTextDir "etc/fonts/conf.d/01-nixos-cache-cross.conf" ''
|
||||||
|
<?xml version='1.0'?>
|
||||||
|
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
|
||||||
|
<fontconfig>
|
||||||
|
<!-- Pre-generated font caches -->
|
||||||
|
<cachedir>${cache}</cachedir>
|
||||||
|
</fontconfig>
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
sane.programs.fontconfig = {
|
sane.programs.fontconfig = {
|
||||||
|
@ -64,6 +88,8 @@ in
|
||||||
"DejaVu Sans"
|
"DejaVu Sans"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
# nixpkgs builds a cache file, but only for non-cross. i want it always, so add my own cache -- but ONLY for cross.
|
||||||
|
fontconfig.confPackages = lib.mkIf (pkgs.stdenv.hostPlatform != pkgs.stdenv.buildPlatform) [ cacheConf ];
|
||||||
#vvv enables dejavu_fonts, freefont_ttf, gyre-fonts, liberation_ttf, unifont, noto-fonts-emoji
|
#vvv enables dejavu_fonts, freefont_ttf, gyre-fonts, liberation_ttf, unifont, noto-fonts-emoji
|
||||||
enableDefaultPackages = false;
|
enableDefaultPackages = false;
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
|
|
|
@ -215,7 +215,7 @@ dispatchOn() {
|
||||||
|
|
||||||
dispatchInhibited() {
|
dispatchInhibited() {
|
||||||
case "$action" in
|
case "$action" in
|
||||||
"power_hold")
|
"power_tap_1_hold")
|
||||||
# power hold: escape hatch in case rofi has hung
|
# power hold: escape hatch in case rofi has hung
|
||||||
handleWith killall -9 rofi
|
handleWith killall -9 rofi
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user