migrate arma configs to module
Some checks failed
/ check (push) Failing after 6s
/ deploy (push) Has been skipped

This commit is contained in:
Jermeiah S 2025-07-01 13:53:12 -04:00
parent 83e62adf85
commit 69e69c2b7f
No known key found for this signature in database
3 changed files with 78 additions and 30 deletions

View file

@ -3,6 +3,7 @@
modulesPath, modulesPath,
config, config,
pkgs, pkgs,
lib,
... ...
}: }:
@ -13,40 +14,15 @@ 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 -"
]; ];
deploy = { services.arma.enable = true;
enable = false;
};
networking = { networking = {
hostName = "arma-reforger-tofu"; hostName = "arma-reforger-tofu";
firewall = {
enable = true;
allowedUDPPorts = [ 2001 17777 19999 ];
};
}; };
environment.systemPackages = [ # environment.systemPackages = with pkgs; [
pkgs.steamcmd # ];
pkgs.curl
];
system.stateVersion = "25.05"; system.stateVersion = "25.05";
} }

View file

@ -0,0 +1,64 @@
{
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

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