Compare commits
3 commits
9060cb6414
...
2f46180092
Author | SHA1 | Date | |
---|---|---|---|
Tristan Daniël Maat | 2f46180092 | ||
Tristan Daniël Maat | 6ef385a581 | ||
Tristan Daniël Maat | bd7e4a3193 |
|
@ -4,6 +4,12 @@
|
||||||
ids.uids = {
|
ids.uids = {
|
||||||
# System user ids start at 400 (see nixos/modules/programs/shadow.nix)
|
# System user ids start at 400 (see nixos/modules/programs/shadow.nix)
|
||||||
webserver = 400;
|
webserver = 400;
|
||||||
|
minecraft = 401;
|
||||||
# The limit is 999
|
# The limit is 999
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ids.gids = {
|
||||||
|
webserver = 400;
|
||||||
|
minecraft = 401;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ http {
|
||||||
#gzip on;
|
#gzip on;
|
||||||
|
|
||||||
upstream php-handler {
|
upstream php-handler {
|
||||||
server nextcloud-nextcloud:9000;
|
server localhost:9000;
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
|
|
|
@ -54,6 +54,16 @@ in {
|
||||||
nixpkgs.config.allowUnfreePredicate = pkg:
|
nixpkgs.config.allowUnfreePredicate = pkg:
|
||||||
builtins.elem (lib.getName pkg) [ "forge-server" ];
|
builtins.elem (lib.getName pkg) [ "forge-server" ];
|
||||||
|
|
||||||
|
users = {
|
||||||
|
extraUsers.minecraft = {
|
||||||
|
uid = config.ids.uids.minecraft;
|
||||||
|
group = config.users.extraGroups.minecraft.name;
|
||||||
|
isSystemUser = true;
|
||||||
|
description = "Minecraft server user";
|
||||||
|
};
|
||||||
|
extraGroups.minecraft = { gid = config.ids.gids.minecraft; };
|
||||||
|
};
|
||||||
|
|
||||||
virtualisation.oci-containers.containers.minecraft-voor-kia = let
|
virtualisation.oci-containers.containers.minecraft-voor-kia = let
|
||||||
properties = ./configs/minecraft/voor-kia/server.properties;
|
properties = ./configs/minecraft/voor-kia/server.properties;
|
||||||
icon = ./configs/minecraft/voor-kia/server-icon.png;
|
icon = ./configs/minecraft/voor-kia/server-icon.png;
|
||||||
|
@ -73,9 +83,8 @@ in {
|
||||||
];
|
];
|
||||||
|
|
||||||
config = let
|
config = let
|
||||||
# Use the upstream minecraft uid
|
uid = toString config.users.extraUsers.minecraft.uid;
|
||||||
uid = toString config.ids.uids.minecraft;
|
gid = toString config.users.extraGroups.minecraft.gid;
|
||||||
gid = toString config.users.groups.nogroup.gid;
|
|
||||||
in {
|
in {
|
||||||
Cmd = [ "forge-server" ] ++ minecraft-server-args;
|
Cmd = [ "forge-server" ] ++ minecraft-server-args;
|
||||||
WorkingDir = "/var/lib/minecraft";
|
WorkingDir = "/var/lib/minecraft";
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
users.extraUsers.webserver = {
|
users = {
|
||||||
|
extraUsers.webserver = {
|
||||||
uid = config.ids.uids.webserver;
|
uid = config.ids.uids.webserver;
|
||||||
|
group = config.users.extraGroups.webserver.name;
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
description = "tlater.net web server user";
|
description = "tlater.net web server user";
|
||||||
};
|
};
|
||||||
|
extraGroups.webserver = { gid = config.ids.gids.webserver; };
|
||||||
|
};
|
||||||
|
|
||||||
virtualisation.oci-containers.containers.webserver = {
|
virtualisation.oci-containers.containers.webserver = {
|
||||||
image = "tlaternet/webserver";
|
image = "tlaternet/webserver";
|
||||||
|
@ -16,10 +20,8 @@
|
||||||
contents = pkgs.tlaternet-webserver.webserver;
|
contents = pkgs.tlaternet-webserver.webserver;
|
||||||
|
|
||||||
config = let
|
config = let
|
||||||
user = config.users.extraUsers.webserver;
|
uid = toString config.users.extraUsers.webserver.uid;
|
||||||
group = config.users.groups.${user.group};
|
gid = toString config.users.extraGroups.webserver.gid;
|
||||||
uid = toString user.uid;
|
|
||||||
gid = toString group.gid;
|
|
||||||
in {
|
in {
|
||||||
Cmd = [ "tlaternet-webserver" ];
|
Cmd = [ "tlaternet-webserver" ];
|
||||||
Volumes = { "/srv/mail" = { }; };
|
Volumes = { "/srv/mail" = { }; };
|
||||||
|
|
|
@ -9,7 +9,7 @@ let
|
||||||
url = "${mirror}/${version}/forge-${version}-installer.jar";
|
url = "${mirror}/${version}/forge-${version}-installer.jar";
|
||||||
curlOpts = "--globoff";
|
curlOpts = "--globoff";
|
||||||
# Forge doesn't seem to like newer shas
|
# Forge doesn't seem to like newer shas
|
||||||
sha1 = "e97821e5431bdcaa46e12048769922e2cdb5e2e1";
|
sha1 = "sha1-oHNpyrgHluRrAXWZJg9j+OInAwA=";
|
||||||
};
|
};
|
||||||
|
|
||||||
unpackCmd = "mkdir -p src; cp $curSrc src/forge-${version}-installer.jar";
|
unpackCmd = "mkdir -p src; cp $curSrc src/forge-${version}-installer.jar";
|
||||||
|
|
Loading…
Reference in a new issue