Files
Nomarchy/themes/engine/sddm.nix
Bernardo Magri 95101fda3f fix(sddm): default autoLogin off, not on with hardcoded "nomarchy"
`themes/engine/sddm.nix` defaulted `services.displayManager.autoLogin`
to `enable = true; user = "nomarchy";` (both mkDefault). The installer
flow overrode both with the real username at normal priority, so this
was invisible there — but a hand-migrated user (per docs/MIGRATION.md)
who imported `nomarchy.nixosModules.system` without setting
`autoLogin.user` would auto-login as a nonexistent "nomarchy" user and
SDDM would error. `docs/MIGRATION.md` even documented the override as a
post-import chore.

Flipped the default to `enable = lib.mkDefault false`. Installer
generates `enable = true` directly so its flow is unchanged. Migration
flow now gets the safe default — opt-in instead of opt-out — and the
docs row is updated to reflect the new shape.

The hardcoded "nomarchy" username fallback for `autoLogin.user` is the
same class of bug as the impermanence persistence block was. A future
roadmap row to consolidate "primary user" across impermanence,
autoLogin, and any future modules might be worthwhile, but it's
deferred — this commit is the immediate fix.

Found during Pillar 8 audit of first-boot UX.
2026-05-19 18:46:41 +01:00

48 lines
1.4 KiB
Nix

{ config, pkgs, lib, ... }:
let
nomarchy-sddm-theme = pkgs.stdenv.mkDerivation {
pname = "nomarchy-sddm-theme";
version = "1.0";
src = ./sddm/nomarchy;
nativeBuildInputs = [ pkgs.libsForQt5.qt5.wrapQtAppsHook ];
installPhase = ''
mkdir -p $out/share/sddm/themes/nomarchy
cp -r * $out/share/sddm/themes/nomarchy/
'';
propagatedBuildInputs = with pkgs.libsForQt5.qt5; [
qtgraphicaleffects
qtquickcontrols2
qtsvg
];
};
in
{
services.xserver.enable = lib.mkDefault true;
services.displayManager.sddm = {
enable = lib.mkDefault true;
wayland.enable = lib.mkDefault true;
theme = lib.mkDefault "nomarchy";
};
services.displayManager.defaultSession = lib.mkDefault "hyprland-uwsm";
# autoLogin defaults off so hand-migrated configs (no installer-written
# username) don't try to log in as a nonexistent "nomarchy" user. The
# installer-generated system.nix sets both `enable = true;` and
# `user = "$USERNAME";` at normal priority, overriding these defaults.
services.displayManager.autoLogin = {
enable = lib.mkDefault false;
user = lib.mkDefault "nomarchy";
};
environment.systemPackages = lib.mkDefault [ nomarchy-sddm-theme ];
# Enable Hyprland system-level dependencies
programs.hyprland = {
enable = lib.mkDefault true;
withUWSM = lib.mkDefault true;
};
programs.uwsm.enable = lib.mkDefault true;
}