# 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//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, ... }: { # --- Session / login --- programs.niri.enable = true; programs.dconf.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"; } ]; # 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"; }; }; # Let tuigreet write its cache (for --remember). systemd.services.greetd.serviceConfig = { Type = "idle"; StandardInput = "tty"; StandardOutput = "tty"; StandardError = "journal"; # Better for debugging TTYReset = true; TTYVHangup = true; TTYVTDisallocate = true; }; # --- Audio (playback base; kusanagi adds rtkit/jack/32-bit for pro audio) --- services.pulseaudio.enable = false; services.pipewire = { enable = true; alsa.enable = true; pulse.enable = true; }; # --- 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; 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 nerd-fonts.symbols-only adwaita-fonts ]; }; }