diff options
Diffstat (limited to 'profiles/desktop.nix')
| -rw-r--r-- | profiles/desktop.nix | 201 |
1 files changed, 69 insertions, 132 deletions
diff --git a/profiles/desktop.nix b/profiles/desktop.nix index b56ac68..5a47f96 100644 --- a/profiles/desktop.nix +++ b/profiles/desktop.nix @@ -1,36 +1,48 @@ -# Desktop profile: the GNOME+niri graphical shell, login manager, audio, fonts, -# graphics, printing, a terminal, and the gpg agent. Opt-in per machine. +# Shared desktop base: the niri graphical session, login manager, dark theme, +# audio, graphics, a browser, common desktop tools, and a font base. Imported by +# every graphical machine; per-host extras live in machines/<host>/desktop.nix. +# +# Deliberately username-agnostic (enzo uses hwebs, kusanagi uses henz), so this +# file sets NO users.users.*: shared desktop tools go to environment.systemPackages +# and per-user groups live in the machine files. { pkgs, ... }: { - # Enable the X11 windowing system. - services.xserver.enable = true; - - # Configure keymap in X11 - services.xserver.xkb = { - layout = "us"; - variant = ""; - }; + # --- Session / login --- + programs.niri.enable = true; + programs.dconf.enable = true; - # Enable the GNOME Desktop Environment. - services.displayManager.gdm.enable = false; - services.desktopManager.gnome.enable = true; + # Tell the desktop it's in dark mode. Apps read light/dark from + # xdg-desktop-portal's Settings interface (org.freedesktop.appearance + # color-scheme). This dconf default is the value the portal serves. + programs.dconf.profiles.user.databases = [ + { + settings."org/gnome/desktop/interface".color-scheme = "prefer-dark"; + } + ]; - programs.dconf.enable = true; - programs.niri.enable = true; + # Serve color-scheme from the *gtk* portal backend, not gnome. The niri module + # routes Settings to xdg-desktop-portal-gnome (its default), but that backend + # relies on gnome-settings-daemon — absent under bare niri — so it reports + # "no preference" and web content (Firefox's prefers-color-scheme) stays light + # even though GTK chrome follows the dark GTK theme. xdg-desktop-portal-gtk + # reads the dconf color-scheme above directly, so pinning Settings to it makes + # the portal actually report dark and content follows. This key merges into + # the niri module's xdg.portal.config.niri. + xdg.portal = { + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + config.niri."org.freedesktop.impl.portal.Settings" = "gtk"; + }; # login screen services.greetd = { enable = true; - settings = { - default_session = { - command = "${pkgs.tuigreet}/bin/tuigreet --time --remember --cmd niri-session"; - user = "greeter"; - }; + settings.default_session = { + command = "${pkgs.tuigreet}/bin/tuigreet --time --remember --cmd niri-session"; + user = "greeter"; }; }; - - # This is required to let tuigreet write to its cache (for --remember) + # Let tuigreet write its cache (for --remember). systemd.services.greetd.serviceConfig = { Type = "idle"; StandardInput = "tty"; @@ -41,131 +53,56 @@ TTYVTDisallocate = true; }; - # prevent auto-mounting optical disks - services.udisks2.enable = true; - - # Enable CUPS to print documents. - services.printing = { - enable = true; - drivers = with pkgs; [ - gutenprint - ]; - }; - - # mDNS: printer discovery, and resolves kusanagi's *.local NAS names. - services.avahi = { - enable = true; - nssmdns4 = true; - openFirewall = true; - }; - + # --- Audio (playback base; kusanagi adds rtkit/jack/32-bit for pro audio) --- services.pulseaudio.enable = false; - security.rtkit.enable = true; services.pipewire = { enable = true; alsa.enable = true; - alsa.support32Bit = true; pulse.enable = true; - jack.enable = true; - wireplumber.enable = true; }; - programs.gnupg.agent = { + # --- Graphics --- + hardware.graphics.enable = true; + + # --- GPG agent (kusanagi adds enableSSHSupport) --- + programs.gnupg.agent.enable = true; + + # --- Firefox: blank home/new-tab and no bookmarks toolbar, as an enterprise + # policy (no profile to manage). Dark theme is not configured here — it comes + # from the portal above, which Firefox honors for both chrome and web content. + programs.firefox = { enable = true; - enableSSHSupport = true; + preferencesStatus = "default"; + preferences = { + "browser.startup.homepage" = "about:blank"; + "browser.startup.page" = 0; # 0 = blank on startup + "browser.newtabpage.enabled" = false; + "browser.toolbars.bookmarks.visibility" = "never"; + }; }; + # --- Common desktop tools (system-wide to stay username-agnostic) --- + environment.systemPackages = with pkgs; [ + ghostty # terminal — required to actually use the GUI + fuzzel # launcher + swaybg # wallpaper + xwayland-satellite # run X11 apps under niri + mako # notifications + libnotify # notify-send + gnupg # gpg + pinentry-gnome3 # passphrase prompt for the gpg agent + ]; + + # --- Fonts (base) --- + # Common packages + fontconfig; each machine sets its own defaultFonts (the + # monospace family differs) and any extra font packages. fonts = { enableDefaultPackages = true; - + fontconfig.enable = true; packages = with pkgs; [ - noto-fonts-cjk-sans - noto-fonts-cjk-serif - inter - nerd-fonts.symbols-only noto-fonts - ibm-plex - public-sans + nerd-fonts.symbols-only adwaita-fonts ]; - - fontconfig = { - enable = true; - - defaultFonts = { - monospace = [ - "Berkeley Mono" - "Liberation Mono" - "Symbols Nerd Font" - ]; - sansSerif = [ - "Liberation Sans" - "Noto Sans" - ]; - serif = [ "Liberation Serif" ]; - emoji = [ "Nerd Font Symbols Only" ]; - }; - - # Force ui-sans-serif and system-ui to resolve correctly - localConf = '' - <?xml version="1.0"?> - <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> - <fontconfig> - <alias> - <family>system-ui</family> - <prefer> - <family>Liberation Sans</family> - </prefer> - </alias> - <alias> - <family>ui-sans-serif</family> - <prefer> - <family>Liberation Sans</family> - </prefer> - </alias> - </fontconfig> - ''; - }; - - fontDir.enable = true; }; - - environment.sessionVariables = { - GSK_RENDERER = "gl"; - XCURSOR_THEME = "Bibata-Modern-Classic"; - XCURSOR_SIZE = "24"; - HYPRCURSOR_THEME = "Bibata-Modern-Classic"; - HYPRCURSOR_SIZE = "24"; - }; - - # Graphics setup - hardware.graphics = { - enable = true; - enable32Bit = true; - }; - - users.users.henz.extraGroups = [ - "audio" - "lp" - "input" - ]; - - environment.systemPackages = with pkgs; [ - # notifications (mako = wayland notification daemon, libnotify = notify-send) - mako - libnotify - ]; - - users.users.henz.packages = with pkgs; [ - ghostty # terminal — required to actually use the GUI - gnupg - pinentry-gnome3 - - # niri support tools - waybar - networkmanagerapplet - xwayland-satellite - fuzzel - swaybg - ]; } |
