summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-12-27 12:53:15 +0100
committerRory& <root@rory.gay>2025-12-27 12:53:15 +0100
commit0709744e1ff2521619056afe8b142b2dc8a3a9d4 (patch)
tree8e3a0bcfb94890d932163b46d5427f8a39fa90ac
parentbleh (diff)
downloadserver-ts-0709744e1ff2521619056afe8b142b2dc8a3a9d4.tar.xz
Allow writing to cdn path
-rw-r--r--default.nix20
-rw-r--r--nix/modules/default/default.nix10
2 files changed, 24 insertions, 6 deletions
diff --git a/default.nix b/default.nix

index 6a49ee6e..df4a7df6 100644 --- a/default.nix +++ b/default.nix
@@ -6,6 +6,22 @@ ... }: +let + filteredSrc = lib.fileset.toSource { + root = ./.; + fileset = ( + lib.fileset.intersection ./. ( + lib.fileset.unions [ + ./src + ./package.json + ./tsconfig.json + ./package-lock.json + ./assets + ] + ) + ); + }; +in pkgs.buildNpmPackage { pname = "spacebar-server-ts"; nodejs = pkgs.nodejs_24; @@ -20,8 +36,8 @@ pkgs.buildNpmPackage { maintainers = with maintainers; [ RorySys ]; # lol. }; - src = ./.; - npmDeps = pkgs.importNpmLock { npmRoot = ./.; }; + src = filteredSrc; + npmDeps = pkgs.importNpmLock { npmRoot = filteredSrc; }; npmConfigHook = pkgs.importNpmLock.npmConfigHook; npmBuildScript = "build:src"; diff --git a/nix/modules/default/default.nix b/nix/modules/default/default.nix
index 4d3e425d..6d13458d 100644 --- a/nix/modules/default/default.nix +++ b/nix/modules/default/default.nix
@@ -253,6 +253,8 @@ in StateDirectoryMode = "0750"; RuntimeDirectory = "spacebar"; RuntimeDirectoryMode = "0750"; + ReadWritePaths = [ cfg.cdnPath ]; + NoExecPaths = [ cfg.cdnPath ]; Restart = "on-failure"; RestartSec = 10; @@ -267,10 +269,10 @@ in in { assertions = [ -# { -# assertion = lib.all (map (key: !(key == "CONFIG_PATH" || key == "CONFIG_READONLY" || key == "PORT" || key == "STORAGE_LOCATION")) (lib.attrNames cfg.extraEnvironment)); -# message = "You cannot set CONFIG_PATH, CONFIG_READONLY, PORT or STORAGE_LOCATION in extraEnvironment, these are managed by the NixOS module."; -# } + # { + # assertion = lib.all (map (key: !(key == "CONFIG_PATH" || key == "CONFIG_READONLY" || key == "PORT" || key == "STORAGE_LOCATION")) (lib.attrNames cfg.extraEnvironment)); + # message = "You cannot set CONFIG_PATH, CONFIG_READONLY, PORT or STORAGE_LOCATION in extraEnvironment, these are managed by the NixOS module."; + # } ]; users.users.spacebarchat = {