grimm-nixos-laptop/common/portals.nix
2024-04-26 22:03:03 +02:00

42 lines
1.0 KiB
Nix

{ pkgs, config, lib, ... }:
let
cfg = config.grimmShared;
in
{
config = with cfg; lib.mkIf (enable && portals) {
xdg.icons.enable = true;
xdg.portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-wlr
xdg-desktop-portal-kde
xdg-desktop-portal-gtk
];
wlr.enable = true;
wlr.settings = lib.mapAttrs'
(name: value: lib.nameValuePair ("screencast_" + name) {
output_name = value.id;
max_fps = value.fps;
chooser_type = "simple";
chooser_cmd = "${lib.getExe pkgs.slurp} -f %o -or";
})
cfg.screens;
};
environment.sessionVariables = {
XDG_CONFIG_HOME = "$HOME/.config";
FREETYPE_PROPERTIES = "cff:no-stem-darkening=0 autofitter:no-stem-darkening=0";
};
environment.systemPackages = with pkgs; [
xwaylandvideobridge
];
fonts.fontDir.enable = true;
};
options.grimmShared.portals = lib.mkEnableOption "Enables portals for wlr, gtk and kde as well as fixes fonts";
}