2022-07-07 21:16:12 +03:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
2022-07-31 16:11:14 +03:00
|
|
|
let
|
|
|
|
fonts = with pkgs; [
|
|
|
|
cantarell-fonts
|
|
|
|
dejavu_fonts
|
|
|
|
liberation_ttf
|
|
|
|
gyre-fonts
|
|
|
|
source-sans
|
|
|
|
source-code-pro
|
|
|
|
];
|
|
|
|
fontCache = pkgs.makeFontsCache {
|
|
|
|
inherit (pkgs) fontconfig;
|
|
|
|
fontDirectories = fonts;
|
|
|
|
};
|
|
|
|
fontConfigFile = pkgs.writeTextDir "etc/fonts/conf.d/00-nixpak-fonts.conf" ''
|
|
|
|
<?xml version='1.0'?>
|
|
|
|
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
|
|
|
|
<fontconfig>
|
|
|
|
<!-- Font directories -->
|
|
|
|
${lib.concatStringsSep "\n" (map (font: "<dir>${font}</dir>") fonts)}
|
|
|
|
${lib.optionalString (pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform) ''
|
|
|
|
<!-- Pre-generated font caches -->
|
|
|
|
<cachedir>${fontCache}</cachedir>
|
|
|
|
''}
|
|
|
|
</fontconfig>
|
|
|
|
'';
|
|
|
|
fc = pkgs.buildEnv {
|
|
|
|
name = "nixpak-font-env";
|
|
|
|
paths = [
|
|
|
|
fontConfigFile
|
|
|
|
pkgs.fontconfig.out
|
|
|
|
];
|
|
|
|
pathsToLink = "/etc/fonts";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
2022-07-07 21:16:12 +03:00
|
|
|
{
|
|
|
|
config = {
|
|
|
|
dbus.policies = {
|
|
|
|
"${config.flatpak.appId}" = "own";
|
|
|
|
"org.freedesktop.DBus" = "talk";
|
|
|
|
"org.gtk.vfs.*" = "talk";
|
|
|
|
"org.gtk.vfs" = "talk";
|
|
|
|
"ca.desrt.dconf" = "talk";
|
|
|
|
"org.freedesktop.portal.*" = "talk";
|
|
|
|
"org.a11y.Bus" = "talk";
|
|
|
|
};
|
2022-07-07 21:42:36 +03:00
|
|
|
gpu.enable = lib.mkDefault true;
|
2022-07-31 16:11:14 +03:00
|
|
|
gpu.provider = "bundle";
|
2022-12-05 17:53:32 +02:00
|
|
|
locale.enable = true;
|
2022-07-07 21:16:12 +03:00
|
|
|
bubblewrap = {
|
2022-07-07 21:42:36 +03:00
|
|
|
network = lib.mkDefault false;
|
2022-07-07 21:16:12 +03:00
|
|
|
bind.rw = [
|
|
|
|
"$HOME/.cache/fontconfig"
|
2022-07-07 21:27:40 +03:00
|
|
|
"$HOME/.cache/mesa_shader_cache"
|
2022-07-07 21:16:12 +03:00
|
|
|
"$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY"
|
|
|
|
"$XDG_RUNTIME_DIR/at-spi/bus"
|
2022-07-07 21:27:40 +03:00
|
|
|
"$XDG_RUNTIME_DIR/gvfsd"
|
|
|
|
"$XDG_RUNTIME_DIR/pulse"
|
2022-07-07 21:16:12 +03:00
|
|
|
];
|
|
|
|
bind.ro = [
|
2022-07-31 16:11:14 +03:00
|
|
|
[ "${fc}/etc/fonts" "/etc/fonts" ]
|
2022-07-07 21:16:12 +03:00
|
|
|
"$XDG_RUNTIME_DIR/doc"
|
|
|
|
"$HOME/.config/gtk-2.0"
|
|
|
|
"$HOME/.config/gtk-3.0"
|
|
|
|
"$HOME/.config/gtk-4.0"
|
|
|
|
];
|
|
|
|
env = {
|
|
|
|
XDG_DATA_DIRS = lib.makeSearchPath "share" [
|
|
|
|
pkgs.gnome.adwaita-icon-theme
|
|
|
|
pkgs.shared-mime-info
|
|
|
|
];
|
2022-07-31 16:11:14 +03:00
|
|
|
XCURSOR_PATH = lib.concatStringsSep ":" [
|
|
|
|
"${pkgs.gnome.adwaita-icon-theme}/share/icons"
|
|
|
|
"${pkgs.gnome.adwaita-icon-theme}/share/pixmaps"
|
|
|
|
];
|
2022-07-07 21:16:12 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|