add upload and delete options to public instance

This commit is contained in:
Nathan Anderson 2025-10-26 22:23:05 -06:00
parent 2b02c2c06c
commit bd2afc873c
4 changed files with 18 additions and 1 deletions

View File

@ -53,6 +53,7 @@
jq
python310
unstable.claude-code
unstable.opencode
### LSP's
nil
nodePackages_latest.bash-language-server

View File

@ -42,7 +42,7 @@ let
ORIENTATION="normal"
# Simple orientation detection based on which axis has highest absolute value
if [ "$ABS_Z" -gt 9000 ]; then
if [ "$ABS_Z" -gt 16000 ]; then
# Device is flat
if [ "$Z" -lt 0 ]; then
ORIENTATION="normal"

View File

@ -87,6 +87,18 @@ in
description = "Users with read-write access";
};
allowUpload = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Allow file uploads";
};
allowDelete = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Allow file deletion";
};
allowSearch = lib.mkOption {
type = lib.types.bool;
default = true;
@ -184,6 +196,8 @@ in
--bind ${cfg.publicInstance.bind} \
--port ${toString cfg.publicInstance.port} \
${authArgs} \
${lib.optionalString cfg.pblicInstance.allowUpload "--allow-upload"} \
${lib.optionalString cfg.pblicInstance.allowDelete "--allow-delete"} \
${lib.optionalString cfg.publicInstance.allowSearch "--allow-search"}
'';
Restart = "on-failure";

View File

@ -186,6 +186,8 @@ in
publicInstance = {
enable = true;
port = 5000;
allowUpload = true;
allowDelete = false;
allowSearch = true;
# Admin users can upload/modify on public instance
users = [