fix(librechat): mkdir if the path option doesnt exist
This commit is contained in:
parent
2825ea7df5
commit
4a98b09875
3 changed files with 28 additions and 16 deletions
|
@ -25,6 +25,10 @@ in
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "librechat";
|
default = "librechat";
|
||||||
};
|
};
|
||||||
|
group = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "librechat";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
@ -35,6 +39,12 @@ in
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "simple"; # FIXME
|
Type = "simple"; # FIXME
|
||||||
User = cfg.user;
|
User = cfg.user;
|
||||||
|
Group = cfg.group;
|
||||||
|
PermissionsStartOnly = "true"; # run mkdir as root
|
||||||
|
ExecStartPre = [
|
||||||
|
"${pkgs.coreutils}/bin/mkdir -p ${cfg.path}"
|
||||||
|
"${pkgs.coreutils}/bin/chown -R ${cfg.user}:${cfg.group} ${cfg.path}"
|
||||||
|
];
|
||||||
LoadCredential = [
|
LoadCredential = [
|
||||||
"CREDS_KEY_FILE:${cfg.creds_key_file}"
|
"CREDS_KEY_FILE:${cfg.creds_key_file}"
|
||||||
"CREDS_IV_FILE:${cfg.creds_iv_file}"
|
"CREDS_IV_FILE:${cfg.creds_iv_file}"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
config,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
@ -24,7 +25,24 @@
|
||||||
enableDDNS = true;
|
enableDDNS = true;
|
||||||
mountHelios = true;
|
mountHelios = true;
|
||||||
databases.mongodb.enable = true;
|
databases.mongodb.enable = true;
|
||||||
|
librechat = {
|
||||||
|
enable = true;
|
||||||
|
mongodbURI = "mongodb://apollo:27017";
|
||||||
|
creds_key_file = config.sops.secrets."librechat/creds_key".path;
|
||||||
|
creds_iv_file = config.sops.secrets."librechat/creds_iv".path;
|
||||||
|
jwt_secret_file = config.sops.secrets."librechat/jwt_secret".path;
|
||||||
|
jwt_refresh_secret_file = config.sops.secrets."librechat/jwt_refresh_secret".path;
|
||||||
|
meili_master_key_file = config.sops.secrets."librechat/meili_master_key".path;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
environment.persistence."/persist".directories = [
|
||||||
|
{
|
||||||
|
directory = config.server.librechat.path;
|
||||||
|
user = config.server.librechat.user;
|
||||||
|
group = config.server.librechat.group;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,23 +49,7 @@
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
librechat = {
|
|
||||||
enable = true;
|
|
||||||
mongodbURI = "mongodb://apollo:27017";
|
|
||||||
creds_key_file = config.sops.secrets."librechat/creds_key".path;
|
|
||||||
creds_iv_file = config.sops.secrets."librechat/creds_iv".path;
|
|
||||||
jwt_secret_file = config.sops.secrets."librechat/jwt_secret".path;
|
|
||||||
jwt_refresh_secret_file = config.sops.secrets."librechat/jwt_refresh_secret".path;
|
|
||||||
meili_master_key_file = config.sops.secrets."librechat/meili_master_key".path;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.persistence."/persist".directories = [
|
|
||||||
{
|
|
||||||
directory = config.server.librechat.path;
|
|
||||||
user = config.server.librechat.user;
|
|
||||||
group = "librechat";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue