From ba1d6fe0fd9e153c73d1014e13778f480007407b Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Tue, 23 Jul 2024 13:04:10 -0400 Subject: [PATCH] home: move gnome config to hm (#59) * base: limit systemd-boot configurations to 10 * home/gnome: cleanup * home/gnome: move extesniosn to hm module * home/gnome: fix nesting * home/gnome: add cs adjuster * nixos/gnome: simplify fprintd fixes * Revert "nixos/gnome: simplify fprintd fixes" This reverts commit 540ba39bf96e7082bc0144af269a762fbbe80251. * home/gnome: enable extensions with dconf * nixos/gnome: update triple buffer overlay hash --- baseModules/default.nix | 1 + homeManagerModules/desktop/gnome/default.nix | 135 +++++++++++-------- hosts/petalburg/default.nix | 2 +- nixosModules/desktop/gnome/default.nix | 36 +---- update_fetchgit.sh | 0 5 files changed, 87 insertions(+), 87 deletions(-) mode change 100644 => 100755 update_fetchgit.sh diff --git a/baseModules/default.nix b/baseModules/default.nix index 8a0dec86..50c14bdd 100644 --- a/baseModules/default.nix +++ b/baseModules/default.nix @@ -2,6 +2,7 @@ self: {lib, ...}: { boot = { consoleLogLevel = 0; initrd.verbose = false; + loader.systemd-boot.configurationLimit = lib.mkDefault 10; plymouth.enable = true; }; diff --git a/homeManagerModules/desktop/gnome/default.nix b/homeManagerModules/desktop/gnome/default.nix index 90075b22..e68bcfd3 100644 --- a/homeManagerModules/desktop/gnome/default.nix +++ b/homeManagerModules/desktop/gnome/default.nix @@ -1,65 +1,92 @@ { - lib, config, + lib, + pkgs, ... }: { config = lib.mkIf config.ar.home.desktop.gnome.enable { - dconf.enable = true; - - dconf.settings = { - "org/gnome/desktop/datetime".automatic-timezone = true; - - "org/gnome/desktop/interface" = { - clock-format = "12h"; - enable-hot-corners = true; - }; - - "org/gnome/desktop/peripherals/touchpad".tap-to-click = true; - "org/gnome/desktop/search-providers".enabled = "['org.gnome.Calendar.desktop', 'org.gnome.Weather.desktop', 'org.gnome.Contacts.desktop', 'org.gnome.Calculator.desktop', 'org.gnome.Characters.desktop', 'org.gnome.clocks.desktop']"; - "org/gnome/desktop/wm/preferences".auto-raise = true; - - "org/gnome/mutter" = { - dynamic-workspaces = true; - edge-tiling = true; - workspaces-only-on-primary = true; - }; - - "org/gnome/settings-daemon/plugins/color" = { - # night-light-enabled = true; - }; - - "org/gnome/shell".enabled-extensions = [ - "appindicatorsupport@rgcjonas.gmail.com" - "blur-my-shell@aunetx" - "gsconnect@andyholmes.github.io" - "nightthemeswitcher@romainvigier.fr" - "noannoyance-fork@vrba.dev" - "tailscale-status@maxgallup.github.com" - "tiling-assistant@leleat-on-github" - "drive-menu@gnome-shell-extensions.gcampax.github.com" - ]; - - "org/gnome/shell/extensions/blur-my-shell/overview".style-components = 3; - - "org/gnome/shell/extensions/blur-my-shell/panel" = { - blur = false; - customize = true; - override-background = false; - override-background-dynamically = false; - style-panel = 0; - unblur-in-overview = true; - }; - - "org/gnome/system/location".enabled = true; - }; - - xdg.mimeApps = { + dconf = { enable = true; - defaultApplications = { - "x-scheme-handler/sms" = "org.gnome.Shell.Extensions.GSConnect.desktop"; - "x-scheme-handler/tel" = "org.gnome.Shell.Extensions.GSConnect.desktop"; + settings = { + "org/gnome/desktop/datetime".automatic-timezone = true; + + "org/gnome/desktop/interface" = { + clock-format = "12h"; + enable-hot-corners = true; + }; + + "org/gnome/desktop/peripherals/touchpad".tap-to-click = true; + "org/gnome/desktop/search-providers".enabled = "['org.gnome.Calendar.desktop', 'org.gnome.Weather.desktop', 'org.gnome.Contacts.desktop', 'org.gnome.Calculator.desktop', 'org.gnome.Characters.desktop', 'org.gnome.clocks.desktop']"; + "org/gnome/desktop/wm/preferences".auto-raise = true; + + "org/gnome/mutter" = { + dynamic-workspaces = true; + edge-tiling = true; + workspaces-only-on-primary = true; + }; + + "org/gnome/shell".enabled-extensions = [ + "appindicatorsupport@rgcjonas.gmail.com" + "blur-my-shell@aunetx" + "gsconnect@andyholmes.github.io" + "nightthemeswitcher@romainvigier.fr" + "noannoyance-fork@vrba.dev" + "tailscale-status@maxgallup.github.com" + "tiling-assistant@leleat-on-github" + "drive-menu@gnome-shell-extensions.gcampax.github.com" + ]; + + "org/gnome/shell/extensions/blur-my-shell/overview".style-components = 3; + + "org/gnome/shell/extensions/blur-my-shell/panel" = { + blur = false; + customize = true; + override-background = false; + override-background-dynamically = false; + style-panel = 0; + unblur-in-overview = true; + }; + + "org/gnome/system/location".enabled = true; }; }; + + home.packages = [ + (pkgs.writeShellScriptBin "gcs-toggle" '' + # Get current color scheme + color_scheme=$(${lib.getExe' pkgs.glib "gsettings"} get org.gnome.desktop.interface color-scheme) + + # Toggle between light and dark color schemes + if [ "$color_scheme" == "'default'" ] || [ "$color_scheme" == "'prefer-light'" ]; then + color_scheme="'prefer-dark'" + else + color_scheme="'prefer-light'" + fi + + # Apply the updated color scheme + ${lib.getExe' pkgs.glib "gsettings"} set org.gnome.desktop.interface color-scheme $color_scheme + '') + ]; + + programs.gnome-shell = { + enable = true; + + extensions = [ + {package = pkgs.gnomeExtensions.appindicator;} + {package = pkgs.gnomeExtensions.blur-my-shell;} + {package = pkgs.gnomeExtensions.gsconnect;} + {package = pkgs.gnomeExtensions.light-shell;} + {package = pkgs.gnomeExtensions.night-theme-switcher;} + {package = pkgs.gnomeExtensions.noannoyance-fork;} + {package = pkgs.gnomeExtensions.tailscale-status;} + {package = pkgs.gnomeExtensions.tiling-assistant;} + ]; + }; + + xdg.mimeApps.defaultApplications = { + "x-scheme-handler/sms" = "org.gnome.Shell.Extensions.GSConnect.desktop"; + "x-scheme-handler/tel" = "org.gnome.Shell.Extensions.GSConnect.desktop"; + }; }; } diff --git a/hosts/petalburg/default.nix b/hosts/petalburg/default.nix index 08336b36..35ae2755 100644 --- a/hosts/petalburg/default.nix +++ b/hosts/petalburg/default.nix @@ -57,7 +57,7 @@ autologin = "aly"; }; - hyprland.enable = true; + gnome.enable = true; }; users.aly = { diff --git a/nixosModules/desktop/gnome/default.nix b/nixosModules/desktop/gnome/default.nix index 6ac2bb2b..0c281c4a 100644 --- a/nixosModules/desktop/gnome/default.nix +++ b/nixosModules/desktop/gnome/default.nix @@ -1,38 +1,10 @@ { - pkgs, - lib, config, + lib, + pkgs, ... -}: let - gnomeCsAdjuster = pkgs.writeShellScriptBin "gnome-cs-adjuster" '' - # Get current color scheme - color_scheme=$(${lib.getExe' pkgs.glib "gsettings"} get org.gnome.desktop.interface color-scheme) - - # Toggle between light and dark color schemes - if [ "$color_scheme" == "'default'" ] || [ "$color_scheme" == "'prefer-light'" ]; then - color_scheme="'prefer-dark'" - else - color_scheme="'prefer-light'" - fi - - # Apply the updated color scheme - ${lib.getExe' pkgs.glib "gsettings"} set org.gnome.desktop.interface color-scheme $color_scheme - ''; -in { +}: { config = lib.mkIf config.ar.desktop.gnome.enable { - environment.systemPackages = - [ - pkgs.gnomeExtensions.appindicator - pkgs.gnomeExtensions.blur-my-shell - pkgs.gnomeExtensions.gsconnect - pkgs.gnomeExtensions.light-shell - pkgs.gnomeExtensions.night-theme-switcher - pkgs.gnomeExtensions.noannoyance-fork - pkgs.gnomeExtensions.tailscale-status - pkgs.gnomeExtensions.tiling-assistant - ] - ++ [gnomeCsAdjuster]; - nixpkgs.overlays = [ # GNOME 46: triple-buffering-v4-46 (final: prev: { @@ -43,7 +15,7 @@ in { owner = "vanvugt"; repo = "mutter"; rev = "triple-buffering-v4-46"; - hash = "sha256-fkPjB/5DPBX06t7yj0Rb3UEuu5b9mu3aS+jhH18+lpI="; + hash = "sha256-nz1Enw1NjxLEF3JUG0qknJgf4328W/VvdMjJmoOEMYs="; }; }); }); diff --git a/update_fetchgit.sh b/update_fetchgit.sh old mode 100644 new mode 100755