nixos/settings/desktop.nix

100 lines
4 KiB
Nix
Raw Normal View History

# settings/desktop.nix — display manager, lightweight fallback session, GTK/Qt theming
{ config, pkgs, lib, inputs, ... }:
2025-12-03 15:46:37 +00:00
{
2026-01-09 13:09:34 +00:00
config = lib.mkIf (lib.elem config.networking.hostName [ "FredOS-Gaming" "FredOS-Macbook" ]) {
2026-01-05 09:25:10 +00:00
services.xserver.enable = true;
# Autologin straight into Hyprland; the quickshell lockscreen engages
# immediately (see Lock.qml), so the lock *is* the login prompt.
services.greetd = {
enable = true;
# We handle the plymouth handoff ourselves below — don't wait for
# plymouth-quit-wait (that wait is what dropped boot to a console
# flash between splash and Hyprland).
greeterManagesPlymouth = true;
settings.default_session = {
# start-hyprland prints an ASCII logo to the VT, which repaints the
# console over the retained splash frame — silence it (Hyprland still
# logs to $XDG_RUNTIME_DIR/hypr/*/hyprland.log).
command = toString (pkgs.writeShellScript "hyprland-session" ''
exec ${config.programs.hyprland.package}/bin/start-hyprland >/dev/null 2>&1
'');
user = "fred";
};
};
# GDM-style splash→session handoff: nothing else quits plymouth at boot;
# greetd freezes the last splash frame (--retain-splash) right before it
# spawns Hyprland, which then flips straight to the lockscreen.
systemd.services.plymouth-quit.wantedBy = lib.mkForce [ ];
# ...and plymouth-quit-wait must go too: greetd is Type=idle, so it defers
# its ExecStart while any job is pending — and the only pending job is
# plymouth-quit-wait, which waits for the plymouth *greetd itself* quits.
# That circle only broke on systemd's 5s idle timeout, costing 6s of boot.
systemd.services.plymouth-quit-wait.wantedBy = lib.mkForce [ ];
systemd.services.greetd = {
after = [ "plymouth-start.service" ];
serviceConfig.ExecStartPre = "-${pkgs.plymouth}/bin/plymouth quit --retain-splash";
};
boot.plymouth.enable = true;
boot.initrd.verbose = false;
boot.consoleLogLevel = 3;
boot.kernelParams = [ "quiet" "udev.log_level=3" ];
# Flatpak for ad-hoc app installs via Bazaar
services.flatpak.enable = true;
# Secret Service for Chromium/Electron credential encryption.
# Autologin can't unlock the keyring (no password typed), so greetd only
# *starts* the daemon; the quickshell lockscreen authenticates against the
# "login" PAM service, where pam_gnome_keyring unlocks it on first unlock.
services.gnome.gnome-keyring.enable = true;
security.pam.services.greetd.enableGnomeKeyring = true;
security.pam.services.login.enableGnomeKeyring = true;
2026-01-05 09:25:10 +00:00
environment.systemPackages = with pkgs; [
nemo # file manager
2026-01-05 09:25:10 +00:00
adwaita-icon-theme
2026-01-20 08:35:23 +00:00
gnome-themes-extra
adwaita-icon-theme-legacy
papirus-icon-theme
2026-01-05 09:25:10 +00:00
];
2026-01-11 22:29:04 +00:00
# Cursor theme — stylix.cursor in settings/stylix.nix owns the choice.
2026-01-05 09:25:10 +00:00
environment.sessionVariables = {
XCURSOR_THEME = "Bibata-Modern-Ice";
2026-01-05 09:25:10 +00:00
XCURSOR_SIZE = "24";
XCURSOR_PATH = lib.mkForce [
"${pkgs.bibata-cursors}/share/icons"
2026-01-05 09:25:10 +00:00
"$HOME/.icons"
"$HOME/.local/share/icons"
];
};
2026-01-05 09:25:10 +00:00
programs.xwayland.enable = true;
programs.dconf.enable = true;
home-manager.users.fred = { config, lib, pkgs, ... }: {
2026-05-14 14:58:13 +01:00
# Stylix's qt target only supports qtct; disable it to silence the warning.
stylix.targets.qt.enable = false;
# Minimal titlebars — stylix manages the GTK theme; we layer our
# headerbar shrink on top via stylix.targets.gtk.extraCss.
gtk.enable = true;
dconf.settings."org/nemo/window-state".start-with-menu-bar = false;
stylix.targets.gtk.extraCss = ''
headerbar { min-height: 0; padding: 0; margin: 0; }
headerbar .title { font-size: 0; }
window:backdrop {
background-color: @window_bg_color;
color: @window_fg_color;
}
window:backdrop headerbar {
background-color: @headerbar_bg_color;
color: @headerbar_fg_color;
}
'';
};
2026-01-05 09:25:10 +00:00
};
2025-12-03 15:46:37 +00:00
}