dotfiles/modules/nixos/gaming/legendary.nix

57 lines
1.5 KiB
Nix
Raw Normal View History

2022-06-04 01:58:20 +00:00
{ config, pkgs, lib, ... }:
let home-packages = config.home-manager.users.${config.user}.home.packages;
in {
2022-05-28 14:34:00 +00:00
2022-12-21 21:18:03 +00:00
options.gaming.legendary.enable =
lib.mkEnableOption "Legendary Epic Games launcher.";
2022-05-28 14:34:00 +00:00
2022-12-21 21:18:03 +00:00
config = lib.mkIf config.gaming.legendary.enable {
2022-05-28 14:34:00 +00:00
environment.systemPackages = with pkgs; [
legendary-gl
rare # GUI for Legendary (not working)
2022-05-28 20:48:02 +00:00
wineWowPackages.stable # 32-bit and 64-bit wineWowPackages, see https://nixos.wiki/wiki/Wine
2022-05-28 14:34:00 +00:00
];
home-manager.users.${config.user} = {
xdg.configFile."legendary/config.ini".text = ''
[Legendary]
; Disables the automatic update check
disable_update_check = false
; Disables the notice about an available update on exit
disable_update_notice = true
; Set install directory
install_dir = ${config.homePath}/media/games
2022-05-28 14:34:00 +00:00
; Make output quiet
2022-05-30 13:44:33 +00:00
log_level = error
2022-05-28 14:34:00 +00:00
'';
home.file = let
ignorePatterns = ''
.wine/
drive_c/'';
in {
".rgignore".text = ignorePatterns;
".fdignore".text = ignorePatterns;
};
2022-06-04 01:58:20 +00:00
programs.fish.functions =
lib.mkIf (builtins.elem pkgs.fzf home-packages) {
epic-games = {
body = ''
set game (legendary list 2>/dev/null \
2022-06-05 01:08:09 +00:00
| awk '/^ \* / { print $0; }' \
2022-06-04 01:58:20 +00:00
| sed -e 's/ (.*)$//' -e 's/ \* //' \
| fzf)
2022-06-05 01:08:09 +00:00
and legendary launch "$game" &> /dev/null
2022-06-04 01:58:20 +00:00
'';
};
};
2022-05-28 14:34:00 +00:00
};
};
}