nix-git/modules/gnome-extensions.nix

62 lines
2.0 KiB
Nix

{ config, pkgs, lib, ... }:
{
# Example: https://github.com/nix-community/home-manager/issues/284#issuecomment-1321199263
# https://the-empire.systems/nixos-gnome-settings-and-keyboard-shortcuts
# https://hoverbear.org/blog/declarative-gnome-configuration-in-nixos/
#
# Search for packaged extensions: https://search.nixos.org/packages?channel=23.05&from=0&size=50&sort=relevance&type=packages&query=gnomeExtensions
# Add non-packaged extension: https://github.com/nix-community/home-manager/issues/284#issuecomment-531384656
#
# One has to re-login after changes: https://github.com/nix-community/home-manager/issues/284#issuecomment-1328269433
programs.dconf.enable = true;
users.users.yoda = {
packages = with pkgs.gnomeExtensions; [
caffeine
#openweather
] ++ (
if (! config.services.xserver.displayManager.gdm.wayland)
# If on X11.
then [ x11-gestures ]
else []
);
};
# If on X11: Enable dependency of "x11-gestures".
services.touchegg.enable = lib.mkIf (! config.services.xserver.displayManager.gdm.wayland) true;
home-manager.users.yoda = { osConfig, config, pkgs, ... }: {
# TODO: Alternative
# home.packages = with pkgs.gnomeExtensions; [
# caffeine
# openweather
# ];
dconf.settings = {
# Enable GNOME extensions.
"org/gnome/shell" = {
disable-user-extensions = false;
enabled-extensions = [
pkgs.gnomeExtensions.caffeine.extensionUuid
#pkgs.gnomeExtensions.openweather.extensionUuid
] ++ (
if (! osConfig.services.xserver.displayManager.gdm.wayland)
then [
pkgs.gnomeExtensions.x11-gestures.extensionUuid
]
else []
);
# TODO: Alternative to the above
# enabled-extensions = map (extension: extension.extensionUuid) home.packages;
};
# Configure openweather extension.
#"org/gnome/shell/extensions/openweather" = {
# city = "49.60113,10.98816>Erlangen>0";
#};
};
};
}