hosts: steamdeck: separate gnome and steam config

This commit is contained in:
Kabbone 2023-07-27 21:44:27 +02:00
parent 0b304408b3
commit 8e61ea6503
Signed by: Kabbone
SSH Key Fingerprint: SHA256:A5zPB5I6u5V78V51c362BBdCwhDhfDUVbt7NfKdjWBY
5 changed files with 107 additions and 68 deletions

View File

@ -22,6 +22,7 @@
{
imports = # For now, if applying to other system, swap files
[(import ./hardware-configuration.nix)] ++ # Current system hardware config @ /etc/nixos/hardware-configuration.nix
[(import ../../modules/desktop/steam/default.nix)] ++ # Window Manager
[(import ../../modules/desktop/gnome/default.nix)] ++ # Window Manager
[(import ../../modules/desktop/virtualisation/docker.nix)] ++ # Docker
(import ../../modules/hardware); # Hardware devices

View File

@ -16,7 +16,7 @@
{
imports =
[
#../../modules/desktop/hyprland/home.nix # Window Manager
../../modules/desktop/steam/home.nix # Window Manager
../../modules/desktop/gnome/home.nix # Window Manager
../../modules/home.nix # Window Manager
];

View File

@ -10,32 +10,14 @@
# └─ ./gnome
# └─ default.nix *
#
{ config, lib, user, pkgs, jovian-nixos, ... }:
{ config, lib, user, pkgs, ... }:
{
imports = [
(jovian-nixos + "/modules")
];
jovian = {
steam.enable = true;
devices.steamdeck = {
enable = true;
};
};
hardware.pulseaudio.enable = lib.mkForce false;
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
environment.systemPackages = with pkgs; [
gnome.gnome-terminal
gnomeExtensions.dash-to-dock
steamdeck-firmware
rocm-opencl-icd
rocm-opencl-runtime
clinfo
@ -54,52 +36,52 @@
};
};
systemd.services.gamescope-switcher = {
wantedBy = [ "graphical.target" ];
serviceConfig = {
User = 2000;
PAMName = "login";
WorkingDirectory = "~";
TTYPath = "/dev/tty7";
TTYReset = "yes";
TTYVHangup = "yes";
TTYVTDisallocate = "yes";
StandardInput = "tty-fail";
StandardOutput = "journal";
StandardError = "journal";
UtmpIdentifier = "tty7";
UtmpMode = "user";
Restart = "always";
};
script = ''
set-session () {
mkdir -p ~/.local/state
>~/.local/state/steamos-session-select echo "$1"
}
consume-session () {
if [[ -e ~/.local/state/steamos-session-select ]]; then
cat ~/.local/state/steamos-session-select
rm ~/.local/state/steamos-session-select
else
echo "gamescope"
fi
}
while :; do
session=$(consume-session)
case "$session" in
plasma)
dbus-run-session -- gnome-shell --display-server --wayland
;;
gamescope)
steam-session
;;
esac
done
'';
};
# systemd.services.gamescope-switcher = {
# wantedBy = [ "graphical.target" ];
# serviceConfig = {
# User = 2000;
# PAMName = "login";
# WorkingDirectory = "~";
#
# TTYPath = "/dev/tty7";
# TTYReset = "yes";
# TTYVHangup = "yes";
# TTYVTDisallocate = "yes";
#
# StandardInput = "tty-fail";
# StandardOutput = "journal";
# StandardError = "journal";
#
# UtmpIdentifier = "tty7";
# UtmpMode = "user";
#
# Restart = "always";
# };
#
# script = ''
# set-session () {
# mkdir -p ~/.local/state
# >~/.local/state/steamos-session-select echo "$1"
# }
# consume-session () {
# if [[ -e ~/.local/state/steamos-session-select ]]; then
# cat ~/.local/state/steamos-session-select
# rm ~/.local/state/steamos-session-select
# else
# echo "gamescope"
# fi
# }
# while :; do
# session=$(consume-session)
# case "$session" in
# plasma)
# dbus-run-session -- gnome-shell --display-server --wayland
# ;;
# gamescope)
# steam-session
# ;;
# esac
# done
# '';
# };
}

View File

@ -0,0 +1,40 @@
#
# Gnome configuration
#
# flake.nix
# ├─ ./hosts
# │ └─ ./laptop
# │ └─ default.nix
# └─ ./modules
# └─ ./desktop
# └─ ./gnome
# └─ default.nix *
#
{ config, lib, user, pkgs, jovian-nixos, ... }:
{
imports = [
(jovian-nixos + "/modules")
];
jovian = {
steam.enable = true;
devices.steamdeck = {
enable = true;
};
};
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
environment.systemPackages = with pkgs; [
steamdeck-firmware
];
# services = {
# };
}

View File

@ -0,0 +1,16 @@
#
# Gnome NixOS & Home manager configuration
#
# flake.nix
# ├─ ./hosts
# │ └─ ./steamdeck
# │ └─ home.nix
# └─ ./modules
# └─ ./desktop
# └─ ./steam
# └─ home.nix *
#
{ config, lib, pkgs, ... }:
{
}