feat: opencloud test

This commit is contained in:
Nick 2025-07-07 13:35:12 -05:00
parent cd118791e5
commit 12e7183973
6 changed files with 103 additions and 7 deletions

View file

@ -0,0 +1,38 @@
{ moduleFunctions }:
let
inherit (moduleFunctions.instancesFunctions)
domain0
servicePath
sslPath
sopsPath
;
label = "OpenCloud";
name = "opencloud";
subdomain = "cloud";
domain = "${subdomain}.${domain0}";
in
{
label = label;
name = name;
email = {
address0 = "noreply@${domain0}";
};
sops = {
path0 = "${sopsPath}/${name}";
};
domains = {
url0 = domain;
};
subdomain = subdomain;
paths = {
path0 = "${servicePath}/${label}";
};
ports = {
port0 = 9200;
};
ssl = {
cert = "${sslPath}/${subdomain}.${domain0}/fullchain.pem";
key = "${sslPath}/${subdomain}.${domain0}/key.pem";
};
}

View file

@ -11,7 +11,7 @@ let
localhost = web.localhost.address0; localhost = web.localhost.address0;
in in
{ {
assistant = { agent = {
enabled = true; enabled = true;
default_model = { default_model = {
provider = "zed.dev"; provider = "zed.dev";

View file

@ -23,7 +23,7 @@ in
{ {
programs.zed-editor = { programs.zed-editor = {
enable = true; enable = true;
package = packagePath; # package = packagePath;
extraPackages = extraPackagesPath; extraPackages = extraPackagesPath;
extensions = extensionsPath; extensions = extensionsPath;
userKeymaps = userKeymapsPath; userKeymaps = userKeymapsPath;

View file

@ -84,11 +84,7 @@ let
"3, movetoworkspacesilent, 3" "3, movetoworkspacesilent, 3"
"4, movetoworkspacesilent, 4" "4, movetoworkspacesilent, 4"
"5, movetoworkspacesilent, 5" "5, movetoworkspacesilent, 5"
# Window Move
"C, movewindow, l"
"A, movewindow, u"
"E, movewindow, d"
"I, movewindow, r"
]; ];
shiftBinds = builtins.map (x: "SHIFT, " + x) [ shiftBinds = builtins.map (x: "SHIFT, " + x) [
@ -108,10 +104,15 @@ let
"3, movetoworkspacesilent, 3" "3, movetoworkspacesilent, 3"
"4, movetoworkspacesilent, 4" "4, movetoworkspacesilent, 4"
"5, movetoworkspacesilent, 5" "5, movetoworkspacesilent, 5"
# Window Move
"Left, movewindow, l" "Left, movewindow, l"
"Up, movewindow, u" "Up, movewindow, u"
"Down, movewindow, d" "Down, movewindow, d"
"Right, movewindow, r" "Right, movewindow, r"
"C, movewindow, l"
"A, movewindow, u"
"E, movewindow, d"
"I, movewindow, r"
]; ];
functionBinds = builtins.map (x: " , " + x) [ functionBinds = builtins.map (x: " , " + x) [

View file

@ -41,6 +41,7 @@ in
"searx" "searx"
"syncthing" "syncthing"
"vaultwarden" "vaultwarden"
"opencloud"
] ]
) )
++ (map ++ (map

View file

@ -0,0 +1,56 @@
{ flake, ... }:
let
inherit (flake.config.machines.devices) ceres;
inherit (flake.config.services.instances) opencloud web;
service = opencloud;
localhost = web.localhost.address1;
host = service.domains.url0;
in
{
services = {
opencloud = {
enable = true;
url = "https://${host}:${service.ports.port0}";
port = service.ports.port0;
address = localhost;
stateDir = "/var/lib/${service.name}";
environment = {
OC_INSECURE = "false";
};
};
caddy = {
virtualHosts = {
"${host}" = {
extraConfig = ''
reverse_proxy ${localhost}:${toString service.ports.port0}
tls ${service.ssl.cert} ${service.ssl.key}
'';
};
};
};
};
fileSystems."/var/lib/${service.name}" = {
device = service.paths.path0;
fsType = "none";
options = [
"bind"
];
depends = [
ceres.storage0.mount
];
};
systemd.tmpfiles.rules = [
"Z ${service.paths.path0} 755 ${service.name} ${service.name} -"
# "Z ${service.sops.path0} 755 ${service.name} ${service.name} -"
];
networking = {
firewall = {
allowedTCPPorts = [
service.ports.port0
];
};
};
}