mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 00:33:00 +00:00
nix: flatpak fonts & icons
This commit is contained in:
parent
0c6d0edb42
commit
af7c7b49f2
4 changed files with 57 additions and 40 deletions
|
|
@ -3,7 +3,6 @@
|
|||
pkgs,
|
||||
...
|
||||
}: {
|
||||
|
||||
security.pam.services.login.enableGnomeKeyring = true;
|
||||
|
||||
# Use latest kernel.
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
}: let
|
||||
fontPkgs = [
|
||||
pkgs.maple-mono.NF
|
||||
pkgs.sarasa-gothic
|
||||
|
|
@ -14,8 +13,7 @@ let
|
|||
pkgs.noto-fonts-emoji
|
||||
pkgs.nerd-fonts.jetbrains-mono
|
||||
];
|
||||
in
|
||||
{
|
||||
in {
|
||||
environment.systemPackages = fontPkgs;
|
||||
|
||||
fonts = {
|
||||
|
|
@ -29,44 +27,46 @@ in
|
|||
"Maple Mono NF"
|
||||
"JetBrainsMono Nerd Font"
|
||||
];
|
||||
serif = [ "LXGW WenKai" ];
|
||||
sansSerif = [ "LXGW Neo XiHei" ];
|
||||
serif = ["LXGW WenKai"];
|
||||
sansSerif = ["LXGW Neo XiHei"];
|
||||
};
|
||||
};
|
||||
fontDir.enable = true;
|
||||
};
|
||||
|
||||
system.fsPackages = [ pkgs.bindfs ];
|
||||
fileSystems =
|
||||
let
|
||||
mkRoSymBind = path: {
|
||||
device = path;
|
||||
fsType = "fuse.bindfs";
|
||||
options = [
|
||||
"ro"
|
||||
"resolve-symlinks"
|
||||
"x-gvfs-hide"
|
||||
];
|
||||
};
|
||||
aggregated = pkgs.buildEnv {
|
||||
name = "system-fonts-and-icons";
|
||||
paths = fontPkgs; # with pkgs; [
|
||||
# libsForQt5.breeze-qt5
|
||||
|
||||
# noto-fonts
|
||||
# noto-fonts-emoji
|
||||
# noto-fonts-cjk-sans
|
||||
# noto-fonts-cjk-serif
|
||||
# ];
|
||||
pathsToLink = [
|
||||
"/share/fonts"
|
||||
"/share/icons"
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
# Create an FHS mount to support flatpak host icons/fonts
|
||||
"/usr/share/icons" = mkRoSymBind "${aggregated}/share/icons";
|
||||
"/usr/share/fonts" = mkRoSymBind "${aggregated}/share/fonts";
|
||||
system.fsPackages = [pkgs.bindfs];
|
||||
fileSystems = let
|
||||
mkRoSymBind = path: {
|
||||
device = path;
|
||||
fsType = "fuse.bindfs";
|
||||
options = [
|
||||
"ro"
|
||||
"resolve-symlinks"
|
||||
"x-gvfs-hide"
|
||||
];
|
||||
};
|
||||
aggregated = pkgs.buildEnv {
|
||||
name = "system-fonts-and-icons";
|
||||
paths =
|
||||
fontPkgs
|
||||
++ [
|
||||
# Add cursor supports
|
||||
pkgs.libsForQt5.breeze-qt5
|
||||
]; # with pkgs; [
|
||||
# libsForQt5.breeze-qt5
|
||||
|
||||
# noto-fonts
|
||||
# noto-fonts-emoji
|
||||
# noto-fonts-cjk-sans
|
||||
# noto-fonts-cjk-serif
|
||||
# ];
|
||||
pathsToLink = [
|
||||
"/share/fonts"
|
||||
"/share/icons"
|
||||
];
|
||||
};
|
||||
in {
|
||||
"/usr/share/icons" = mkRoSymBind "${aggregated}/share/icons";
|
||||
"/usr/share/fonts" = mkRoSymBind "${aggregated}/share/fonts";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,5 +9,8 @@
|
|||
tmux
|
||||
wl-clipboard
|
||||
nix-index
|
||||
file
|
||||
unzip
|
||||
zip
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
# https://github.com/gmodena/nix-flatpak
|
||||
{...}: {
|
||||
{nix-flatpak, ...}: {
|
||||
services.flatpak.enable = true;
|
||||
services.flatpak.remotes = [
|
||||
{
|
||||
name = "flathub";
|
||||
|
|
@ -24,8 +25,22 @@
|
|||
"com.getpostman.Postman"
|
||||
];
|
||||
services.flatpak.overrides = {
|
||||
global = {
|
||||
Context = {
|
||||
# Force wayland by default
|
||||
sockets = ["wayland" "!x11" "!fallback-x11"];
|
||||
filesystems = [
|
||||
"/run/current-system/sw/share/fonts:ro"
|
||||
"xdg-config/fontconfig:ro"
|
||||
# "xdg-data/fonts:ro"
|
||||
];
|
||||
};
|
||||
};
|
||||
"com.qq.QQ".Context.sockets = ["x11"];
|
||||
"com.tencent.WeChat" = {
|
||||
Context.sockets = ["x11"];
|
||||
Environment = {
|
||||
# WeChat does not support wayland & wayland-ime
|
||||
QT_IM_MODULE = "fcitx";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue