2024-04-10 16:51:28 +02:00
|
|
|
{ pkgs, config, lib, ... }:
|
|
|
|
let
|
2024-03-24 16:59:47 +01:00
|
|
|
cfg = config.grimmShared;
|
2024-04-10 16:51:28 +02:00
|
|
|
in
|
|
|
|
{
|
2024-03-24 16:59:47 +01:00
|
|
|
config = with cfg; lib.mkIf (enable && portals) {
|
2024-04-16 13:56:26 +02:00
|
|
|
xdg.icons.enable = true;
|
2024-04-27 14:20:48 +02:00
|
|
|
xdg.sounds.enable = lib.mkIf sound.enable true;
|
2024-04-16 13:56:26 +02:00
|
|
|
|
2024-03-24 16:59:47 +01:00
|
|
|
xdg.portal = {
|
|
|
|
enable = true;
|
2024-04-27 14:20:48 +02:00
|
|
|
xdgOpenUsePortal = true;
|
2024-03-24 16:59:47 +01:00
|
|
|
extraPortals = with pkgs; [
|
|
|
|
xdg-desktop-portal-wlr
|
|
|
|
xdg-desktop-portal-kde
|
|
|
|
xdg-desktop-portal-gtk
|
|
|
|
];
|
2024-04-11 10:56:21 +02:00
|
|
|
|
2024-04-11 23:12:08 +02:00
|
|
|
wlr.enable = true;
|
2024-05-02 14:02:35 +02:00
|
|
|
wlr.settings = with lib; mapAttrs'
|
|
|
|
(name: value: nameValuePair ("screencast_" + name) {
|
2024-04-11 10:56:21 +02:00
|
|
|
output_name = value.id;
|
2024-05-02 14:02:35 +02:00
|
|
|
max_fps = if isInt value.fps then value.fps else (foldl' min 2147483647 value.fps);
|
2024-04-11 10:56:21 +02:00
|
|
|
chooser_type = "simple";
|
2024-05-02 14:02:35 +02:00
|
|
|
chooser_cmd = "${getExe pkgs.slurp} -f %o -or";
|
2024-04-11 10:56:21 +02:00
|
|
|
})
|
|
|
|
cfg.screens;
|
2024-03-24 16:59:47 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
environment.sessionVariables = {
|
|
|
|
XDG_CONFIG_HOME = "$HOME/.config";
|
|
|
|
};
|
|
|
|
|
2024-04-11 23:12:08 +02:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
xwaylandvideobridge
|
|
|
|
];
|
2024-03-24 16:59:47 +01:00
|
|
|
};
|
2024-04-16 12:09:17 +02:00
|
|
|
|
2024-04-26 22:03:03 +02:00
|
|
|
options.grimmShared.portals = lib.mkEnableOption "Enables portals for wlr, gtk and kde as well as fixes fonts";
|
2024-03-24 16:59:47 +01:00
|
|
|
}
|