autologin module, fix awww
This commit is contained in:
parent
5b898f56ae
commit
3f8b6984b7
5 changed files with 51 additions and 4 deletions
25
modules/desktop/autologin.nix
Normal file
25
modules/desktop/autologin.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -118,11 +118,15 @@ in {
|
|||
PartOf = [ "awww.service" ] ++ optional cfg.backdrop "awww-backdrop.service";
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${cfg.setScript}";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 2;
|
||||
RestartSec = 5;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ in {
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.displayManager.defaultSession = "niri";
|
||||
services.displayManager.sessionPackages = [ cfg.package ];
|
||||
|
||||
programs.niri = {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ in {
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.displayManager.enable = true;
|
||||
services.greetd = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
|
|
|||
|
|
@ -18,9 +18,6 @@ in {
|
|||
hm.services.playerctld.enable = true;
|
||||
hm.programs.waybar = {
|
||||
enable = true;
|
||||
# essentially just the service
|
||||
# peculiar how this is a program
|
||||
systemd.enable = true;
|
||||
package = cfg.package;
|
||||
|
||||
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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue