nix-git/modules/gnome-extensions.nix

62 lines
2.0 KiB
Nix
Raw Normal View History

2023-09-18 21:48:41 +02:00
{ config, pkgs, lib, ... }:
2023-09-05 16:20:15 +02:00
{
2023-09-18 16:39:16 +02:00
# Example: https://github.com/nix-community/home-manager/issues/284#issuecomment-1321199263
2023-09-05 19:26:48 +02:00
# https://the-empire.systems/nixos-gnome-settings-and-keyboard-shortcuts
# https://hoverbear.org/blog/declarative-gnome-configuration-in-nixos/
2023-09-18 16:39:16 +02:00
#
# 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
2023-09-05 19:26:48 +02:00
2023-09-06 19:29:51 +02:00
programs.dconf.enable = true;
2023-09-05 16:23:31 +02:00
users.users.yoda = {
2023-09-05 19:26:48 +02:00
packages = with pkgs.gnomeExtensions; [
caffeine
openweather
2023-09-18 21:48:41 +02:00
] ++ (
if (! config.services.xserver.displayManager.gdm.wayland)
# If on X11.
then [ x11-gestures ]
else []
);
2023-09-05 16:23:31 +02:00
};
# If on X11: Enable dependency of "x11-gestures".
services.touchegg.enable = lib.mkIf (! config.services.xserver.displayManager.gdm.wayland) true;
2023-09-07 14:19:39 +02:00
2023-09-05 17:58:40 +02:00
home-manager.users.yoda = { osConfig, config, pkgs, ... }: {
2023-09-05 19:26:48 +02:00
# TODO: Alternative
# home.packages = with pkgs.gnomeExtensions; [
# caffeine
# openweather
# ];
2023-09-05 16:20:15 +02:00
dconf.settings = {
# Enable GNOME extensions.
2023-09-05 19:26:48 +02:00
"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 []
);
2023-09-05 19:26:48 +02:00
# TODO: Alternative to the above
2023-09-06 19:29:51 +02:00
# enabled-extensions = map (extension: extension.extensionUuid) home.packages;
2023-09-05 19:26:48 +02:00
};
# Configure openweather extension.
"org/gnome/shell/extensions/openweather" = {
city = "49.60113,10.98816>Erlangen>0";
};
2023-09-05 16:20:15 +02:00
};
};
}