From 8990a63a1e5b23de9f2bc4c70480e488721a824c Mon Sep 17 00:00:00 2001 From: oddlama Date: Fri, 8 Sep 2023 18:08:36 +0200 Subject: [PATCH] feat: add LoL --- users/myuser/graphical/default.nix | 29 +++++++++++++--------- users/myuser/graphical/games/lutris.nix | 33 +++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 11 deletions(-) create mode 100644 users/myuser/graphical/games/lutris.nix diff --git a/users/myuser/graphical/default.nix b/users/myuser/graphical/default.nix index 7982ab3..73b3309 100644 --- a/users/myuser/graphical/default.nix +++ b/users/myuser/graphical/default.nix @@ -1,14 +1,21 @@ -{pkgs, ...}: { - imports = [ - #./games/league-of-legends.nix - #./games/steam.nix - - ./discord.nix - ./firefox.nix - ./kitty.nix - ./signal.nix - ./sway.nix - ]; +{ + lib, + pkgs, + nixosConfig, + ... +}: { + imports = + [ + ./discord.nix + ./firefox.nix + ./kitty.nix + ./signal.nix + ./sway.nix + ] + ++ lib.optionals (nixosConfig.node.name == "potksed") [ + ./games/lutris.nix + #./games/steam.nix + ]; home = { packages = with pkgs; [ diff --git a/users/myuser/graphical/games/lutris.nix b/users/myuser/graphical/games/lutris.nix new file mode 100644 index 0000000..c8517d5 --- /dev/null +++ b/users/myuser/graphical/games/lutris.nix @@ -0,0 +1,33 @@ +{ + pkgs, + lib, + ... +}: { + home.packages = with pkgs; [ + lutris + wineWowPackages.stable + ]; + + home.persistence."/state".directories = [ + ".config/lutris" + ".local/share/lutris" + "Games" + ]; + + xdg.desktopEntries.LeagueOfLegends = { + name = "League of Legends"; + icon = "league-of-legends"; + exec = toString (pkgs.writeShellScript "league-launcher-script" '' + set -euo pipefail + if [[ "$(sysctl -n abi.vsyscall32)" != 0 ]]; then + echo "Please disable abi.vsyscall32 as root to make the anti-cheat happy:" + echo " sysctl -w abi.vsyscall32=0" + exit 1 + fi + + LUTRIS_SKIP_INIT=1 ${pkgs.lutris}/bin/lutris lutris:rungame/league-of-legends + ''); + categories = ["Game"]; + type = "Application"; + }; +}