added factorio
This commit is contained in:
parent
37b08d943b
commit
70ebb4de20
8 changed files with 138 additions and 19 deletions
31
modules/game/server/factorio.nix
Normal file
31
modules/game/server/factorio.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{pkgs, ...}: {
|
||||
# Also enable non-free packages or else the factorio download will fail:
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
factorio-headless
|
||||
];
|
||||
|
||||
services.factorio = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
#mods =
|
||||
# let
|
||||
# inherit (pkgs) lib;
|
||||
# modDir = /opt/factorio-mods;
|
||||
# modList = lib.pipe modDir [
|
||||
# builtins.readDir
|
||||
# (lib.filterAttrs (k: v: v == "regular"))
|
||||
# (lib.mapAttrsToList (k: v: k))
|
||||
# (builtins.filter (lib.hasSuffix ".zip"))
|
||||
# ];
|
||||
# modToDrv = modFileName:
|
||||
# pkgs.runCommand "copy-factorio-mods" {} ''
|
||||
# mkdir $out
|
||||
# cp ${modDir + "/${modFileName}"} $out/${modFileName}
|
||||
# ''
|
||||
# // { deps = []; };
|
||||
# in
|
||||
# builtins.map modToDrv modList;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue