diff --git a/flake.lock b/flake.lock index 2644a3f9..7f14b79b 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,27 @@ { "nodes": { + "aagl": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1757804162, + "narHash": "sha256-yHMlD/8m4RQOrFwtaaZUfKn6hr0i3DhkoD+Gzcd2qns=", + "owner": "ezKEa", + "repo": "aagl-gtk-on-nix", + "rev": "8e105b0850a1c9bc81affcae689db92f35d28595", + "type": "github" + }, + "original": { + "owner": "ezKEa", + "repo": "aagl-gtk-on-nix", + "type": "github" + } + }, "agenix": { "inputs": { "darwin": "darwin", @@ -164,6 +186,22 @@ } }, "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_3": { "flake": false, "locked": { "lastModified": 1696426674, @@ -179,7 +217,7 @@ "type": "github" } }, - "flake-compat_3": { + "flake-compat_4": { "locked": { "lastModified": 1746162366, "narHash": "sha256-5SSSZ/oQkwfcAz/o/6TlejlVGqeK08wyREBQ5qFFPhM=", @@ -194,7 +232,7 @@ "type": "github" } }, - "flake-compat_4": { + "flake-compat_5": { "flake": false, "locked": { "lastModified": 1747046372, @@ -329,9 +367,9 @@ }, "ghostty": { "inputs": { - "flake-compat": "flake-compat", + "flake-compat": "flake-compat_2", "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "zig": "zig", "zon2nix": "zon2nix" }, @@ -466,11 +504,11 @@ ] }, "locked": { - "lastModified": 1757503661, - "narHash": "sha256-bBh9sAJn0x/EdCVA6NYj/hXpcW1YBLCRMgn8A2T1l2E=", + "lastModified": 1757809953, + "narHash": "sha256-29mlXbfAJhz9cWVrPP4STvVPDVZFCfCOmaIN5lFJa+Y=", "owner": "nix-community", "repo": "home-manager", - "rev": "3c97248d6f896232355735e34bb518ae9f130c5d", + "rev": "17a10049486f6698fca32097d8f52c0c895542b0", "type": "github" }, "original": { @@ -483,13 +521,13 @@ "lanzaboote": { "inputs": { "crane": "crane", - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat_3", "flake-parts": "flake-parts_2", "nixpkgs": [ "nixpkgs" ], "pre-commit-hooks-nix": "pre-commit-hooks-nix", - "rust-overlay": "rust-overlay" + "rust-overlay": "rust-overlay_2" }, "locked": { "lastModified": 1737639419, @@ -544,7 +582,7 @@ "inputs": { "niri-stable": "niri-stable", "niri-unstable": "niri-unstable", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "nixpkgs-stable": "nixpkgs-stable_2", "xwayland-satellite-stable": "xwayland-satellite-stable", "xwayland-satellite-unstable": "xwayland-satellite-unstable" @@ -654,7 +692,7 @@ }, "nixos-apple-silicon": { "inputs": { - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat_4", "nixpkgs": [ "nixpkgs" ], @@ -720,15 +758,18 @@ }, "nixpkgs": { "locked": { - "lastModified": 1748189127, - "narHash": "sha256-zRDR+EbbeObu4V2X5QCd2Bk5eltfDlCr5yvhBwUT6pY=", - "rev": "7c43f080a7f28b2774f3b3f43234ca11661bf334", - "type": "tarball", - "url": "https://releases.nixos.org/nixos/25.05/nixos-25.05.802491.7c43f080a7f2/nixexprs.tar.xz" + "lastModified": 1744536153, + "narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "18dd725c29603f582cf1900e0d25f9f1063dbf11", + "type": "github" }, "original": { - "type": "tarball", - "url": "https://channels.nixos.org/nixos-25.05/nixexprs.tar.xz" + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" } }, "nixpkgs-darwin": { @@ -859,6 +900,19 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1748189127, + "narHash": "sha256-zRDR+EbbeObu4V2X5QCd2Bk5eltfDlCr5yvhBwUT6pY=", + "rev": "7c43f080a7f28b2774f3b3f43234ca11661bf334", + "type": "tarball", + "url": "https://releases.nixos.org/nixos/25.05/nixos-25.05.802491.7c43f080a7f2/nixexprs.tar.xz" + }, + "original": { + "type": "tarball", + "url": "https://channels.nixos.org/nixos-25.05/nixexprs.tar.xz" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1755972213, "narHash": "sha256-VYK7aDAv8H1enXn1ECRHmGbeY6RqLnNwUJkOwloIsko=", @@ -871,7 +925,7 @@ "url": "https://channels.nixos.org/nixos-unstable-small/nixexprs.tar.xz" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1757347588, "narHash": "sha256-tLdkkC6XnsY9EOZW9TlpesTclELy8W7lL2ClL+nma8o=", @@ -887,7 +941,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1757347588, "narHash": "sha256-tLdkkC6XnsY9EOZW9TlpesTclELy8W7lL2ClL+nma8o=", @@ -908,7 +962,7 @@ "nixpkgs": [ "nixpkgs" ], - "rust-overlay": "rust-overlay_2" + "rust-overlay": "rust-overlay_3" }, "locked": { "lastModified": 1731006591, @@ -962,7 +1016,7 @@ }, "pre-commit-hooks": { "inputs": { - "flake-compat": "flake-compat_4", + "flake-compat": "flake-compat_5", "gitignore": "gitignore_2", "nixpkgs": [ "nixpkgs" @@ -1026,6 +1080,7 @@ }, "root": { "inputs": { + "aagl": "aagl", "agenix": "agenix", "anyrun": "anyrun", "blender-bin": "blender-bin", @@ -1043,7 +1098,7 @@ "nixos-apple-silicon": "nixos-apple-silicon", "nixos-generators": "nixos-generators", "nixpak": "nixpak", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "nixpkgs-darwin": "nixpkgs-darwin", "nixpkgs-ollama": "nixpkgs-ollama", "nixpkgs-patched": "nixpkgs-patched", @@ -1058,6 +1113,24 @@ } }, "rust-overlay": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1754575663, + "narHash": "sha256-afOx8AG0KYtw7mlt6s6ahBBy7eEHZwws3iCRoiuRQS4=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "6db0fb0e9cec2e9729dc52bf4898e6c135bb8a0f", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "rust-overlay_2": { "inputs": { "nixpkgs": [ "lanzaboote", @@ -1078,7 +1151,7 @@ "type": "github" } }, - "rust-overlay_2": { + "rust-overlay_3": { "inputs": { "flake-utils": "flake-utils_2", "nixpkgs": [ @@ -1261,7 +1334,7 @@ }, "zon2nix": { "inputs": { - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1757167408, diff --git a/flake.nix b/flake.nix index 17471b7d..8bc60e50 100644 --- a/flake.nix +++ b/flake.nix @@ -98,11 +98,6 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - nix-gaming = { - url = "github:fufexan/nix-gaming"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - disko = { url = "github:nix-community/disko/v1.11.0"; inputs.nixpkgs.follows = "nixpkgs"; @@ -146,6 +141,17 @@ niri.url = "github:sodiboo/niri-flake"; + # -------------- Gaming --------------------- + + nix-gaming = { + url = "github:fufexan/nix-gaming"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + aagl = { + url = "github:ezKEa/aagl-gtk-on-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + ######################## Some non-flake repositories ######################################### polybar-themes = { diff --git a/home/linux/gui/base/gaming.nix b/home/linux/gui/base/gaming.nix new file mode 100644 index 00000000..841c8e21 --- /dev/null +++ b/home/linux/gui/base/gaming.nix @@ -0,0 +1,46 @@ +{ pkgs, osConfig, ... }: +{ + # ========================================================================== + # Other Optimizations + # Usage: + # Lutris - enable advanced options, go to the System options -> Command prefix, add: `mangohud` + # Steam - add this as a launch option: `mangohud %command%` / `gamemoderun %command%` + # ========================================================================== + + home.packages = with pkgs; [ + # https://github.com/flightlessmango/MangoHud + # a simple overlay program for monitoring FPS, temperature, CPU and GPU load, and more. + mangohud + # a game launcher - great for epic games and gog games + (heroic.override { + extraPkgs = pkgs: [ + pkgs.gamescope + ]; + }) + # GUI for installing custom Proton versions like GE_Proton + protonplus + winetricks + # https://github.com/Open-Wine-Components/umu-launcher + # a unified launcher for Windows games on Linux + umu-launcher + ]; + + # a GUI game launcher for Steam/GoG/Epic + programs.lutris = { + enable = true; + defaultWinePackage = pkgs.proton-ge-bin; + steamPackage = osConfig.programs.steam.package; + protonPackages = [ pkgs.proton-ge-bin ]; + winePackages = with pkgs; [ + wineWow64Packages.full + wineWowPackages.stagingFull + ]; + extraPackages = with pkgs; [ + winetricks + gamescope + gamemode + mangohud + umu-launcher + ]; + }; +} diff --git a/home/linux/gui/niri/windowrules.nix b/home/linux/gui/niri/windowrules.nix index e7186050..1c511f9b 100644 --- a/home/linux/gui/niri/windowrules.nix +++ b/home/linux/gui/niri/windowrules.nix @@ -13,7 +13,7 @@ niri: { # Get all the window's information via: # niri msg windows - # --------------- Terminal --------------- + # --------------- 1Terminal --------------- (plain "window-rule" [ (leaf "match" { app-id = "foot"; }) (leaf "open-on-workspace" "1terminal") @@ -32,7 +32,7 @@ niri: { (leaf "open-maximized" true) ]) - # --------------- Browser --------------- + # --------------- 2Browser --------------- (plain "window-rule" [ (leaf "match" { app-id = "firefox"; }) @@ -50,7 +50,7 @@ niri: { (leaf "open-maximized" true) ]) - # --------------- Chatting --------------- + # --------------- 3Chatting --------------- (plain "window-rule" [ (leaf "match" { app-id = "org.telegram.desktop"; }) (leaf "open-on-workspace" "3chat") @@ -64,15 +64,56 @@ niri: { (leaf "open-on-workspace" "3chat") ]) - # --------------- Networking --------------- + # --------------- 4Gaming --------------- + + (plain "window-rule" [ + (leaf "match" { app-id = "steam"; }) + (leaf "open-on-workspace" "4gaming") + ]) + (plain "window-rule" [ + (leaf "match" { app-id = "steam_app_default"; }) + (leaf "open-on-workspace" "4gaming") + ]) + (plain "window-rule" [ + (leaf "match" { app-id = "heroic"; }) + (leaf "open-on-workspace" "4gaming") + ]) + (plain "window-rule" [ + (leaf "match" { app-id = "net.lutris.Lutris"; }) + (leaf "open-on-workspace" "4gaming") + ]) + (plain "window-rule" [ + (leaf "match" { app-id = "com.vysp3r.ProtonPlus"; }) + (leaf "open-on-workspace" "4gaming") + ]) + (plain "window-rule" [ + # Run anime games on Linux + (leaf "match" { app-id = "^moe.launcher"; }) + (leaf "open-on-workspace" "4gaming") + ]) + (plain "window-rule" [ + # All *.exe (Windows APPs) + (leaf "match" { app-id = "\.exe$"; }) + (leaf "open-on-workspace" "4gaming") + ]) + + # --------------- 6File --------------- + (plain "window-rule" [ + (leaf "match" { app-id = "com.github.johnfactotum.Foliate"; }) + (leaf "open-on-workspace" "6file") + ]) + (plain "window-rule" [ + (leaf "match" { app-id = "thunar"; }) + (leaf "open-on-workspace" "6file") + ]) + + # --------------- 0Other --------------- (plain "window-rule" [ (leaf "match" { app-id = "clash-verge"; }) (leaf "open-on-workspace" "0other") ]) - # --------------- Meeting --------------- - (plain "window-rule" [ (leaf "match" { app-id = "Zoom Workplace"; }) (leaf "open-on-workspace" "0other") diff --git a/hosts/idols-ai/gaming.nix b/hosts/idols-ai/gaming.nix index 97945c30..25191a20 100644 --- a/hosts/idols-ai/gaming.nix +++ b/hosts/idols-ai/gaming.nix @@ -1,6 +1,17 @@ -{ pkgs, nix-gaming, ... }: { - # https://wiki.archlinux.org/title/steam + pkgs, + nix-gaming, + aagl, + ... +}: +{ + # ========================================================================== + # Gaming on Linux + # + # can give you an idea what works where and how. + # Begineer Guide: + # ========================================================================== + # Games installed by Steam works fine on NixOS, no other configuration needed. programs.steam = { # Some location that should be persistent: @@ -29,21 +40,9 @@ imports = with nix-gaming.nixosModules; [ pipewireLowLatency platformOptimizations - ]; - # ========================================================================== - # Other Optimizations - # Usage: - # Lutris - enable advanced options, go to the System options -> Command prefix, add: `mangohud` - # Steam - add this as a launch option: `mangohud %command%` / `gamemoderun %command%` - # ========================================================================== - - environment.systemPackages = with pkgs; [ - # https://github.com/flightlessmango/MangoHud - # a simple overlay program for monitoring FPS, temperature, CPU and GPU load, and more. - mangohud - # a GUI game launcher for Steam/GoG/Epic - lutris + # run anime games on Linux + aagl.nixosModules.default ]; # Optimise Linux system performance on demand @@ -55,4 +54,11 @@ # https://github.com/FeralInteractive/GameMode#apps-with-gamemode-integration # simply running the game will automatically activate GameMode. programs.gamemode.enable = pkgs.stdenv.isx86_64; + + # run anime games on Linux + # https://github.com/an-anime-team/ + programs.anime-game-launcher.enable = true; # Genshin: Impact + programs.honkers-railway-launcher.enable = true; # Honkai: Star Rail + programs.honkers-launcher.enable = false; # Honkai: Impact 3 + programs.sleepy-launcher.enable = false; # Zenless Zon Zero } diff --git a/hosts/idols-ai/home.nix b/hosts/idols-ai/home.nix index 0fd7e31c..095b99bc 100644 --- a/hosts/idols-ai/home.nix +++ b/hosts/idols-ai/home.nix @@ -64,11 +64,12 @@ ]) # ============= Named Workspaces ============= - (node "workspace" "1terminal" [ (leaf "open-on-output" "HDMI-A-1") ]) (node "workspace" "2browser" [ (leaf "open-on-output" "DP-2") ]) + (node "workspace" "4gaming" [ (leaf "open-on-output" "DP-2") ]) + (node "workspace" "5music" [ (leaf "open-on-output" "DP-2") ]) + + (node "workspace" "1terminal" [ (leaf "open-on-output" "HDMI-A-1") ]) (node "workspace" "3chat" [ (leaf "open-on-output" "HDMI-A-1") ]) - (node "workspace" "4music" [ (leaf "open-on-output" "DP-2") ]) - (node "workspace" "5mail" [ (leaf "open-on-output" "DP-2") ]) (node "workspace" "6file" [ (leaf "open-on-output" "HDMI-A-1") ]) (node "workspace" "0other" [ (leaf "open-on-output" "HDMI-A-1") ]) ]; diff --git a/hosts/idols-ai/preservation.nix b/hosts/idols-ai/preservation.nix index 8524965c..9c78a32f 100644 --- a/hosts/idols-ai/preservation.nix +++ b/hosts/idols-ai/preservation.nix @@ -231,13 +231,18 @@ in # Games / Media # ====================================== + "Games" ".steam" ".config/blender" ".config/LDtk" + ".config/heroic" + ".config/lutris" + ".local/share/umu" ".local/share/Steam" - ".local/share/PrismLauncher" + ".local/state/Heroic" + ".local/share/lutris" ".local/share/tiled" ".local/share/GOG.com" ".local/share/StardewValley"