stockholm/lass/2configs/games.nix

97 lines
2.3 KiB
Nix
Raw Normal View History

2015-07-16 13:51:01 +00:00
{ config, pkgs, ... }:
let
mainUser = config.users.extraUsers.mainUser;
2016-12-07 09:14:27 +00:00
vdoom = pkgs.writeDash "vdoom" ''
2018-04-06 13:57:20 +00:00
${pkgs.zandronum}/bin/zandronum \
2016-12-07 09:14:27 +00:00
-fov 120 \
"$@"
'';
2016-12-01 16:10:31 +00:00
doom = pkgs.writeDash "doom" ''
DOOM_DIR=''${DOOM_DIR:-~/doom/}
2016-12-07 09:14:27 +00:00
${vdoom} \
2019-10-14 13:34:03 +00:00
-file $DOOM_DIR/lib/brutalv21.pk3 \
2016-12-01 16:10:31 +00:00
"$@"
'';
doom1 = pkgs.writeDashBin "doom1" ''
DOOM_DIR=''${DOOM_DIR:-~/doom/}
${doom} -iwad $DOOM_DIR/wads/stock/doom.wad "$@"
'';
doom2 = pkgs.writeDashBin "doom2" ''
DOOM_DIR=''${DOOM_DIR:-~/doom/}
${doom} -iwad $DOOM_DIR/wads/stock/doom2.wad "$@"
'';
2016-12-07 09:14:27 +00:00
vdoom1 = pkgs.writeDashBin "vdoom1" ''
DOOM_DIR=''${DOOM_DIR:-~/doom/}
${vdoom} -iwad $DOOM_DIR/wads/stock/doom.wad "$@"
'';
vdoom2 = pkgs.writeDashBin "vdoom2" ''
DOOM_DIR=''${DOOM_DIR:-~/doom/}
${vdoom} -iwad $DOOM_DIR/wads/stock/doom2.wad "$@"
'';
2015-07-16 13:51:01 +00:00
2017-02-22 17:21:30 +00:00
doomservercfg = pkgs.writeText "doomserver.cfg" ''
skill 7
#survival true
#sv_maxlives 4
#sv_norespawn true
#sv_weapondrop true
no_jump true
#sv_noweaponspawn true
sv_sharekeys true
sv_survivalcountdowntime 1
sv_noteamselect true
sv_updatemaster false
#sv_coop_loseinventory true
#cl_startasspectator false
#lms_spectatorview false
'';
vdoomserver = pkgs.writeDashBin "vdoomserver" ''
DOOM_DIR=''${DOOM_DIR:-~/doom/}
2018-04-06 13:57:20 +00:00
${pkgs.zandronum}/bin/zandronum-server \
2017-02-22 17:21:30 +00:00
+exec ${doomservercfg} \
"$@"
'';
2015-07-16 13:51:01 +00:00
in {
users.extraUsers = {
games = {
name = "games";
description = "user playing games";
home = "/home/games";
2022-05-29 17:54:55 +00:00
extraGroups = [ "audio" "video" "input" "loot" "pipewire" ];
2015-07-16 13:51:01 +00:00
createHome = true;
useDefaultShell = true;
2018-01-30 18:05:10 +00:00
packages = with pkgs; [
2020-03-17 20:39:38 +00:00
# minecraft
2020-09-15 18:38:17 +00:00
# ftb
# steam-run
# scummvm
# dolphinEmu
2022-09-19 11:34:16 +00:00
doom1
doom2
2020-09-15 18:38:17 +00:00
# protontricks
2022-09-19 11:34:16 +00:00
vdoom1
2020-09-15 18:38:17 +00:00
# vdoom2
# vdoomserver
2019-10-14 13:33:40 +00:00
retroarchBare
2018-01-30 18:05:10 +00:00
];
2021-06-05 10:16:40 +00:00
isNormalUser = true;
2015-07-16 13:51:01 +00:00
};
};
2018-05-14 20:04:59 +00:00
hardware.opengl.driSupport32Bit = true;
hardware.pulseaudio.support32Bit = true;
2015-07-16 13:51:01 +00:00
security.sudo.extraConfig = ''
${mainUser.name} ALL=(games) NOPASSWD: ALL
'';
2017-02-22 17:22:06 +00:00
krebs.iptables.tables.filter.INPUT.rules = [
{ predicate = "-p tcp --dport 10666"; target = "ACCEPT"; }
2017-02-23 15:32:46 +00:00
{ predicate = "-p udp --dport 10666"; target = "ACCEPT"; }
2017-02-22 17:22:06 +00:00
];
2015-07-16 13:51:01 +00:00
}