From 5ceff6c2fa5951d27652ea42d0c624c041d064b4 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Sat, 24 Feb 2024 18:08:23 +0300 Subject: [PATCH] Gnome : Move dconf to nix. --- .config/linux/Gnome.dconf | 295 ---------------- .config/linux/system/module/Gnome.nix | 28 +- .../linux/system/module/common/Firefox.nix | 8 +- .config/linux/system/user/Voronind.nix | 330 +++++++++++++++++- 4 files changed, 338 insertions(+), 323 deletions(-) delete mode 100644 .config/linux/Gnome.dconf diff --git a/.config/linux/Gnome.dconf b/.config/linux/Gnome.dconf deleted file mode 100644 index 2d59aab..0000000 --- a/.config/linux/Gnome.dconf +++ /dev/null @@ -1,295 +0,0 @@ -[org/gnome/desktop/a11y] -always-show-universal-access-status=true - -[org/gnome/desktop/a11y/applications] -screen-keyboard-enabled=false -screen-magnifier-enabled=false - -[org/gnome/desktop/a11y/interface] -high-contrast=false - -[org/gnome/desktop/background] -color-shading-type='solid' -picture-options='zoom' -picture-uri='file:///home/voronind/.local/share/backgrounds/background.jpg' -picture-uri-dark='file:///home/voronind/.local/share/backgrounds/background.jpg' -primary-color='#000000000000' -secondary-color='#000000000000' - -[org/gnome/desktop/input-sources] -current=uint32 0 -mru-sources=[('xkb', 'us'), ('xkb', 'ru')] -per-window=false -sources=[('xkb', 'us'), ('xkb', 'ru')] -xkb-options=['grp:caps_toggle', 'lv3:ralt_switch'] - -[org/gnome/desktop/interface] -clock-show-date=true -clock-show-weekday=true -color-scheme='prefer-dark' -cursor-blink=false -cursor-size=24 -cursor-theme='Adwaita' -document-font-name='SF Pro Text 11' -enable-animations=false -enable-hot-corners=false -font-antialiasing='rgba' -font-hinting='full' -font-name='SF Pro Display 10' -gtk-enable-primary-paste=false -gtk-theme='Adwaita' -icon-theme='Adwaita' -monospace-font-name='Terminess Nerd Font Mono Medium 12' -show-battery-percentage=false -toolbar-style='text' -toolkit-accessibility=false - -[org/gnome/desktop/media-handling] -automount=false -automount-open=false -autorun-never=true - -[org/gnome/desktop/peripherals/mouse] -accel-profile='flat' -natural-scroll=true -speed=0.0 - -[org/gnome/desktop/peripherals/touchpad] -tap-to-click=true -two-finger-scrolling-enabled=true - -[org/gnome/desktop/privacy] -disable-camera=false -disable-microphone=false -old-files-age=uint32 30 -recent-files-max-age=30 -remove-old-temp-files=true -remove-old-trash-files=true -report-technical-problems=true - -[org/gnome/desktop/remote-desktop/rdp] -enable=false -tls-cert='/home/voronind/.local/share/gnome-remote-desktop/tls.crt' -tls-key='/home/voronind/.local/share/gnome-remote-desktop/tls.key' -view-only=true - -[org/gnome/desktop/screensaver] -color-shading-type='solid' -idle-activation-enabled=false -lock-delay=uint32 0 -picture-options='zoom' -picture-uri='file:///home/voronind/.local/share/backgrounds/background.jpg' -primary-color='#000000000000' -secondary-color='#000000000000' - -[org/gnome/desktop/sound] -allow-volume-above-100-percent=false -event-sounds=false -theme-name='freedesktop' - -[org/gnome/desktop/wm/keybindings] -activate-window-menu=@as [] -begin-move=@as [] -begin-resize=['r'] -close=['x'] -cycle-group=@as [] -cycle-group-backward=@as [] -cycle-panels=@as [] -cycle-panels-backward=@as [] -cycle-windows=@as [] -cycle-windows-backward=@as [] -maximize=@as [] -maximize-horizontally=@as [] -minimize=['s'] -move-to-monitor-down=@as [] -move-to-monitor-left=@as [] -move-to-monitor-right=@as [] -move-to-monitor-up=@as [] -move-to-workspace-1=@as [] -move-to-workspace-2=@as [] -move-to-workspace-3=@as [] -move-to-workspace-4=@as [] -move-to-workspace-last=@as [] -move-to-workspace-left=['q'] -move-to-workspace-right=['e'] -panel-run-dialog=['space'] -show-desktop=['c'] -switch-applications=['Tab'] -switch-applications-backward=['Tab'] -switch-group=['Tab'] -switch-group-backward=['Tab'] -switch-input-source=[''] -switch-input-source-backward=[''] -switch-panels=@as [] -switch-panels-backward=@as [] -switch-to-workspace-1=@as [] -switch-to-workspace-2=[''] -switch-to-workspace-3=[''] -switch-to-workspace-4=[''] -switch-to-workspace-last=@as [] -switch-to-workspace-left=['q'] -switch-to-workspace-right=['e'] -switch-windows=@as [] -switch-windows-backward=@as [] -toggle-fullscreen=['f'] -toggle-maximized=['w'] -unmaximize=@as [] - -[org/gnome/desktop/wm/preferences] -action-middle-click-titlebar='minimize' -action-right-click-titlebar='menu' -button-layout='appmenu:close' -titlebar-font='SF Pro Display 11' - -[org/gnome/desktop/session] -idle-delay=uint32 0 - -[org/gnome/gnome-system-monitor] -graph-update-interval=100 -kill-dialog=false -maximized=false -network-in-bits=true -network-total-in-bits=true -show-dependencies=false -show-whose-processes='user' -update-interval=1500 - -[org/gnome/mutter] -attach-modal-dialogs=true -center-new-windows=true -dynamic-workspaces=true -edge-tiling=true -workspaces-only-on-primary=true - -[org/gnome/mutter/keybindings] -toggle-tiled-left=['a'] -toggle-tiled-right=['d'] - -[org/gnome/mutter/wayland/keybindings] -restore-shortcuts=[''] - -[org/gnome/nautilus/icon-view] -default-zoom-level='larger' - -[org/gnome/nautilus/list-view] -default-zoom-level='small' -use-tree-view=false - -[org/gnome/nautilus/preferences] -click-policy='single' -default-folder-viewer='list-view' -default-sort-in-reverse-order=false -default-sort-order='name' -migrated-gtk-settings=true -search-filter-time-type='last_modified' -search-view='list-view' -show-image-thumbnails='local-only' - -[org/gnome/settings-daemon/plugins/color] -night-light-enabled=false -night-light-schedule-automatic=false -night-light-schedule-from=0.0 -night-light-schedule-to=0.0 -night-light-temperature=uint32 3700 - -[org/gnome/settings-daemon/plugins/media-keys] -custom-keybindings=['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/'] -magnifier=@as [] -magnifier-zoom-in=@as [] -magnifier-zoom-out=@as [] -screenreader=@as [] -screensaver=['z'] - -[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0] -binding='Escape' -command='kgx' -name='gnome-terminal' - -[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1] -binding='z' -command='gnome-session-quit --power-off' -name='gnome-poweroff' - -[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2] -binding='Escape' -command='kgx -- btop' -name='System Monitor' - -[org/gnome/settings-daemon/plugins/power] -ambient-enabled=false -idle-dim=false -power-button-action='nothing' -sleep-inactive-ac-timeout=900 -sleep-inactive-ac-type='nothing' -sleep-inactive-battery-type='nothing' - -[org/gnome/shell] -disable-extension-version-validation=true -disable-user-extensions=false -favorite-apps=@as [] -had-bluetooth-devices-setup=true -last-selected-power-profile='power-saver' -remember-mount-password=false - -[org/gnome/shell/app-switcher] -current-workspace-only=true - -[org/gnome/shell/keybindings] -focus-active-notification=@as [] -open-application-menu=@as [] -switch-to-application-1=@as [] -switch-to-application-2=@as [] -switch-to-application-3=@as [] -switch-to-application-4=@as [] -switch-to-application-5=[''] -switch-to-application-6=[''] -switch-to-application-7=[''] -switch-to-application-8=[''] -switch-to-application-9=[''] -toggle-application-view=[''] -toggle-message-tray=@as [] -toggle-overview=[''] -show-screenshot-ui=['v'] -toggle-quick-settings=@as [] - -[org/gnome/shell/overrides] -edge-tiling=false - -[org/gnome/software] -download-updates=false -download-updates-notify=false -first-run=false -show-nonfree-prompt=false - -[org/gnome/system/location] -enabled=false - -[org/gtk/gtk4/settings/file-chooser] -date-format='regular' -location-mode='path-bar' -show-hidden=false -show-size-column=true -show-type-column=true -sidebar-width=166 -sort-column='modified' -sort-directories-first=true -sort-order='descending' -type-format='category' -view-type='list' - -[org/gtk/settings/file-chooser] -date-format='regular' -location-mode='path-bar' -show-hidden=false -show-size-column=true -show-type-column=true -sort-column='modified' -sort-directories-first=true -sort-order='descending' -type-format='category' - -[system/locale] -region='ru_RU.UTF-8' - -[system/proxy] -mode='none' diff --git a/.config/linux/system/module/Gnome.nix b/.config/linux/system/module/Gnome.nix index d428183..fd394cd 100644 --- a/.config/linux/system/module/Gnome.nix +++ b/.config/linux/system/module/Gnome.nix @@ -4,16 +4,10 @@ in { # GUI. services.xserver.enable = true; services.xserver.displayManager.gdm.enable = true; - services.xserver.desktopManager.gnome = { - enable = true; - extraGSettingsOverrides = '' - [org/gnome/desktop/wm/preferences] - focus-mode='sloppy' - ''; - }; + services.xserver.desktopManager.gnome.enable = true; services.xserver.xkb = { - layout = "us"; - variant = ""; + layout = "us,ru"; + options = "grp:caps_toggle,lv3:ralt_switch"; }; # Disable some apps. @@ -58,18 +52,6 @@ in { pulse.enable = true; }; - # Auto-load config on start. - environment.systemPackages = with pkgs; [ dconf ]; - systemd.user.services.dconfload = { - description = "Load Gnome dconf settings on startup."; - wantedBy = [ "graphical-session-pre.target" ]; - wants = [ "dotfiles.service" ]; - after = [ "dotfiles.service" ]; - serviceConfig.Type = "oneshot"; - script = '' - ${pkgs.gnused}/bin/sed -i -e "s/voronind/$(${pkgs.coreutils}/bin/whoami)/g" ${dconfConfig} - ${pkgs.dconf}/bin/dconf load / < ${dconfConfig} - ${pkgs.git}/bin/git checkout ${dconfConfig} - ''; - }; + # Enable dconf. + programs.dconf.enable = true; } diff --git a/.config/linux/system/module/common/Firefox.nix b/.config/linux/system/module/common/Firefox.nix index fbc9707..bfb0ef8 100644 --- a/.config/linux/system/module/common/Firefox.nix +++ b/.config/linux/system/module/common/Firefox.nix @@ -44,10 +44,10 @@ install_sources = [ "*" ]; installation_mode = "blocked"; }; - "queryamoid@kaply.com" = { - installation_mode = "force_installed"; - install_url = "https://github.com/mkaply/queryamoid/releases/download/v0.1/query_amo_addon_id-0.1-fx.xpi"; - }; + # "queryamoid@kaply.com" = { + # installation_mode = "force_installed"; + # install_url = "https://github.com/mkaply/queryamoid/releases/download/v0.1/query_amo_addon_id-0.1-fx.xpi"; + # }; "{446900e4-71c2-419f-a6a7-df9c091e268b}" = { installation_mode = "force_installed"; install_url = "https://addons.mozilla.org/firefox/downloads/latest/bitwarden-password-manager/latest.xpi"; diff --git a/.config/linux/system/user/Voronind.nix b/.config/linux/system/user/Voronind.nix index 266cdb1..769a58c 100644 --- a/.config/linux/system/user/Voronind.nix +++ b/.config/linux/system/user/Voronind.nix @@ -1,4 +1,4 @@ -{ pkgs, specialArgs, ... }: { +{ pkgs, lib, specialArgs, ... }: { users.users.voronind = { hashedPassword = specialArgs.const.hashedPassword; uid = 1000; @@ -8,4 +8,332 @@ extraGroups = [ "networkmanager" ]; packages = with pkgs; [ ]; }; + + programs.dconf.profiles.user = { + enableUserDb = true; + databases = [{ + settings = with lib.gvariant; { + "org/gnome/desktop/a11y" = { + always-show-universal-access-status = true; + }; + + "org/gnome/desktop/background" = { + color-shading-type = "solid"; + picture-options = "zoom"; + picture-uri = "file:///home/voronind/.local/share/backgrounds/background.jpg"; + picture-uri-dark = "file:///home/voronind/.local/share/backgrounds/background.jpg"; + primary-color = "#000000000000"; + secondary-color = "#000000000000"; + }; + + "org/gnome/desktop/input-sources" = { + current = mkUint32 0; + mru-sources = [ (mkTuple [ "xkb" "en" ]) (mkTuple [ "xkb" "ru" ]) ]; + per-window = false; + show-all-sources = true; + sources = [ (mkTuple [ "xkb" "en" ]) (mkTuple [ "xkb" "ru" ]) ]; + xkb-options = [ "grp:caps_toggle" "lv3:ralt_switch" ]; + }; + + "org/gnome/desktop/interface" = { + clock-show-date = true; + clock-show-weekday = true; + color-scheme = "prefer-dark"; + cursor-blink = false; + cursor-size = "24"; + cursor-theme = "Adwaita"; + document-font-name = "SF Pro Text 11"; + enable-animations = false; + enable-hot-corners = false; + font-antialiasing = "rgba"; + font-hinting = "full"; + font-name = "SF Pro Display 10"; + gtk-enable-primary-paste = false; + gtk-theme = "Adwaita"; + icon-theme = "Adwaita"; + monospace-font-name = "Terminess Nerd Font Mono Medium 12"; + show-battery-percentage = false; + toolbar-style = "text"; + toolkit-accessibility = false; + }; + + "org/gnome/desktop/media-handling" = { + automount = false; + automount-open = false; + autorun-never = true; + }; + + "org/gnome/desktop/peripherals/mouse" = { + accel-profile = "flat"; + natural-scroll = true; + speed = "0.0"; + }; + + "org/gnome/desktop/peripherals/touchpad" = { + tap-to-click = true; + two-finger-scrolling-enabled = true; + }; + + "org/gnome/desktop/privacy" = { + disable-camera = false; + disable-microphone = false; + old-files-age = mkUint32 30; + recent-files-max-age = mkUint32 30; + remove-old-temp-files = true; + remove-old-trash-files = true; + report-technical-problems = true; + }; + + "org/gnome/desktop/remote-desktop/rdp" = { + enable = false; + tls-cert = "/home/voronind/.local/share/gnome-remote-desktop/tls.crt"; + tls-key = "/home/voronind/.local/share/gnome-remote-desktop/tls.key"; + view-only = true; + }; + + "org/gnome/desktop/screensaver" = { + color-shading-type = "solid"; + idle-activation-enabled = false; + lock-delay = mkUint32 0; + picture-options = "zoom"; + picture-uri = "file:///home/voronind/.local/share/backgrounds/background.jpg"; + primary-color = "#000000000000"; + secondary-color = "#000000000000"; + }; + + "org/gnome/desktop/sound" = { + allow-volume-above-100-percent = false; + event-sounds = false; + theme-name = "freedesktop"; + }; + + "org/gnome/desktop/wm/keybindings" = { + activate-window-menu = [ "" ]; + begin-move = [ "" ]; + begin-resize = [ "r" ]; + close = [ "x" ]; + cycle-group = [ "" ]; + cycle-group-backward = [ "" ]; + cycle-panels = [ "" ]; + cycle-panels-backward = [ "" ]; + cycle-windows = [ "" ]; + cycle-windows-backward = [ "" ]; + maximize = [ "" ]; + maximize-horizontally = [ "" ]; + minimize = [ "s" ]; + move-to-monitor-down = [ "" ]; + move-to-monitor-left = [ "" ]; + move-to-monitor-right = [ "" ]; + move-to-monitor-up = [ "" ]; + move-to-workspace-1 = [ "" ]; + move-to-workspace-2 = [ "" ]; + move-to-workspace-3 = [ "" ]; + move-to-workspace-4 = [ "" ]; + move-to-workspace-last = [ "" ]; + move-to-workspace-left = [ "q" ]; + move-to-workspace-right = [ "e" ]; + panel-run-dialog = [ "space" ]; + show-desktop = [ "c" ]; + switch-applications = [ "Tab" ]; + switch-applications-backward = [ "Tab" ]; + switch-group = [ "Tab" ]; + switch-group-backward = [ "Tab" ]; + switch-input-source = [ "" ]; + switch-input-source-backward = [ "" ]; + switch-panels = [ "" ]; + switch-panels-backward = [ "" ]; + switch-to-workspace-1 = [ "" ]; + switch-to-workspace-2 = [ "" ]; + switch-to-workspace-3 = [ "" ]; + switch-to-workspace-4 = [ "" ]; + switch-to-workspace-last = [ "" ]; + switch-to-workspace-left = [ "q" ]; + switch-to-workspace-right = [ "e" ]; + switch-windows = [ "" ]; + switch-windows-backward = [ "" ]; + toggle-fullscreen = [ "f" ]; + toggle-maximized = [ "w" ]; + unmaximize = [ "" ]; + }; + + "org/gnome/desktop/wm/preferences" = { + action-middle-click-titlebar = "minimize"; + action-right-click-titlebar = "menu"; + focus-mode = "sloppy"; + button-layout = "appmenu:close"; + titlebar-font = "SF Pro Display 11"; + }; + + "org/gnome/desktop/session" = { + idle-delay = mkUint32 0; + }; + + "org/gnome/mutter" = { + attach-modal-dialogs = true; + center-new-windows = true; + dynamic-workspaces = true; + edge-tiling = true; + workspaces-only-on-primary = true; + }; + + "org/gnome/mutter/keybindings" = { + toggle-tiled-left = [ "a" ]; + toggle-tiled-right = [ "d" ]; + }; + + "org/gnome/mutter/wayland/keybindings" = { + restore-shortcuts = [ "" ]; + }; + + "org/gnome/nautilus/icon-view" = { + default-zoom-level = "larger"; + }; + + "org/gnome/nautilus/list-view" = { + default-zoom-level = "small"; + use-tree-view = false; + }; + + "org/gnome/nautilus/preferences" = { + click-policy = "single"; + default-folder-viewer = "list-view"; + default-sort-in-reverse-order = false; + default-sort-order = "name"; + migrated-gtk-settings = true; + search-filter-time-type = "last_modified"; + search-view = "list-view"; + show-image-thumbnails = "local-only"; + }; + + "org/gnome/settings-daemon/plugins/color" = { + night-light-enabled = false; + night-light-schedule-automatic = false; + night-light-schedule-from = "0.0"; + night-light-schedule-to = "0.0"; + night-light-temperature = mkUint32 3700; + }; + + "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/custom2/" + ]; + magnifier = [ "" ]; + magnifier-zoom-in = [ "" ]; + magnifier-zoom-out = [ "" ]; + screenreader = [ "" ]; + screensaver = [ "z" ]; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = { + binding = "Escape"; + command = "kgx"; + name = "gnome-terminal"; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = { + binding = "z"; + command = "gnome-session-quit --power-off"; + name = "gnome-poweroff"; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2" = { + binding = "Escape"; + command = "kgx -- btop"; + name = "System Monitor"; + }; + + "org/gnome/settings-daemon/plugins/power" = { + ambient-enabled = false; + idle-dim = false; + power-button-action = "nothing"; + sleep-inactive-ac-timeout = "900"; + sleep-inactive-ac-type = "nothing"; + sleep-inactive-battery-type = "nothing"; + }; + + "org/gnome/shell" = { + disable-extension-version-validation = true; + disable-user-extensions = false; + favorite-apps = [ "" ]; + had-bluetooth-devices-setup = true; + last-selected-power-profile = "power-saver"; + remember-mount-password = false; + }; + + "org/gnome/shell/app-switcher" = { + current-workspace-only = true; + }; + + "org/gnome/shell/keybindings" = { + focus-active-notification = [ "" ]; + open-application-menu = [ "" ]; + show-screenshot-ui = [ "v" ]; + switch-to-application-1 = [ "" ]; + switch-to-application-2 = [ "" ]; + switch-to-application-3 = [ "" ]; + switch-to-application-4 = [ "" ]; + switch-to-application-5 = [ "" ]; + switch-to-application-6 = [ "" ]; + switch-to-application-7 = [ "" ]; + switch-to-application-8 = [ "" ]; + switch-to-application-9 = [ "" ]; + toggle-application-view = [ "" ]; + toggle-message-tray = [ "" ]; + toggle-overview = [ "" ]; + toggle-quick-settings = [ "" ]; + }; + + "org/gnome/shell/overrides" = { + edge-tiling = false; + }; + + "org/gnome/software" = { + download-updates = false; + download-updates-notify = false; + first-run = false; + show-nonfree-prompt = false; + }; + + "org/gnome/system/location" = { + enabled = false; + }; + + "org/gtk/gtk4/settings/file-chooser" = { + date-format = "regular"; + location-mode = "path-bar"; + show-hidden = false; + show-size-column = true; + show-type-column = true; + sidebar-width = "166"; + sort-column = "modified"; + sort-directories-first = true; + sort-order = "descending"; + type-format = "category"; + view-type = "list"; + }; + + "org/gtk/settings/file-chooser" = { + date-format = "regular"; + location-mode = "path-bar"; + show-hidden = false; + show-size-column = true; + show-type-column = true; + sort-column = "modified"; + sort-directories-first = true; + sort-order = "descending"; + type-format = "category"; + }; + + "system/locale" = { + region = "ru_RU.UTF-8"; + }; + + "system/proxy" = { + mode = "none"; + }; + }; + }]; + }; }