Compare commits

..

No commits in common. "69e69c2b7fd77f5584c393335db9ae7643681a13" and "7844d688ff861b1ea62e35441e9a63ae7b5583a8" have entirely different histories.

5 changed files with 30 additions and 90 deletions

1
.gitignore vendored
View file

@ -2,4 +2,3 @@ data2
data data
result result
.direnv .direnv
arma-reforger-tofu.qcow2

View file

@ -3,7 +3,6 @@
modulesPath, modulesPath,
config, config,
pkgs, pkgs,
lib,
... ...
}: }:
@ -14,15 +13,40 @@ in
{ {
imports = [ imports = [
self.nixosModules.default self.nixosModules.default
# "${modulesPath}/virtualisation/lxc-container.nix" "${modulesPath}/virtualisation/lxc-container.nix"
];
# Create steam user
users = {
users.steam = {
isNormalUser = true;
home = "/var/lib/steam";
createHome = true;
shell = pkgs.bash;
group = "steam";
};
groups.steam = {};
};
systemd.tmpfiles.rules = [
"d /var/lib/steam 0755 steam steam -"
"d /var/lib/steam/reforger/configs/ 0755 steam steam -"
"d /var/lib/steam/reforger/profile/ 0755 steam steam -"
"d /var/lib/steam/reforger/workshop/ 0755 steam steam -"
]; ];
services.arma.enable = true; deploy = {
enable = false;
};
networking = { networking = {
hostName = "arma-reforger-tofu"; hostName = "arma-reforger-tofu";
firewall = {
enable = true;
allowedUDPPorts = [ 2001 17777 19999 ];
};
}; };
# environment.systemPackages = with pkgs; [ environment.systemPackages = [
# ]; pkgs.steamcmd
pkgs.curl
];
system.stateVersion = "25.05"; system.stateVersion = "25.05";
} }

View file

@ -1,64 +0,0 @@
{
lib,
config,
pkgs,
...
}:
let
cfg = config.services.arma;
in
{
options.services.arma = {
enable = lib.mkEnableOption "enable arma";
dataDir = lib.mkOption {
type = lib.types.str;
default = "/var/lib/steam";
};
};
config = lib.mkIf cfg.enable {
nixpkgs.config.allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"steamcmd"
"steam-run"
"steam-unwrapped"
];
# Create steam user
users = {
users.steam = {
isSystemUser = true;
home = cfg.dataDir;
createHome = true;
shell = pkgs.bash;
group = "steam";
};
groups.steam = { };
};
systemd.tmpfiles.rules = [
# "d /var/lib/steam 0755 steam steam -"
"d ${cfg.dataDir}/reforger/configs 0755 steam steam -"
"d ${cfg.dataDir}/reforger/profile 0755 steam steam -"
"d ${cfg.dataDir}/reforger/workshop 0755 steam steam -"
];
systemd.services = {
arma = {
description = "arma game server";
wantedBy = [ "multi-user.target" ];
environment = {
ARMA_DIR = "${cfg.dataDir}";
};
path = with pkgs; [
curl
steamcmd
steam-run
];
preStart = "${pkgs.arma-scripts}/scripts/update.sh";
serviceConfig = {
User = "steam";
WorkingDirectory = "${cfg.dataDir}/reforger";
ExecStart = "${pkgs.arma-scripts}/scripts/start.sh";
};
};
};
};
}

View file

@ -1,11 +0,0 @@
{
lib,
config,
pkgs,
...
}:
{
virtualisation.vmVariant = {
users.users.root.password = "pass";
};
}

View file

@ -1,8 +0,0 @@
{ fetchFromGitea }:
fetchFromGitea {
domain = "git.skdevstudios.com";
owner = "SK-Development-Studios";
repo = "ground-zero-conflict-configuration";
rev = "v0.0.1";
sha256 = "sha256-0CclaDqtZxt385I6lgOydOJwdh4HbtNQyQOhwl7hNcM=";
}