fix(nixos): run Valheim with storage group

This commit is contained in:
2026-09-09 21:32:16 -04:00
parent 0a9f6f9920
commit 88f082f1c0
2 changed files with 6 additions and 13 deletions

View File

@@ -7,15 +7,6 @@
# pikachu — AZW ME Pro server. # pikachu — AZW ME Pro server.
# Disk layout is in ./disk.nix. # Disk layout is in ./disk.nix.
# `fileSystems` for the root disk are derived from it. # `fileSystems` for the root disk are derived from it.
let
valheimSteamRun = pkgs.steam-run.override {
extraBwrapArgs = [
"--bind"
"/pikachu"
"/pikachu"
];
};
in
{ {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
@@ -83,8 +74,9 @@ in
appId = 896660; appId = 896660;
installDir = "/pikachu/data/servers/valheim/main"; installDir = "/pikachu/data/servers/valheim/main";
workingDirectory = "/pikachu/data/servers/valheim/main"; workingDirectory = "/pikachu/data/servers/valheim/main";
group = "storage";
dataDirs = [ "/pikachu/media/games/servers/valheim/main" ]; dataDirs = [ "/pikachu/media/games/servers/valheim/main" ];
packages = [ valheimSteamRun ]; packages = [ pkgs.steam-run ];
environment = { environment = {
SteamAppId = "892970"; SteamAppId = "892970";
SERVER_PASSWORD = "foobarbaz"; SERVER_PASSWORD = "foobarbaz";

View File

@@ -245,9 +245,10 @@ in
] ]
++ lib.flatten ( ++ lib.flatten (
lib.mapAttrsToList (_: app: [ lib.mapAttrsToList (_: app: [
"d ${app.installDir} 0770 ${cfg.user} ${cfg.group} - -" "d ${app.installDir} 0770 ${app.user} ${app.group} - -"
"z ${app.installDir} 0770 ${cfg.user} ${cfg.group} - -" "z ${app.installDir} 0770 ${app.user} ${app.group} - -"
]) enabledApps ] ++ map (dataDir: "d ${dataDir} 0770 ${app.user} ${app.group} - -") app.dataDirs
++ map (dataDir: "z ${dataDir} 0770 ${app.user} ${app.group} - -") app.dataDirs) enabledApps
); );
systemd.services = lib.mkMerge ( systemd.services = lib.mkMerge (