diff --git a/home-manager/home.nix b/home-manager/home.nix index c8ba072b..d3cf1435 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -15,6 +15,7 @@ ./gtk ./shell ./firefox + ./steam ]; nixpkgs = { @@ -59,7 +60,6 @@ xfce.thunar-volman xfce.thunar-archive-plugin gnome.file-roller - gvfs swaybg wireguard-tools wpa_supplicant @@ -95,18 +95,31 @@ systemd.enable = true; }; - xdg.portal = { - enable = true; - xdgOpenUsePortal = true; - config = { - common.default = [ "gtk" ]; - hyprland.default = [ - "gtk" - "hyprland" - ]; + xdg = { + userDirs = { + enable = true; + createDirectories = true; + desktop = "${config.home.homeDirectory}/desktop"; + documents = "${config.home.homeDirectory}/documents"; + download = "${config.home.homeDirectory}/downloads"; + music = "${config.home.homeDirectory}/media/music"; + pictures = "${config.home.homeDirectory}/media/images"; + publicShare = "${config.home.homeDirectory}/documents/share"; + templates = "${config.home.homeDirectory}/documents/templates"; + videos = "${config.home.homeDirectory}/media/videos"; + }; + portal = { + enable = true; + xdgOpenUsePortal = true; + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + config = { + common.default = [ "gtk" ]; + hyprland.default = [ + "gtk" + "hyprland" + ]; + }; }; - - extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; }; home.sessionVariables = { MOZ_ENABLE_WAYLAND = 1; diff --git a/home-manager/steam/default.nix b/home-manager/steam/default.nix new file mode 100644 index 00000000..5ce90bde --- /dev/null +++ b/home-manager/steam/default.nix @@ -0,0 +1,61 @@ +{ + pkgs, + lib, + config, + ... +}: +let + steam-with-pkgs = pkgs.steam.override { + extraPkgs = + pkgs: with pkgs; [ + xorg.libXcursor + xorg.libXi + xorg.libXinerama + xorg.libXScrnSaver + libpng + libpulseaudio + libvorbis + stdenv.cc.cc.lib + libkrb5 + keyutils + gamescope + mangohud + ]; + }; + + monitor = lib.head (lib.filter (m: m.primary) config.monitors); + steam-session = + let + gamescope = lib.concatStringsSep " " [ + (lib.getExe pkgs.gamescope) + "--output-width ${toString monitor.width}" + "--output-height ${toString monitor.height}" + "--framerate-limit ${toString monitor.refreshRate}" + "--prefer-output ${monitor.name}" + "--adaptive-sync" + "--expose-wayland" + "--steam" + ]; + steam = lib.concatStringsSep " " [ + "steam" + "steam://open/bigpicture" + ]; + in + pkgs.writeTextDir "share/wayland-sessions/steam-sesson.desktop" # ini + + '' + [Desktop Entry] + Name=Steam Session + Exec=${gamescope} -- ${steam} + Type=Application + ''; +in +{ + home.packages = [ + steam-with-pkgs + steam-session + pkgs.gamescope + pkgs.mangohud + pkgs.protontricks + ]; +}