Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions modules/steam/autostart.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,25 @@ in
to keep this behavior.
'';


# Disable NixOS's autologin config generation.
# We put autologin config in sddm.conf.d instead so that steamos-manager's
# zzt-steamos-temp-login.conf can override the session on Switch to Desktop.
# (SDDM reads conf.d files alphabetically, so zzt > 00)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed this in nixpkgs, this should not be necessary.

services.displayManager = {
autoLogin = {
enable = true;
user = cfg.user;
};
sddm = {
enable = true;
autoLogin.relogin = true;
};
defaultSession = "gamescope-wayland";
autoLogin.enable = lib.mkForce false;
sddm.enable = true;
};

# tell steamos-manager it's allowed to manage our session
environment.etc."sddm.conf.d/00-jovian-autologin.conf".text = ''
[Autologin]
User=${cfg.user}
Relogin=true
Session=gamescope-wayland.desktop
'';

# Sentinel file: tell steamos-manager it's allowed to manage our session
# Without it, the SessionManagement1 D-Bus interface
# (Switch to Desktop/Game Mode) is not registered.
environment.etc."sddm.conf.d/steamos.conf".text = "";

# Steam overrides this SOMETIMES seemingly for no reason
Expand Down
5 changes: 5 additions & 0 deletions modules/steam/steam.nix
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ in
wantedBy = [ "gamescope-session.service" ];
};

systemd.user.services.steamos-manager-session-cleanup = {
overrideStrategy = "asDropin";
wantedBy = [ "graphical-session.target" ];
};

systemd.services.steamos-manager = {
overrideStrategy = "asDropin";
# FIXME: should probably be done upstream
Expand Down
4 changes: 4 additions & 0 deletions pkgs/steamos-manager/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,12 @@ rustPlatform.buildRustPackage rec {
install -m644 "data/system/com.steampowered.SteamOSManager1.conf" "$out/share/dbus-1/system.d/"
install -m644 "data/system/steamos-manager.service" "$out/lib/systemd/system/"

install -d -m0755 "$out/lib/systemd/system/sddm.service.d/"
install -m644 "data/system/reset-oneshot-boot.conf" "$out/lib/systemd/system/sddm.service.d/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not do anything, because our service name is display-manager.service (for legacy reasons). It should probably be set in the NixOS module instead.


install -m644 "data/user/com.steampowered.SteamOSManager1.service" "$out/share/dbus-1/services/"
install -m644 "data/user/steamos-manager.service" "$out/lib/systemd/user/"
install -m644 "data/user/steamos-manager-session-cleanup.service" "$out/lib/systemd/user/"
'';

postFixup = ''
Expand Down
Loading