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" ''
|
2016-12-07 20:38:55 +00:00
|
|
|
${pkgs.zandronum-bin}/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} \
|
2016-12-01 16:10:31 +00:00
|
|
|
-file $DOOM_DIR/lib/brutalv20.pk3 \
|
|
|
|
"$@"
|
|
|
|
'';
|
|
|
|
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/}
|
|
|
|
|
|
|
|
${pkgs.zandronum-bin}/bin/zandronum-server \
|
|
|
|
+exec ${doomservercfg} \
|
|
|
|
"$@"
|
|
|
|
'';
|
|
|
|
|
2015-07-16 13:51:01 +00:00
|
|
|
in {
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
dwarf_fortress
|
2016-12-01 16:10:31 +00:00
|
|
|
doom1
|
|
|
|
doom2
|
2016-12-07 09:14:27 +00:00
|
|
|
vdoom1
|
|
|
|
vdoom2
|
2017-02-22 17:21:30 +00:00
|
|
|
vdoomserver
|
2015-07-16 13:51:01 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
users.extraUsers = {
|
|
|
|
games = {
|
|
|
|
name = "games";
|
|
|
|
description = "user playing games";
|
|
|
|
home = "/home/games";
|
2016-04-09 12:16:47 +00:00
|
|
|
extraGroups = [ "audio" "video" "input" "loot" ];
|
2015-07-16 13:51:01 +00:00
|
|
|
createHome = true;
|
|
|
|
useDefaultShell = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2017-01-02 19:10:05 +00:00
|
|
|
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
|
|
|
}
|