mochi/.archive/modules/nixos/de/gnome.nix

114 lines
2.8 KiB
Nix
Raw Permalink Normal View History

2024-10-28 20:33:38 -05:00
{
lib,
config,
pkgs,
...
}:
2024-06-20 08:59:56 -05:00
let
cfg = config.mySystem.de.gnome;
in
{
2024-07-30 18:47:59 -05:00
options = {
mySystem.de.gnome = {
2024-10-28 20:33:38 -05:00
enable = lib.mkEnableOption "GNOME" // {
default = false;
};
systrayicons = lib.mkEnableOption "Enable systray icons" // {
default = true;
};
gsconnect = lib.mkEnableOption "Enable gsconnect (KDEConnect for GNOME)" // {
default = true;
};
2024-07-30 18:47:59 -05:00
};
2024-07-30 18:47:59 -05:00
};
2024-06-20 08:59:56 -05:00
2024-10-28 20:33:38 -05:00
config = lib.mkIf cfg.enable {
2024-06-20 08:59:56 -05:00
# Ref: https://nixos.wiki/wiki/GNOME
# GNOME plz
services = {
displayManager = {
defaultSession = "gnome";
autoLogin = {
enable = false;
user = "jahanson"; # TODO move to config overlay
};
};
xserver = {
enable = true;
xkb.layout = "us"; # `localctl` will give you
displayManager = {
gdm.enable = true;
};
desktopManager = {
# GNOME
gnome.enable = true;
};
};
2024-10-28 20:33:38 -05:00
udev.packages = lib.optionals cfg.systrayicons [ pkgs.gnome.gnome-settings-daemon ]; # support appindicator
2024-06-20 08:59:56 -05:00
};
# systyray icons
# extra pkgs and extensions
environment = {
2024-10-28 20:33:38 -05:00
systemPackages =
with pkgs;
[
wl-clipboard # ls ~/Downloads | wl-copy or wl-paste > clipboard.txt
playerctl # gsconnect play/pause command
pamixer # gcsconnect volume control
gnome.gnome-tweaks
gnome.dconf-editor
2024-06-20 08:59:56 -05:00
2024-10-28 20:33:38 -05:00
# This installs the extension packages, but
# dont forget to enable them per-user in dconf settings -> "org/gnome/shell"
gnomeExtensions.vitals
gnomeExtensions.caffeine
gnomeExtensions.dash-to-dock
]
++ optionals cfg.systrayicons [ pkgs.gnomeExtensions.appindicator ];
2024-06-20 08:59:56 -05:00
};
# enable gsconnect
# this method also opens the firewall ports required when enable = true
2024-10-28 20:33:38 -05:00
programs.kdeconnect = lib.mkIf cfg.gsconnect {
enable = true;
package = pkgs.gnomeExtensions.gsconnect;
};
2024-06-20 08:59:56 -05:00
# GNOME connection to browsers - requires flag on browser as well
2024-10-28 20:33:38 -05:00
services.gnome.gnome-browser-connector.enable = lib.any (user: user.programs.firefox.enable) (
lib.attrValues config.home-manager.users
);
2024-06-20 08:59:56 -05:00
# And dconf
programs.dconf.enable = true;
# Exclude default GNOME packages that dont interest me.
environment.gnome.excludePackages =
(with pkgs; [
gnome-photos
gnome-tour
gedit # text editor
])
++ (with pkgs.gnome; [
cheese # webcam tool
gnome-music
gnome-terminal
epiphany # web browser
geary # email reader
evince # document viewer
gnome-characters
totem # video player
tali # poker game
iagno # go game
hitori # sudoku game
atomix # puzzle game
]);
};
}