Compare commits
1 Commits
ca3242c568
...
66bbccfa4c
| Author | SHA1 | Date | |
|---|---|---|---|
|
66bbccfa4c
|
@@ -33,23 +33,11 @@
|
|||||||
|
|
||||||
services.kmscon.enable = true;
|
services.kmscon.enable = true;
|
||||||
|
|
||||||
# Gamescope configuration for Steam Deck-like experience
|
|
||||||
programs = {
|
|
||||||
gamescope = {
|
|
||||||
enable = true;
|
|
||||||
capSysNice = true;
|
|
||||||
};
|
|
||||||
steam = {
|
|
||||||
enable = true;
|
|
||||||
gamescopeSession.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.greetd = {
|
services.greetd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
default_session = {
|
default_session = {
|
||||||
command = "${lib.getExe pkgs.tuigreet} --sessions --time";
|
command = "${lib.getExe pkgs.tuigreet} --time --cmd niri-session";
|
||||||
user = username;
|
user = username;
|
||||||
};
|
};
|
||||||
terminal.vt = lib.mkForce 2;
|
terminal.vt = lib.mkForce 2;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
./common.nix
|
./common.nix
|
||||||
./impermanence.nix
|
./impermanence.nix
|
||||||
./no-rgb.nix
|
./no-rgb.nix
|
||||||
# ./vr.nix
|
./vr.nix
|
||||||
|
|
||||||
inputs.nixos-hardware.nixosModules.common-cpu-amd-pstate
|
inputs.nixos-hardware.nixosModules.common-cpu-amd-pstate
|
||||||
inputs.nixos-hardware.nixosModules.common-cpu-amd-zenpower
|
inputs.nixos-hardware.nixosModules.common-cpu-amd-zenpower
|
||||||
|
|||||||
27
flake.nix
27
flake.nix
@@ -71,7 +71,6 @@
|
|||||||
lanzaboote,
|
lanzaboote,
|
||||||
nixos-hardware,
|
nixos-hardware,
|
||||||
home-manager,
|
home-manager,
|
||||||
deploy-rs,
|
|
||||||
...
|
...
|
||||||
}@inputs:
|
}@inputs:
|
||||||
let
|
let
|
||||||
@@ -85,6 +84,23 @@
|
|||||||
{
|
{
|
||||||
formatter.${system} = nixpkgs.legacyPackages.${system}.nixfmt-rfc-style;
|
formatter.${system} = nixpkgs.legacyPackages.${system}.nixfmt-rfc-style;
|
||||||
|
|
||||||
|
deploy-yarn = {
|
||||||
|
nodes.yarn = {
|
||||||
|
hostname = "desktop";
|
||||||
|
profiles.system = {
|
||||||
|
user = "root";
|
||||||
|
path = inputs.deploy-rs.lib.x86_64-linux.activate.nixos (
|
||||||
|
self.nixosConfigurations.yarn.config.system.build.toplevel
|
||||||
|
);
|
||||||
|
sshUser = "primary";
|
||||||
|
sshOpts = [
|
||||||
|
"-p"
|
||||||
|
"22"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
nixosConfigurations = nixpkgs.lib.foldl' (
|
nixosConfigurations = nixpkgs.lib.foldl' (
|
||||||
config: hostname:
|
config: hostname:
|
||||||
config
|
config
|
||||||
@@ -117,14 +133,5 @@
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
) { } hostnames;
|
) { } hostnames;
|
||||||
|
|
||||||
# Deploy-rs configuration for yarn host only
|
|
||||||
deploy.nodes.yarn = {
|
|
||||||
hostname = "desktop";
|
|
||||||
profiles.system = {
|
|
||||||
user = "root";
|
|
||||||
path = deploy-rs.lib.${system}.activate.nixos self.nixosConfigurations.yarn;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,81 +16,8 @@
|
|||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/pull/339370#issuecomment-2731336341
|
# https://github.com/NixOS/nixpkgs/pull/339370#issuecomment-2731336341
|
||||||
bs-manager
|
bs-manager
|
||||||
|
|
||||||
# Steam session scripts
|
|
||||||
(writeShellScriptBin "steam-session" ''
|
|
||||||
#!/usr/bin/env bash
|
|
||||||
set -xeuo pipefail
|
|
||||||
|
|
||||||
gamescopeArgs=(
|
|
||||||
--adaptive-sync # VRR support
|
|
||||||
--hdr-enabled
|
|
||||||
--mangoapp # performance overlay
|
|
||||||
--rt
|
|
||||||
--steam
|
|
||||||
)
|
|
||||||
|
|
||||||
steamArgs=(
|
|
||||||
-pipewire-dmabuf
|
|
||||||
-tenfoot
|
|
||||||
)
|
|
||||||
|
|
||||||
mangoConfig=(
|
|
||||||
cpu_temp
|
|
||||||
gpu_temp
|
|
||||||
ram
|
|
||||||
vram
|
|
||||||
)
|
|
||||||
|
|
||||||
mangoVars=(
|
|
||||||
MANGOHUD=1
|
|
||||||
MANGOHUD_CONFIG="$(IFS=,; echo "''${mangoConfig[*]}")"
|
|
||||||
)
|
|
||||||
|
|
||||||
export "''${mangoVars[@]}"
|
|
||||||
exec gamescope "''${gamescopeArgs[@]}" -- steam "''${steamArgs[@]}"
|
|
||||||
'')
|
|
||||||
|
|
||||||
(writeShellScriptBin "steam-session-greetd" ''
|
|
||||||
#!/usr/bin/env bash
|
|
||||||
set -xeuo pipefail
|
|
||||||
|
|
||||||
# Set environment variables for Steam gaming session
|
|
||||||
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
|
|
||||||
|
|
||||||
# Kill any existing compositor
|
|
||||||
pkill niri || true
|
|
||||||
|
|
||||||
# Start Steam in Big Picture mode with gamescope
|
|
||||||
exec steam-session
|
|
||||||
'')
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# Create desktop entry for Steam session
|
|
||||||
xdg.dataFile."wayland-sessions/steam-session.desktop".text = ''
|
|
||||||
[Desktop Entry]
|
|
||||||
Name=Steam Session
|
|
||||||
Comment=Steam Deck-like gaming session with gamescope
|
|
||||||
Exec=${config.home.homeDirectory}/.nix-profile/bin/steam-session-greetd
|
|
||||||
Type=Application
|
|
||||||
DesktopNames=steam
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Create desktop entry for Niri session
|
|
||||||
xdg.dataFile."wayland-sessions/niri-session.desktop".text = ''
|
|
||||||
[Desktop Entry]
|
|
||||||
Name=Niri Session
|
|
||||||
Comment=Niri Wayland compositor
|
|
||||||
Exec=${config.programs.niri.package}/bin/niri-session
|
|
||||||
Type=Application
|
|
||||||
DesktopNames=niri
|
|
||||||
'';
|
|
||||||
|
|
||||||
programs.obs-studio = {
|
programs.obs-studio = {
|
||||||
enable = true;
|
enable = true;
|
||||||
plugins = with pkgs.obs-studio-plugins; [
|
plugins = with pkgs.obs-studio-plugins; [
|
||||||
|
|||||||
Reference in New Issue
Block a user