From 434be0ce45760ed116835aa7c2c1b543991a041c Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 27 Oct 2026 23:16:57 +0100 Subject: phos autologin --- hosts/phosphophyllite/default.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/hosts/phosphophyllite/default.nix b/hosts/phosphophyllite/default.nix index b7acc31..903bbae 100644 --- a/hosts/phosphophyllite/default.nix +++ b/hosts/phosphophyllite/default.nix @@ -3,6 +3,14 @@ ./hardware-configuration.nix ]; + services.displayManager = { + defaultSession = "hyprland"; + autoLogin = { + enable = true; + user = "phos"; + }; + }; + services.xserver.videoDrivers = [ "nvidia" ]; hardware.nvidia = { @@ -22,6 +30,7 @@ services.sunshine = { enable = true; + autoStart = true; openFirewall = true; capSysAdmin = true; settings = { @@ -41,6 +50,8 @@ }; }; + systemd.user.services.sunshine.serviceConfig.ExecStartPre = "${pkgs.procps}/bin/pkill -x sunshine || true"; + security.sudo.extraRules = [ { users = [ "phos" ]; @@ -73,6 +84,16 @@ }; }; + systemd.user.services.autolock-after-login = { + description = "Lock session shortly after autologin"; + wantedBy = [ "graphical-session.target" ]; + after = [ "graphical-session.target" ]; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.bash}/bin/bash -lc 'sleep 20; command -v serpantinum >/dev/null && serpantinum lock || true'"; + }; + }; + systemd.timers.sunshine-poweroff = { description = "Shutdown desktop 15 minutes after Sunshine disconnect"; timerConfig = { -- cgit v1.2.3