Migrate drasl from docker to nixos module

This commit is contained in:
batteredbunny 2024-04-25 12:48:13 +03:00
parent 890e3aa3b4
commit 376da6cebf
4 changed files with 75 additions and 20 deletions

View file

@ -17,6 +17,7 @@ in {
inputs.common-modules.nixosModules.qbittorrent-nox
inputs.common-modules.nixosModules.unpackerr
inputs.nix-minecraft.nixosModules.minecraft-servers
inputs.drasl.nixosModules.drasl
];
nixpkgs = {
@ -252,6 +253,21 @@ in {
};
services = {
drasl = {
enable = true;
settings = {
Domain = "drasl.snailcore.net";
BaseURL = "https://drasl.snailcore.net";
ListenAddress = "0.0.0.0:${toString settings.ports.drasl}";
DefaultAdmins = ["kaya"];
RegistrationNewPlayer = {
Allow = true;
AllowChoosingUUID = true;
RequireInvite = true;
};
};
};
mastodon = {
enable = true;
localDomain = "fedi.catnip.ee";
@ -341,9 +357,7 @@ in {
enable = true;
eula = true;
servers = let
drasl = "https://drasl.snailcore.net";
in {
servers = {
paper-vanilla = {
enable = true;
@ -351,7 +365,7 @@ in {
package = pkgs.paper-server;
openFirewall = true;
autoStart = true;
jvmOpts = "-Xmx2G -Xms1G -Dminecraft.api.env=custom -Dminecraft.api.auth.host=${drasl}/auth -Dminecraft.api.account.host=${drasl}/account -Dminecraft.api.session.host=${drasl}/session -Dminecraft.api.services.host=${drasl}/services";
jvmOpts = "-Xmx2G -Xms1G -Dminecraft.api.env=custom -Dminecraft.api.auth.host=${config.services.drasl.settings.BaseURL}/auth -Dminecraft.api.account.host=${config.services.drasl.settings.BaseURL}/account -Dminecraft.api.session.host=${config.services.drasl.settings.BaseURL}/session -Dminecraft.api.services.host=${config.services.drasl.settings.BaseURL}/services";
serverProperties = {
motd = "catnip enthutiasts";
spawn-protection = 0;

View file

@ -29,17 +29,6 @@ in {
"--network=host"
];
};
drasl = {
autoStart = true;
image = "docker.io/unmojang/drasl";
ports = [
"${toString settings.ports.drasl}:25585"
];
volumes = [
"${settings.server_configs_home}/drasl/config:/etc/drasl"
"${settings.server_configs_home}/drasl/data:/var/lib/drasl"
];
};
firefish = {
autoStart = true;
image = "registry.firefish.dev/firefish/firefish:latest";

61
flake.lock generated
View file

@ -34,6 +34,25 @@
"url": "https://forge.catnip.ee/batteredbunny/common.nix"
}
},
"drasl": {
"inputs": {
"nixpkgs": "nixpkgs_2",
"npmlock2nix": "npmlock2nix"
},
"locked": {
"lastModified": 1713844532,
"narHash": "sha256-uTU0ShDJV4sy/7J1JNbNm0wLm8v6YaQDgD4iAsBbyqc=",
"owner": "unmojang",
"repo": "drasl",
"rev": "87a0749860a37d6dfefdfa5ac7e44da7c4cbe99c",
"type": "github"
},
"original": {
"owner": "unmojang",
"repo": "drasl",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
@ -89,7 +108,7 @@
"lastfm-status": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1712134258,
@ -109,7 +128,7 @@
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_3"
"nixpkgs": "nixpkgs_4"
},
"locked": {
"lastModified": 1714008021,
@ -142,6 +161,21 @@
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1688392541,
"narHash": "sha256-lHrKvEkCPTUO+7tPfjIcb7Trk6k31rz18vkyqmkeJfY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-22.11",
"type": "indirect"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1711703276,
"narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=",
@ -157,7 +191,7 @@
"type": "github"
}
},
"nixpkgs_3": {
"nixpkgs_4": {
"locked": {
"lastModified": 1698318101,
"narHash": "sha256-gUihHt3yPD7bVqg+k/UVHgngyaJ3DMEBchbymBMvK1E=",
@ -173,7 +207,7 @@
"type": "github"
}
},
"nixpkgs_4": {
"nixpkgs_5": {
"locked": {
"lastModified": 1713895582,
"narHash": "sha256-cfh1hi+6muQMbi9acOlju3V1gl8BEaZBXBR9jQfQi4U=",
@ -189,13 +223,30 @@
"type": "github"
}
},
"npmlock2nix": {
"flake": false,
"locked": {
"lastModified": 1673447413,
"narHash": "sha256-sJM82Sj8yfQYs9axEmGZ9Evzdv/kDcI9sddqJ45frrU=",
"owner": "nix-community",
"repo": "npmlock2nix",
"rev": "9197bbf397d76059a76310523d45df10d2e4ca81",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "npmlock2nix",
"type": "github"
}
},
"root": {
"inputs": {
"catnip-website": "catnip-website",
"common-modules": "common-modules",
"drasl": "drasl",
"lastfm-status": "lastfm-status",
"nix-minecraft": "nix-minecraft",
"nixpkgs": "nixpkgs_4"
"nixpkgs": "nixpkgs_5"
}
},
"systems": {

View file

@ -9,6 +9,7 @@
};
common-modules.url = "git+https://forge.catnip.ee/batteredbunny/common.nix";
drasl.url = "github:unmojang/drasl";
};
outputs = {