Add initial support for Steam Deck

This commit is contained in:
Jimbo 2024-09-02 19:07:17 -04:00
parent 9cbf89733a
commit 5b388c59d4
7 changed files with 127 additions and 45 deletions

View file

@ -67,6 +67,12 @@
nixos-mailserver.nixosModule
];
};
JimDeck = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
./nixos/deck.nix
];
};
};
# Standalone home-manager configuration entrypoint
@ -87,6 +93,13 @@
./home-manager/jimbo_server.nix
];
};
"jimbo@JimDeck" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home-manager/jimbo_server.nix
];
};
# Derivation for ssh envrionments on other people's servers
"jimbo@SSH" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;

37
nixos/deck.nix Normal file
View file

@ -0,0 +1,37 @@
{
imports = [
# Base configs
./base.nix
# Import users and groups
./users/jimbo.nix
./users/groups.nix
# Desktop only
./desktop/misc.nix
./desktop/sway.nix
./desktop/gaming.nix
./desktop/pipewire.nix
./desktop/bluetooth.nix
./desktop/firewall.nix
./desktop/fonts.nix
./desktop/qt.nix
# Steam Deck only
./deck/jovian.nix
# Modules
./modules/security.nix
# Hardware
./hardware/machines/deck.nix
./hardware/systemdboot.nix
./hardware/opengl.nix
# Services
./services/openssh.nix
./services/mpd.nix
];
networking.hostName = "JimDesktop";
}

View file

@ -0,0 +1,19 @@
{pkgs, ...}: {
services = {
# Configure greetd for "auto" login (single user only)
greetd = {
enable = true;
restart = true;
settings = {
terminal = {
vt = 2;
switch = true;
};
default_session = {
command = "start-gamescope-session";
user = "jimbo";
};
};
};
};
}

15
nixos/deck/jovian.nix Normal file
View file

@ -0,0 +1,15 @@
{
imports = [
./greetd-steam.nix
];
jovian = {
steam = {
enable = true;
desktopSession = "sway";
};
decky-loader.enable = true;
devices.steamdeck.enable = true;
steamos.useSteamOSConfig = true;
};
}

View file

@ -10,6 +10,7 @@
# Desktop only
./desktop/misc.nix
./desktop/sway.nix
./desktop/greetd-sway.nix
./desktop/printing.nix
./desktop/gaming.nix
./desktop/pipewire.nix

View file

@ -0,0 +1,39 @@
{pkgs, ...}: {
services = {
# Configure greetd for "auto" login (single user only)
greetd = let
startSway = pkgs.writeScript "startsway" ''
# Use NVIDIA variables if drivers are in use
if lspci -k | grep "Kernel driver in use: nvidia" &> /dev/null; then
# NVIDIA/AMD variables
export LIBVA_DRIVER_NAME=nvidia
export GBM_BACKEND=nvidia-drm
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export WLR_NO_HARDWARE_CURSORS=1
else
:
fi
# Sway/Wayland
export XDG_CURRENT_DESKTOP=sway
export QT_QPA_PLATFORM="wayland;xcb"
# Start Sway
sway --unsupported-gpu
'';
in {
enable = true;
restart = true;
settings = {
terminal = {
vt = 2;
switch = true;
};
default_session = {
command = "${startSway}";
user = "jimbo";
};
};
};
};
}

View file

@ -1,54 +1,12 @@
{pkgs, ...}: {
services = {
# Configure greetd for "auto" login (single user only)
greetd = let
startSway = pkgs.writeScript "startsway" ''
# Use NVIDIA variables if drivers are in use
if lspci -k | grep "Kernel driver in use: nvidia" &> /dev/null; then
# NVIDIA/AMD variables
export LIBVA_DRIVER_NAME=nvidia
export GBM_BACKEND=nvidia-drm
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export WLR_NO_HARDWARE_CURSORS=1
else
:
fi
# Sway/Wayland
export XDG_CURRENT_DESKTOP=sway
export QT_QPA_PLATFORM="wayland;xcb"
# Start Sway
sway --unsupported-gpu
'';
in {
enable = true;
restart = true;
settings = {
terminal = {
vt = 2;
switch = true;
};
default_session = {
command = "${startSway}";
user = "jimbo";
};
};
};
dbus.enable = true;
};
programs.xwayland = {
enable = true;
};
# Enable backlight and theme control
programs = {
dconf.enable = true;
light.enable = true;
xwayland.enable = true;
};
# Packages needed for Wayland
services.dbus.enable = true;
environment.systemPackages = with pkgs; [
wl-clipboard
wdisplays