use jovian-nixos + fixup niri display session handling
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
system,
|
||||
hostname,
|
||||
inputs,
|
||||
niri-package,
|
||||
...
|
||||
}:
|
||||
{
|
||||
@@ -33,6 +34,9 @@
|
||||
|
||||
services.kmscon.enable = true;
|
||||
|
||||
# Add niri to display manager session packages
|
||||
services.displayManager.sessionPackages = [ niri-package ];
|
||||
|
||||
# Gamescope configuration for Steam Deck-like experience
|
||||
programs = {
|
||||
gamescope = {
|
||||
@@ -45,26 +49,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
services.greetd = {
|
||||
enable = true;
|
||||
settings = {
|
||||
default_session = {
|
||||
command = "${lib.getExe pkgs.tuigreet} --sessions /etc/xdg/wayland-sessions/ --time";
|
||||
user = username;
|
||||
};
|
||||
terminal.vt = lib.mkForce 2;
|
||||
};
|
||||
};
|
||||
|
||||
environment.etc."xdg/wayland-sessions/niri-session.desktop".text = ''
|
||||
[Desktop Entry]
|
||||
Name=Niri Session
|
||||
Comment=Niri Wayland compositor
|
||||
Exec=niri-session
|
||||
Type=Application
|
||||
DesktopNames=niri
|
||||
'';
|
||||
|
||||
system.activationScripts = {
|
||||
# FIX: https://github.com/NixOS/nix/issues/2982
|
||||
"profile-channel-dummy".text = ''
|
||||
@@ -97,6 +81,9 @@
|
||||
];
|
||||
};
|
||||
|
||||
# allow unfree packages for jovian-nixos
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# kernel options
|
||||
boot = {
|
||||
kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
@@ -25,26 +25,4 @@
|
||||
goverlay
|
||||
yad
|
||||
];
|
||||
|
||||
# Create steam session script
|
||||
environment.etc."steam-session-greetd".source = pkgs.writeShellScript "steam-session-greetd" ''
|
||||
export STEAM_RUNTIME=1
|
||||
export SDL_VIDEODRIVER=wayland
|
||||
export QT_QPA_PLATFORM=wayland
|
||||
export GDK_BACKEND=wayland
|
||||
export XDG_CURRENT_DESKTOP=Steam
|
||||
export XDG_SESSION_TYPE=wayland
|
||||
exec ${pkgs.gamescope}/bin/gamescope --adaptive-sync --hdr-enabled --rt --steam -- ${pkgs.steam}/bin/steam -pipewire-dmabuf -tenfoot
|
||||
'';
|
||||
|
||||
# Create system-wide session files
|
||||
environment.etc."xdg/wayland-sessions/steam-session.desktop".text = ''
|
||||
[Desktop Entry]
|
||||
Name=Steam Session
|
||||
Comment=Steam Deck-like gaming session with gamescope
|
||||
Exec=/etc/steam-session-greetd
|
||||
Type=Application
|
||||
DesktopNames=steam
|
||||
'';
|
||||
|
||||
}
|
||||
|
||||
@@ -34,4 +34,25 @@
|
||||
# disable framework kernel module
|
||||
# https://github.com/NixOS/nixos-hardware/issues/1330
|
||||
hardware.framework.enableKmod = false;
|
||||
|
||||
# Greetd display manager
|
||||
services.greetd = {
|
||||
enable = true;
|
||||
settings = {
|
||||
default_session = {
|
||||
command = "${lib.getExe pkgs.tuigreet} --sessions /etc/xdg/wayland-sessions/ --time";
|
||||
user = username;
|
||||
};
|
||||
terminal.vt = lib.mkForce 2;
|
||||
};
|
||||
};
|
||||
|
||||
environment.etc."xdg/wayland-sessions/niri-session.desktop".text = ''
|
||||
[Desktop Entry]
|
||||
Name=Niri Session
|
||||
Comment=Niri Wayland compositor
|
||||
Exec=niri-session
|
||||
Type=Application
|
||||
DesktopNames=niri
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
inputs.nixos-hardware.nixosModules.common-cpu-amd-zenpower
|
||||
inputs.impermanence.nixosModules.impermanence
|
||||
inputs.disko.nixosModules.disko
|
||||
inputs.jovian-nixos.nixosModules.default
|
||||
];
|
||||
|
||||
fileSystems."/media/games" = {
|
||||
@@ -58,4 +59,17 @@
|
||||
systemd.services.lactd.wantedBy = [ "multi-user.target" ];
|
||||
|
||||
systemd.services.lactd.serviceConfig.ExecStartPre = "${lib.getExe pkgs.bash} -c \"sleep 3s\"";
|
||||
|
||||
jovian = {
|
||||
devices.steamdeck.enable = false;
|
||||
steam = {
|
||||
enable = true;
|
||||
autoStart = true;
|
||||
desktopSession = "niri";
|
||||
user = username;
|
||||
};
|
||||
};
|
||||
|
||||
# Disable gamescope from common.nix to avoid conflict with jovian-nixos
|
||||
programs.gamescope.enable = lib.mkForce false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user