nix-dotfiles/modules/desktop/autologin.nix

25 lines
907 B
Nix

{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.desktop.autologin;
in {
options.modules.desktop.autologin = {
enable = mkEnableOption "Enable auto login, the quickest way to enter your desktop environment";
};
config = mkIf cfg.enable {
services.displayManager.enable = true;
services.displayManager.autoLogin.enable = true;
services.displayManager.autoLogin.user = config.user.name;
# greetd autologin kinda sucks (requires a binary to launch, not the name of a desktop file)
# but, ly has it! ly seems pretty cool and lightweight! thank goodness
# https://codeberg.org/fairyglade/ly/commit/0cf752f3b850d16283e28853bca63e994d8c5e7b
services.displayManager.ly.enable = true;
services.displayManager.ly.settings = {
auto_login_session = config.services.displayManager.defaultSession;
auto_login_user = config.user.name;
};
};
}