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

View File

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

View File

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