From 0826ac78e10fedc068abf2ad5f995c4182258121 Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Fri, 22 May 2026 09:52:24 +0200 Subject: [PATCH] feat(dconf): add enable option --- home/hosts/work/default.nix | 1 + home/modules/dconf/default.nix | 242 +++++++++++++++++---------------- 2 files changed, 128 insertions(+), 115 deletions(-) diff --git a/home/hosts/work/default.nix b/home/hosts/work/default.nix index 654f4e04..85ba2712 100644 --- a/home/hosts/work/default.nix +++ b/home/hosts/work/default.nix @@ -64,6 +64,7 @@ }; browser.primary = "firefox"; + my.dconf.enable = true; browser.secondary = "chromium"; cloud.azure.enable = true; comms.signal.enable = true; diff --git a/home/modules/dconf/default.nix b/home/modules/dconf/default.nix index ed87941e..8cac58a7 100644 --- a/home/modules/dconf/default.nix +++ b/home/modules/dconf/default.nix @@ -1,125 +1,137 @@ -{ config, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.my.dconf; terminal = "kitty"; browser = config.browser.primary; font = "${config.stylix.fonts.monospace.name} ${toString config.stylix.fonts.sizes.applications}"; in { - dconf.settings = { - "org/gnome/desktop/background" = { - color-shading-type = "solid"; - picture-options = "zoom"; - picture-uri = "none"; - picture-uri-dark = "none"; - primary-color = "#555555"; - secondary-color = "#555555"; - show-desktop-icons = false; - }; - - "org/gnome/desktop/default-applications/office/calendar" = { - exec = "${browser} https://calendar.proton.me"; - needs-term = false; - }; - - "org/gnome/desktop/default-applications/office/tasks" = { - exec = "task"; - needs-term = true; - }; - - "org/gnome/desktop/default-applications/terminal" = { - exec = terminal; - exec-arg = ""; - }; - - "org/gnome/desktop/input-sources" = { - xkb-options = [ "caps:none" ]; - }; - - "org/gnome/desktop/interface" = { - clock-format = "24h"; - clock-show-weekday = true; - color-scheme = "prefer-dark"; - enable-hot-corners = false; - # font-name = font; - locate-pointer = true; - monospace-font-name = font; - }; - - "org/gnome/desktop/wm/keybindings" = { - close = [ "Delete" ]; - minimize = [ "h" ]; - move-to-monitor-down = [ "Down" ]; - move-to-monitor-left = [ "Left" ]; - move-to-monitor-right = [ "Right" ]; - move-to-monitor-up = [ "Up" ]; - move-to-workspace-1 = [ "a" ]; - move-to-workspace-2 = [ "s" ]; - move-to-workspace-3 = [ "d" ]; - move-to-workspace-4 = [ "f" ]; - move-to-workspace-5 = [ "g" ]; - switch-applications = [ "j" ]; - switch-applications-backward = [ "k" ]; - switch-to-workspace-1 = [ "a" ]; - switch-to-workspace-2 = [ "s" ]; - switch-to-workspace-3 = [ "d" ]; - switch-to-workspace-4 = [ "f" ]; - switch-to-workspace-5 = [ "g" ]; - }; - - "org/gnome/desktop/wm/preferences" = { - num-workspaces = 5; - workspace-names = [ - "sh" - "www" - "dev" - "info" - "etc" - ]; - }; - - "org/gnome/mutter" = { - center-new-windows = true; - dynamic-workspaces = false; - }; - - "org/gnome/settings-daemon/plugins/color" = { - night-light-enabled = true; - night-light-schedule-automatic = true; - }; - - "org/gnome/settings-daemon/plugins/media-keys" = { - custom-keybindings = [ - "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/" - "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/" - ]; - }; - - "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = { - binding = "Print"; - command = "flameshot gui"; - name = "flameshot"; - }; - - "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = { - binding = "Return"; - command = terminal; - name = "Kitty"; - }; - - "org/gnome/settings-daemon/plugins/power" = { - power-button-action = "suspend"; - }; - - "org/gnome/shell/app-switcher" = { - current-workspace-only = true; - }; - - "org/gnome/shell/keybindings" = { - toggle-application-view = [ "p" ]; - toggle-quick-settings = [ ]; - }; + options.my.dconf = { + enable = lib.mkEnableOption "dconf"; }; - home.packages = with pkgs; [ dconf2nix ]; + config = lib.mkIf cfg.enable { + dconf.settings = { + "org/gnome/desktop/background" = { + color-shading-type = "solid"; + picture-options = "zoom"; + picture-uri = "none"; + picture-uri-dark = "none"; + primary-color = "#555555"; + secondary-color = "#555555"; + show-desktop-icons = false; + }; + + "org/gnome/desktop/default-applications/office/calendar" = { + exec = "${browser} https://calendar.proton.me"; + needs-term = false; + }; + + "org/gnome/desktop/default-applications/office/tasks" = { + exec = "task"; + needs-term = true; + }; + + "org/gnome/desktop/default-applications/terminal" = { + exec = terminal; + exec-arg = ""; + }; + + "org/gnome/desktop/input-sources" = { + xkb-options = [ "caps:none" ]; + }; + + "org/gnome/desktop/interface" = { + clock-format = "24h"; + clock-show-weekday = true; + color-scheme = "prefer-dark"; + enable-hot-corners = false; + # font-name = font; + locate-pointer = true; + monospace-font-name = font; + }; + + "org/gnome/desktop/wm/keybindings" = { + close = [ "Delete" ]; + minimize = [ "h" ]; + move-to-monitor-down = [ "Down" ]; + move-to-monitor-left = [ "Left" ]; + move-to-monitor-right = [ "Right" ]; + move-to-monitor-up = [ "Up" ]; + move-to-workspace-1 = [ "a" ]; + move-to-workspace-2 = [ "s" ]; + move-to-workspace-3 = [ "d" ]; + move-to-workspace-4 = [ "f" ]; + move-to-workspace-5 = [ "g" ]; + switch-applications = [ "j" ]; + switch-applications-backward = [ "k" ]; + switch-to-workspace-1 = [ "a" ]; + switch-to-workspace-2 = [ "s" ]; + switch-to-workspace-3 = [ "d" ]; + switch-to-workspace-4 = [ "f" ]; + switch-to-workspace-5 = [ "g" ]; + }; + + "org/gnome/desktop/wm/preferences" = { + num-workspaces = 5; + workspace-names = [ + "sh" + "www" + "dev" + "info" + "etc" + ]; + }; + + "org/gnome/mutter" = { + center-new-windows = true; + dynamic-workspaces = false; + }; + + "org/gnome/settings-daemon/plugins/color" = { + night-light-enabled = true; + night-light-schedule-automatic = true; + }; + + "org/gnome/settings-daemon/plugins/media-keys" = { + custom-keybindings = [ + "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/" + "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/" + ]; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = { + binding = "Print"; + command = "flameshot gui"; + name = "flameshot"; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = { + binding = "Return"; + command = terminal; + name = "Kitty"; + }; + + "org/gnome/settings-daemon/plugins/power" = { + power-button-action = "suspend"; + }; + + "org/gnome/shell/app-switcher" = { + current-workspace-only = true; + }; + + "org/gnome/shell/keybindings" = { + toggle-application-view = [ "p" ]; + toggle-quick-settings = [ ]; + }; + }; + + home.packages = with pkgs; [ dconf2nix ]; + }; }