autologin module, fix awww

This commit is contained in:
Reid 2026-04-28 22:40:27 -07:00
parent 5b898f56ae
commit 3f8b6984b7
Signed by: reidlab
GPG key ID: DAF5EAF6665839FD
5 changed files with 51 additions and 4 deletions

View file

@ -0,0 +1,25 @@
{ 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;
};
};
}

View file

@ -118,11 +118,15 @@ in {
PartOf = [ "awww.service" ] ++ optional cfg.backdrop "awww-backdrop.service"; PartOf = [ "awww.service" ] ++ optional cfg.backdrop "awww-backdrop.service";
}; };
Install = {
WantedBy = [ "graphical-session.target" ];
};
Service = { Service = {
Type = "oneshot"; Type = "oneshot";
ExecStart = "${cfg.setScript}"; ExecStart = "${cfg.setScript}";
Restart = "on-failure"; Restart = "on-failure";
RestartSec = 2; RestartSec = 5;
}; };
}; };
}) })

View file

@ -14,6 +14,7 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.displayManager.defaultSession = "niri";
services.displayManager.sessionPackages = [ cfg.package ]; services.displayManager.sessionPackages = [ cfg.package ];
programs.niri = { programs.niri = {

View file

@ -10,6 +10,7 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.displayManager.enable = true;
services.greetd = { services.greetd = {
enable = true; enable = true;
settings = { settings = {

View file

@ -18,9 +18,6 @@ in {
hm.services.playerctld.enable = true; hm.services.playerctld.enable = true;
hm.programs.waybar = { hm.programs.waybar = {
enable = true; enable = true;
# essentially just the service
# peculiar how this is a program
systemd.enable = true;
package = cfg.package; package = cfg.package;
settings = let settings = let
@ -344,5 +341,24 @@ in {
]; ];
}; };
}; };
hm.systemd.user.services.waybar = {
Unit = {
Description = "Waybar, a highly customizable wayland bar for wlroots compositors";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart = "${lib.getExe cfg.package}";
Restart = "on-failure";
RestartSec = 5;
};
};
}; };
} }