feat(copyparty): add read-only root volume

This commit is contained in:
2026-09-14 22:50:45 -04:00
parent 6159d87d10
commit a73b59aa0a
4 changed files with 24 additions and 2 deletions

View File

@@ -23,6 +23,12 @@ let
description = "Copyparty access map from permission string to account names.";
};
readOnly = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Serve this volume read-only.";
};
flags = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
@@ -196,7 +202,7 @@ in
PrivateTmp = true;
ProtectSystem = "strict";
ProtectHome = true;
ReadWritePaths = [ cfg.stateDir ] ++ map (volume: volume.path) (lib.attrValues cfg.volumes);
ReadWritePaths = [ cfg.stateDir ] ++ map (volume: volume.path) (lib.filter (volume: !volume.readOnly) (lib.attrValues cfg.volumes));
};
};