From d06c14e32d7e2a72fc24a3045e521cb14b9e6e5e Mon Sep 17 00:00:00 2001 From: Jo Date: Mon, 23 Dec 2024 18:31:35 +0100 Subject: [PATCH] refactor: move gnome extension config to new home-manager module --- .../jo@puzzlevision/apps/gnome.nix | 29 -------------- modules/home/desktop/gnome/default.nix | 40 +++++++++++++++++++ 2 files changed, 40 insertions(+), 29 deletions(-) create mode 100644 modules/home/desktop/gnome/default.nix diff --git a/homes/x86_64-linux/jo@puzzlevision/apps/gnome.nix b/homes/x86_64-linux/jo@puzzlevision/apps/gnome.nix index 45e567b..a7e3078 100644 --- a/homes/x86_64-linux/jo@puzzlevision/apps/gnome.nix +++ b/homes/x86_64-linux/jo@puzzlevision/apps/gnome.nix @@ -2,37 +2,8 @@ pkgs, ... }: { - home.packages = with pkgs.gnomeExtensions; [ - dash-to-dock - user-themes - blur-my-shell - appindicator - unite - color-picker - clipboard-history - ]; - # Use `dconf watch /` to track stateful changes you are doing, then set them here. dconf.settings = { - "org/gnome/shell" = { - favorite-apps = [ - "org.gnome.Nautilus.desktop" - "obsidian.desktop" - "zen.desktop" - "phpstorm.desktop" - ]; - - enabled-extensions = [ - pkgs.gnomeExtensions.unite.extensionUuid - pkgs.gnomeExtensions.color-picker.extensionUuid - pkgs.gnomeExtensions.clipboard-history.extensionUuid - pkgs.gnomeExtensions.blur-my-shell.extensionUuid - pkgs.gnomeExtensions.user-themes.extensionUuid - pkgs.gnomeExtensions.dash-to-dock.extensionUuid - pkgs.gnomeExtensions.appindicator.extensionUuid - ]; - }; - "org/gnome/desktop/wm/preferences" = { workspace-names = [ "Main" ]; }; diff --git a/modules/home/desktop/gnome/default.nix b/modules/home/desktop/gnome/default.nix new file mode 100644 index 0000000..0a965be --- /dev/null +++ b/modules/home/desktop/gnome/default.nix @@ -0,0 +1,40 @@ +{ + lib, + pkgs, + host, + config, + osConfig, + namespace, + ... +}: with lib; with lib.${namespace}; +let + cfg = config.${host}.desktop.gnome; +in +{ + options.${host}.desktop.gnome = with types; { + extensions = mkOption { + type = listOf package; + default = with pkgs.gnomeExtensions; [ dash-to-dock user-themes blur-my-shell appindicator unite color-picker clipboard-history ]; + example = [ dash-to-dock blur-my-shell ]; + description = "Specify gnome extensions to install."; + }; + favorite-apps = mkOption { + type = listOf string; + default = ["org.gnome.Nautilus.desktop" "obsidian.desktop" "zen.desktop" "dev.zed.Zed.desktop"]; + example = ["org.gnome.Nautilus.desktop" "obsidian.desktop"]; + description = "Specify your favorite apps (sorted left to right)"; + }; + }; + + config = mkIf osConfig.${namespace}.desktop.gnome.enable { + home.packages = cfg.extensions; + + dconf.settings = { + "org/gnome/shell" = { + favorite-apps = cfg.favorite-apps; + enabled-extensions = forEach cfg.extensions (x: x.extensionUuid); + disabled-extensions = []; # Make sure none of our extensions are disabled on system rebuild + }; + }; + }; +}