diff --git a/nix-os-configs/main.nix b/nix-os-configs/main.nix index 912b6cb..e09af33 100644 --- a/nix-os-configs/main.nix +++ b/nix-os-configs/main.nix @@ -10,7 +10,8 @@ ../nix-os/nvidia.nix ../nix-os/docker.nix ../nix-os/razer.nix - ../nix-os/desktop/gnome.nix + ../nix-os/desktopManagers/gnome.nix + ../nix-os/displayManagers/gdm.nix #../nix-os/desktop/kde-plasma.nix ../nix-os/shell.nix ../nix-os/virtualization.nix diff --git a/nix-os-configs/vm.nix b/nix-os-configs/vm.nix index 7a0abd5..c91a794 100644 --- a/nix-os-configs/vm.nix +++ b/nix-os-configs/vm.nix @@ -4,7 +4,8 @@ imports = [ ../nix-os/core.nix ../nix-os/docker.nix - ../nix-os/desktop/gnome.nix + ../nix-os/desktopManagers/gnome.nix + ../nix-os/displayManagers/gdm.nix #../nix-os/desktop/kde-plasma.nix ../nix-os/shell.nix ../nix-os/virtualization.nix diff --git a/nix-os/dconf-common.nix b/nix-os/dconf-common.nix new file mode 100644 index 0000000..bc9c2b0 --- /dev/null +++ b/nix-os/dconf-common.nix @@ -0,0 +1,158 @@ +# This file is not a NixOS system module +{config, lib, pkgs, ... }: +selection: + +let + settings = with lib.gvariant; { + "org/gnome/desktop/background" = { + picture-options = "zoom"; + picture-uri = "file://${../media/wallpaper.png}"; + picture-uri-dark = "file://${../media/wallpaper.png}"; + }; + + "org/gnome/desktop/interface" = { + clock-show-date = true; + clock-show-seconds = true; + clock-show-weekday = true; + color-scheme = "prefer-dark"; + cursor-theme = "GoogleDot-White"; + }; + + "org/gnome/desktop/media-handling" = { + automount = false; + }; + + "org/gnome/desktop/peripherals/mouse" = { + accel-profile = "flat"; + }; + + "org/gnome/desktop/sound" = { + allow-volume-above-100-percent = true; + }; + + "org/gnome/mutter" = { + dynamic-workspaces = true; + workspaces-only-on-primary = true; + }; + + "org/gnome/SessionManager" = { + logout-prompt = false; + }; + + "org/gnome/settings-daemon/plugins/power" = { + power-button-action = "notning"; + sleep-inactive-ac-type = "nothing"; + }; + + "org/gnome/shell" = { + enabled-extensions = [ + "drive-menu@gnome-shell-extensions.gcampax.github.com" + "pop-shell@system76.com" + "workspace-indicator@gnome-shell-extensions.gcampax.github.com" + "Vitals@CoreCoding.com" + "trayIconsReloaded@selfmade.pl" + "places-menu@gnome-shell-extensions.gcampax.github.com" + "apps-menu@gnome-shell-extensions.gcampax.github.com" + "top-bar-organizer@julian.gse.jsts.xyz" + "color-picker@tuberry" + ]; + favorite-apps = [ + (if builtins.elem pkgs.kitty config.environment.systemPackages then + "kitty.desktop" + else none) + "vivaldi-stable.desktop" + "code.desktop" + "org.gnome.Nautilus.desktop" + (if config.programs.steam.enable then + "steam.desktop" + else none) + "pavucontrol.desktop" + ]; + }; + + "org/gnome/shell/app-switcher" = { + current-workspace-only = false; + }; + + "org/gnome/shell/extensions/color-picker" = { + color-picker-shortcut = ["c"]; + enable-shortcut = true; + enable-systray = false; + menu-key = ""; + notify-style = mkUint32 1; + preview-style = mkUint32 0; + }; + + "org/gnome/shell/extensions/pop-shell" = { + active-hint = true; + active-hint-border-radius = mkUint32 1; + gap-inner = mkUint32 2; + gap-outer = mkUint32 1; + show-skip-taskbar = true; + show-title = true; + smart-gaps = false; + snap-to-grid = false; + tile-by-default = true; + }; + + "org/gnome/shell/extensions/top-bar-organizer" = { + center-box-order = ["dateMenu"]; + left-box-order = ["activities" "apps-menu" "places-menu" "vitalsMenu"]; + right-box-order = ["TrayIconsReloaded" "workspace-indicator" "pop-shell" "color-picker@tuberry" "drive-menu" "screenRecording" "screenSharing" "dwellClick" "a11y" "keyboard" "quickSettings"]; + }; + + "org/gnome/shell/extensions/trayIconsReloaded" = { + icon-brightness = mkInt32 0; + icon-contrast = mkInt32 0; + icon-margin-horizontal = mkInt32 0; + icon-margin-vertical = mkInt32 0; + icon-padding-horizontal = mkInt32 4; + icon-padding-vertical = mkInt32 0; + icon-saturation = mkInt32 0; + icon-size = mkInt32 16; + icons-limit = mkInt32 16; + invoke-to-workspace = true; + position-weight = mkInt32 0; + tray-margin-left = mkInt32 0; + tray-margin-right = mkInt32 0; + }; + + "org/gnome/shell/extensions/vitals" = { + hide-icons = false; + hot-sensors = ["_processor_usage_" "_memory_allocated_"]; + memory-measurement = mkInt32 1; + update-time = mkInt32 2; + use-higher-precision = true; + }; + + "org/gnome/shell/keybindings" = { + show-screenshot-ui = ["Print" "S"]; + }; + + "org/gnome/desktop/default-applications/terminal" = + if builtins.elem pkgs.kitty config.environment.systemPackages then { + exec = "kitty"; + exec-arg = ""; + } else null; + + "org/gnome/settings-daemon/plugins/media-keys" = { + custom-keybindings = [ + ( + if builtins.elem pkgs.kitty config.environment.systemPackages then + "org/gnome/settings-daemon/plugins/media-keys/custom-keybinding/custom0" + else null + ) + ]; + help = mkEmptyArray "s"; + screensaver = ["l"]; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybinding/custom0" = + if builtins.elem pkgs.kitty config.environment.systemPackages then { + binding = "t"; + command = "kitty"; + name = "Terminal"; + } else null; + }; +in +lib.filterAttrs (n: v: builtins.elem n selection) settings \ No newline at end of file diff --git a/nix-os/desktop/gnome.nix b/nix-os/desktop/gnome.nix deleted file mode 100644 index f1e8114..0000000 --- a/nix-os/desktop/gnome.nix +++ /dev/null @@ -1,217 +0,0 @@ -{lib, config, pkgs, unstablePkgs, ...}: - -{ - imports = [ - ../unstable-packages.nix - ]; - config = rec { - services.xserver.enable = true; - services.xserver.desktopManager.gnome.enable = true; - services.xserver.displayManager.gdm = { - enable = true; - wayland = false; - autoSuspend = false; - }; - - # environment.sessionVariables.NIXOS_OZONE_WL = "1"; - - programs.dconf.profiles.user.databases = [{ - settings = with lib.gvariant; { - "org/gnome/desktop/background" = { - picture-options="zoom"; - picture-uri="file://${../../media/wallpaper.png}"; - picture-uri-dark="file://${../../media/wallpaper.png}"; - }; - - "org/gnome/desktop/interface" = { - clock-show-date=true; - clock-show-seconds=true; - clock-show-weekday=true; - color-scheme="prefer-dark"; - cursor-theme="GoogleDot-White"; - }; - - "org/gnome/desktop/media-handling" = { - automount=false; - }; - - "org/gnome/desktop/peripherals/mouse" = { - accel-profile="flat"; - }; - - "org/gnome/desktop/sound" = { - allow-volume-above-100-percent=true; - }; - - "org/gnome/mutter" = { - dynamic-workspaces=true; - workspaces-only-on-primary=true; - }; - - "org/gnome/SessionManager" = { - logout-prompt=false; - }; - - "org/gnome/settings-daemon/plugins/power" = { - power-button-action="notning"; - sleep-inactive-ac-type="nothing"; - }; - - "org/gnome/shell" = { - enabled-extensions=[ - "drive-menu@gnome-shell-extensions.gcampax.github.com" - "pop-shell@system76.com" - "workspace-indicator@gnome-shell-extensions.gcampax.github.com" - "Vitals@CoreCoding.com" - "trayIconsReloaded@selfmade.pl" - "places-menu@gnome-shell-extensions.gcampax.github.com" - "apps-menu@gnome-shell-extensions.gcampax.github.com" - "top-bar-organizer@julian.gse.jsts.xyz" - "color-picker@tuberry" - ]; - favorite-apps=[ - (if builtins.elem pkgs.kitty config.environment.systemPackages then - "kitty.desktop" - else none) - "vivaldi-stable.desktop" - "code.desktop" - "org.gnome.Nautilus.desktop" - (if config.programs.steam.enable then - "steam.desktop" - else none) - "pavucontrol.desktop" - ]; - }; - - "org/gnome/shell/app-switcher" = { - current-workspace-only=false; - }; - - "org/gnome/shell/extensions/color-picker" = { - color-picker-shortcut=["c"]; - enable-shortcut=true; - enable-systray=false; - menu-key=""; - notify-style=mkUint32 1; - preview-style=mkUint32 0; - }; - - "org/gnome/shell/extensions/pop-shell" = { - active-hint=true; - active-hint-border-radius=mkUint32 1; - gap-inner=mkUint32 2; - gap-outer=mkUint32 1; - show-skip-taskbar=true; - show-title=true; - smart-gaps=false; - snap-to-grid=false; - tile-by-default=true; - }; - - "org/gnome/shell/extensions/top-bar-organizer" = { - center-box-order=["dateMenu"]; - left-box-order=["activities" "apps-menu" "places-menu" "vitalsMenu"]; - right-box-order=["TrayIconsReloaded" "workspace-indicator" "pop-shell" "color-picker@tuberry" "drive-menu" "screenRecording" "screenSharing" "dwellClick" "a11y" "keyboard" "quickSettings"]; - }; - - "org/gnome/shell/extensions/trayIconsReloaded" = { - icon-brightness=mkInt32 0; - icon-contrast=mkInt32 0; - icon-margin-horizontal=mkInt32 0; - icon-margin-vertical=mkInt32 0; - icon-padding-horizontal=mkInt32 4; - icon-padding-vertical=mkInt32 0; - icon-saturation=mkInt32 0; - icon-size=mkInt32 16; - icons-limit=mkInt32 16; - invoke-to-workspace=true; - position-weight=mkInt32 0; - tray-margin-left=mkInt32 0; - tray-margin-right=mkInt32 0; - }; - - "org/gnome/shell/extensions/vitals" = { - hide-icons=false; - hot-sensors=["_processor_usage_" "_memory_allocated_"]; - memory-measurement=mkInt32 1; - update-time=mkInt32 2; - use-higher-precision=true; - }; - - "org/gnome/shell/keybindings" = { - show-screenshot-ui=["Print" "S"]; - }; - - "org/gnome/desktop/default-applications/terminal" = - if builtins.elem pkgs.kitty config.environment.systemPackages then { - exec = "kitty"; - exec-arg = ""; - } else null; - - "org/gnome/settings-daemon/plugins/media-keys" = { - custom-keybindings = [ - ( - if builtins.elem pkgs.kitty config.environment.systemPackages then - "org/gnome/settings-daemon/plugins/media-keys/custom-keybinding/custom0" - else null - ) - ]; - help = mkEmptyArray "s"; - screensaver = ["l"]; - }; - - "org/gnome/settings-daemon/plugins/media-keys/custom-keybinding/custom0" = - if builtins.elem pkgs.kitty config.environment.systemPackages then { - binding="t"; - command="kitty"; - name="Terminal"; - } else null; - - }; - }]; - - environment.gnome.excludePackages = with pkgs; with pkgs.gnome; [ - baobab - cheese - epiphany - evince - geary - gedit - gnome-characters - gnome-connections - gnome-console - gnome-disk-utility - gnome-font-viewer - gnome-logs - gnome-maps - gnome-text-editor - gnome-tour - seahorse - totem - yelp - ]; - - programs.dconf.profiles.gdm.databases = with builtins.elemAt programs.dconf.profiles.user.databases 0; [{ - settings = { - "org/gnome/desktop/interface" = settings."org/gnome/desktop/interface"; - "org/gnome/desktop/peripherals/mouse" = settings."org/gnome/desktop/peripherals/mouse"; - "org/gnome/desktop/sound" = settings."org/gnome/desktop/sound"; - "org/gnome/settings-daemon/plugins/power" = settings."org/gnome/settings-daemon/plugins/power"; - "org/gnome/shell/keybindings" = settings."org/gnome/shell/keybindings"; - }; - }]; - - environment.systemPackages = with pkgs; [ - gnomeExtensions.pop-shell - gnomeExtensions.vitals - gnomeExtensions.tray-icons-reloaded - gnomeExtensions.color-picker - gnomeExtensions.top-bar-organizer - # unstablePkgs.gnomeExtensions.translate-indicator - # translate-shell - pavucontrol - #FIXME: Apply the cursor theme also in GTK3 config - google-cursor - ]; - }; -} diff --git a/nix-os/desktopManagers/gnome.nix b/nix-os/desktopManagers/gnome.nix new file mode 100644 index 0000000..9e7afa8 --- /dev/null +++ b/nix-os/desktopManagers/gnome.nix @@ -0,0 +1,71 @@ +{pkgs, ... } @ moduleArgs: + +{ + imports = [ + ../unstable-packages.nix + ]; + config = { + services.xserver.enable = true; + services.xserver.desktopManager.gnome.enable = true; + + # environment.sessionVariables.NIXOS_OZONE_WL = "1"; + + programs.dconf.profiles.user.databases = [{ + settings = import ../dconf-common.nix moduleArgs [ + "org/gnome/desktop/background" + "org/gnome/desktop/interface" + "org/gnome/desktop/media-handling" + "org/gnome/desktop/peripherals/mouse" + "org/gnome/desktop/sound" + "org/gnome/mutter" + "org/gnome/SessionManager" + "org/gnome/settings-daemon/plugins/power" + "org/gnome/shell" + "org/gnome/shell/app-switcher" + "org/gnome/shell/extensions/color-picker" + "org/gnome/shell/extensions/pop-shell" + "org/gnome/shell/extensions/top-bar-organizer" + "org/gnome/shell/extensions/trayIconsReloaded" + "org/gnome/shell/extensions/vitals" + "org/gnome/shell/keybindings" + "org/gnome/desktop/default-applications/terminal" + "org/gnome/settings-daemon/plugins/media-keys" + "org/gnome/settings-daemon/plugins/media-keys/custom-keybinding/custom0" + ]; + }]; + + environment.gnome.excludePackages = with pkgs; with pkgs.gnome; [ + baobab + cheese + epiphany + evince + geary + gedit + gnome-characters + gnome-connections + gnome-console + gnome-disk-utility + gnome-font-viewer + gnome-logs + gnome-maps + gnome-text-editor + gnome-tour + seahorse + totem + yelp + ]; + + environment.systemPackages = with pkgs; [ + gnomeExtensions.pop-shell + gnomeExtensions.vitals + gnomeExtensions.tray-icons-reloaded + gnomeExtensions.color-picker + gnomeExtensions.top-bar-organizer + # unstablePkgs.gnomeExtensions.translate-indicator + # translate-shell + pavucontrol + #FIXME: Apply the cursor theme also in GTK3 config + google-cursor + ]; + }; +} diff --git a/nix-os/desktop/kde-plasma.nix b/nix-os/desktopManagers/kde-plasma.nix similarity index 85% rename from nix-os/desktop/kde-plasma.nix rename to nix-os/desktopManagers/kde-plasma.nix index 58a187b..17851d9 100644 --- a/nix-os/desktop/kde-plasma.nix +++ b/nix-os/desktopManagers/kde-plasma.nix @@ -4,7 +4,6 @@ config = { services.xserver.enable = true; services.xserver.desktopManager.plasma5.enable = true; - services.xserver.displayManager.sddm.enable = true; # environment.sessionVariables.NIXOS_OZONE_WL = "1"; diff --git a/nix-os/displayManagers/gdm.nix b/nix-os/displayManagers/gdm.nix new file mode 100644 index 0000000..f040d1c --- /dev/null +++ b/nix-os/displayManagers/gdm.nix @@ -0,0 +1,25 @@ +{pkgs, ... } @ moduleArgs: + +{ + config = { + services.xserver.displayManager.gdm = { + enable = true; + wayland = false; + autoSuspend = false; + }; + + programs.dconf.profiles.gdm.databases = [{ + settings = import ../dconf-common.nix moduleArgs [ + "org/gnome/desktop/interface" + "org/gnome/desktop/peripherals/mouse" + "org/gnome/desktop/sound" + "org/gnome/settings-daemon/plugins/power" + "org/gnome/shell/keybindings" + ]; + }]; + + environment.systemPackages = with pkgs; [ + google-cursor + ]; + }; +} \ No newline at end of file diff --git a/nix-os/displayManagers/sddm.nix b/nix-os/displayManagers/sddm.nix new file mode 100644 index 0000000..facbb28 --- /dev/null +++ b/nix-os/displayManagers/sddm.nix @@ -0,0 +1,7 @@ +{ ... }: + +{ + config = { + services.xserver.displayManager.sddm.enable = true; + }; +} \ No newline at end of file