Compare commits
3 Commits
ef8ba6aca3
...
65760006ba
| Author | SHA1 | Date | |
|---|---|---|---|
|
65760006ba
|
|||
|
13bd5e300d
|
|||
|
0b2d28d617
|
@@ -30,6 +30,8 @@
|
||||
./services/soulseek.nix
|
||||
|
||||
# ./services/llama-cpp.nix
|
||||
|
||||
./services/ups.nix
|
||||
];
|
||||
|
||||
systemd.targets = {
|
||||
|
||||
36
flake.lock
generated
36
flake.lock
generated
@@ -44,11 +44,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1754971456,
|
||||
"narHash": "sha256-p04ZnIBGzerSyiY2dNGmookCldhldWAu03y0s3P8CB0=",
|
||||
"lastModified": 1755519972,
|
||||
"narHash": "sha256-bU4nqi3IpsUZJeyS8Jk85ytlX61i4b0KCxXX9YcOgVc=",
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"rev": "8246829f2e675a46919718f9a64b71afe3bfb22d",
|
||||
"rev": "4073ff2f481f9ef3501678ff479ed81402caae6d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -238,11 +238,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1755280252,
|
||||
"narHash": "sha256-0mONJiAOxdLNeBjDlMKMjk0NtrF8oEtVdw+QlDWrRq8=",
|
||||
"lastModified": 1755514248,
|
||||
"narHash": "sha256-uPg3P8pRR1B3/b/ddDvdSOTRm4zUBKU0XhwVFO6K2XM=",
|
||||
"owner": "ggml-org",
|
||||
"repo": "llama.cpp",
|
||||
"rev": "5e6229a8409ac786e62cb133d09f1679a9aec13e",
|
||||
"rev": "618575c5825d7d4f170e686e772178d2aae148ae",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -260,11 +260,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1755309798,
|
||||
"narHash": "sha256-eE0NI54C8Agj7xVpO+lwJG74u6dzID8HWxCP2sA5U/Y=",
|
||||
"lastModified": 1755483699,
|
||||
"narHash": "sha256-dj5cNx+WvDv5fbsE4h/Q6UuTttc/BHBE3BVGVn2TUNk=",
|
||||
"owner": "Infinidoge",
|
||||
"repo": "nix-minecraft",
|
||||
"rev": "cedd99dd11cb48b4fdf40d69fbcba42acab1b629",
|
||||
"rev": "aa5ed59e2570c7adfd6f5ca6ec08fff3140d7565",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -275,11 +275,11 @@
|
||||
},
|
||||
"nixos-hardware": {
|
||||
"locked": {
|
||||
"lastModified": 1754564048,
|
||||
"narHash": "sha256-dz303vGuzWjzOPOaYkS9xSW+B93PSAJxvBd6CambXVA=",
|
||||
"lastModified": 1755330281,
|
||||
"narHash": "sha256-aJHFJWP9AuI8jUGzI77LYcSlkA9wJnOIg4ZqftwNGXA=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixos-hardware",
|
||||
"rev": "26ed7a0d4b8741fe1ef1ee6fa64453ca056ce113",
|
||||
"rev": "3dac8a872557e0ca8c083cdcfc2f218d18e113b0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -291,11 +291,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1755274400,
|
||||
"narHash": "sha256-rTInmnp/xYrfcMZyFMH3kc8oko5zYfxsowaLv1LVobY=",
|
||||
"lastModified": 1755471983,
|
||||
"narHash": "sha256-axUoWcm4cNQ36jOlnkD9D40LTfSQgk8ExfHSRm3rTtg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "ad7196ae55c295f53a7d1ec39e4a06d922f3b899",
|
||||
"rev": "48f4c982de68d966421d2b6f1ddbeb6227cc5ceb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -385,11 +385,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1755133551,
|
||||
"narHash": "sha256-WMwREoEq9pBSwoCmv7SNOb3eHNfO8QYc3z7wyprjGHQ=",
|
||||
"lastModified": 1755479226,
|
||||
"narHash": "sha256-G7AVmVJhqMraf1iqMoyQ/aWuYvcFFFrMMkrMjWwVyHY=",
|
||||
"owner": "nix-community",
|
||||
"repo": "srvos",
|
||||
"rev": "278214ace1f3b099badb7e78e13384f3e0892d9d",
|
||||
"rev": "b2eeb75153c3e2c7c82991a5c335de3b6c151f51",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
22
services/ups.nix
Normal file
22
services/ups.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services.apcupsd = {
|
||||
enable = true;
|
||||
configText = ''
|
||||
UPSTYPE usb
|
||||
NISIP 127.0.0.1
|
||||
BATTERYLEVEL 5 # shutdown after reaching 5% battery
|
||||
MINUTES 5 # shutdown if estimated runtime on battery reaches 5 minutes
|
||||
'';
|
||||
|
||||
hooks = {
|
||||
# command to run when shutdown condition is met
|
||||
doshutdown = "systemctl poweroff";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -93,27 +93,7 @@ testPkgs.testers.runNixOSTest {
|
||||
# Verify the service hasn't crashed after startup
|
||||
machine.succeed("systemctl is-active minecraft-server-main.service")
|
||||
|
||||
# Check that the minecraft process is running
|
||||
machine.succeed("pgrep -f minecraft")
|
||||
|
||||
# Verify the server port is listening
|
||||
machine.wait_for_open_port(25565)
|
||||
|
||||
# Check that minecraft data directory was created
|
||||
machine.succeed("test -d /var/lib/minecraft/main")
|
||||
|
||||
# Verify server.properties was created
|
||||
machine.succeed("test -f /var/lib/minecraft/main/server.properties")
|
||||
|
||||
# Check that mods directory exists and contains the expected mods
|
||||
machine.succeed("test -d /var/lib/minecraft/main/mods")
|
||||
machine.succeed("ls /var/lib/minecraft/main/mods | grep -q fabric-api")
|
||||
machine.succeed("ls /var/lib/minecraft/main/mods | grep -q ferritecore")
|
||||
machine.succeed("ls /var/lib/minecraft/main/mods | grep -q lithium")
|
||||
|
||||
# Check that there are no critical errors in the logs
|
||||
machine.succeed("! journalctl -u minecraft-server-main.service --no-pager | grep -i 'error\\|exception\\|failed'")
|
||||
|
||||
print("Minecraft server with specific mods started successfully!")
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user