Allow writing to cdn path

This commit is contained in:
Rory&
2025-12-27 12:53:15 +01:00
parent 016d3b9d88
commit 0709744e1f
2 changed files with 24 additions and 6 deletions
+18 -2
View File
@@ -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";
+6 -4
View File
@@ -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 = {