stockholm/lass/2configs/games.nix

97 lines
2.3 KiB
Nix
Raw Normal View History

2015-07-16 15:51:01 +02:00
{ config, pkgs, ... }:
let
mainUser = config.users.extraUsers.mainUser;
2016-12-07 10:14:27 +01:00
vdoom = pkgs.writeDash "vdoom" ''
2018-04-06 15:57:20 +02:00
${pkgs.zandronum}/bin/zandronum \
2016-12-07 10:14:27 +01:00
-fov 120 \
"$@"
'';
2016-12-01 17:10:31 +01:00
doom = pkgs.writeDash "doom" ''
DOOM_DIR=''${DOOM_DIR:-~/doom/}
2016-12-07 10:14:27 +01:00
${vdoom} \
2019-10-14 15:34:03 +02:00
-file $DOOM_DIR/lib/brutalv21.pk3 \
2016-12-01 17:10:31 +01: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 10:14:27 +01: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 15:51:01 +02:00
2017-02-22 18:21:30 +01: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 15:57:20 +02:00
${pkgs.zandronum}/bin/zandronum-server \
2017-02-22 18:21:30 +01:00
+exec ${doomservercfg} \
"$@"
'';
2015-07-16 15:51:01 +02:00
in {
users.extraUsers = {
games = {
name = "games";
description = "user playing games";
home = "/home/games";
2016-04-09 14:16:47 +02:00
extraGroups = [ "audio" "video" "input" "loot" ];
2015-07-16 15:51:01 +02:00
createHome = true;
useDefaultShell = true;
2018-01-30 19:05:10 +01:00
packages = with pkgs; [
2020-03-17 21:39:38 +01:00
# minecraft
2020-09-15 20:38:17 +02:00
# ftb
# steam-run
# scummvm
# dolphinEmu
# doom1
# doom2
# protontricks
# vdoom1
# vdoom2
# vdoomserver
2019-10-14 15:33:40 +02:00
retroarchBare
2018-01-30 19:05:10 +01:00
];
2021-06-05 12:16:40 +02:00
isNormalUser = true;
2015-07-16 15:51:01 +02:00
};
};
2018-05-14 22:04:59 +02:00
hardware.opengl.driSupport32Bit = true;
hardware.pulseaudio.support32Bit = true;
2015-07-16 15:51:01 +02:00
security.sudo.extraConfig = ''
${mainUser.name} ALL=(games) NOPASSWD: ALL
'';
2017-02-22 18:22:06 +01:00
krebs.iptables.tables.filter.INPUT.rules = [
{ predicate = "-p tcp --dport 10666"; target = "ACCEPT"; }
2017-02-23 16:32:46 +01:00
{ predicate = "-p udp --dport 10666"; target = "ACCEPT"; }
2017-02-22 18:22:06 +01:00
];
2015-07-16 15:51:01 +02:00
}