From c80f82eecfaa0f4b5f0e02dc6b8a6fd4ad25bfa3 Mon Sep 17 00:00:00 2001 From: LordGrimmauld Date: Sat, 16 Mar 2024 12:19:02 +0100 Subject: [PATCH] portals --- default.nix | 9 ++++++++- modules/portals.nix | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 modules/portals.nix diff --git a/default.nix b/default.nix index 929be2f..6106414 100644 --- a/default.nix +++ b/default.nix @@ -14,13 +14,20 @@ in { printing = mkOption { type = types.bool; - default = true; + default = false; description = "Enables print and scan related options"; }; + + portals = mkOption { + type = types.bool; + default = false; + description = "Enables portals for wlr, gtk and kde as well as fixes fonts"; + }; }; imports = [ ./modules/localisation.nix ./modules/printing.nix + ./modules/portals.nix ]; } diff --git a/modules/portals.nix b/modules/portals.nix new file mode 100644 index 0000000..662a22e --- /dev/null +++ b/modules/portals.nix @@ -0,0 +1,22 @@ +{ config, lib, ... }: let + cfg = config.grimmShared; +in { + config = with cfg; lib.mkIf (enable && portals) { + xdg.portal = { + enable = true; + wlr.enable = true; + extraPortals = with pkgs; [ + xdg-desktop-portal-wlr + xdg-desktop-portal-kde + xdg-desktop-portal-gtk + ]; + }; + + environment.sessionVariables = { + XDG_CONFIG_HOME = "$HOME/.config"; + FREETYPE_PROPERTIES="cff:no-stem-darkening=0 autofitter:no-stem-darkening=0"; + }; + + fonts.fontDir.enable = true; + }; +}