mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-08-08 12:54:38 -05:00
feat: opencloud test
This commit is contained in:
parent
cd118791e5
commit
12e7183973
6 changed files with 103 additions and 7 deletions
38
modules/config/instances/config/opencloud.nix
Normal file
38
modules/config/instances/config/opencloud.nix
Normal 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";
|
||||
};
|
||||
}
|
|
@ -11,7 +11,7 @@ let
|
|||
localhost = web.localhost.address0;
|
||||
in
|
||||
{
|
||||
assistant = {
|
||||
agent = {
|
||||
enabled = true;
|
||||
default_model = {
|
||||
provider = "zed.dev";
|
||||
|
|
|
@ -23,7 +23,7 @@ in
|
|||
{
|
||||
programs.zed-editor = {
|
||||
enable = true;
|
||||
package = packagePath;
|
||||
# package = packagePath;
|
||||
extraPackages = extraPackagesPath;
|
||||
extensions = extensionsPath;
|
||||
userKeymaps = userKeymapsPath;
|
||||
|
|
|
@ -84,11 +84,7 @@ let
|
|||
"3, movetoworkspacesilent, 3"
|
||||
"4, movetoworkspacesilent, 4"
|
||||
"5, movetoworkspacesilent, 5"
|
||||
# Window Move
|
||||
"C, movewindow, l"
|
||||
"A, movewindow, u"
|
||||
"E, movewindow, d"
|
||||
"I, movewindow, r"
|
||||
|
||||
];
|
||||
|
||||
shiftBinds = builtins.map (x: "SHIFT, " + x) [
|
||||
|
@ -108,10 +104,15 @@ let
|
|||
"3, movetoworkspacesilent, 3"
|
||||
"4, movetoworkspacesilent, 4"
|
||||
"5, movetoworkspacesilent, 5"
|
||||
# Window Move
|
||||
"Left, movewindow, l"
|
||||
"Up, movewindow, u"
|
||||
"Down, movewindow, d"
|
||||
"Right, movewindow, r"
|
||||
"C, movewindow, l"
|
||||
"A, movewindow, u"
|
||||
"E, movewindow, d"
|
||||
"I, movewindow, r"
|
||||
];
|
||||
|
||||
functionBinds = builtins.map (x: " , " + x) [
|
||||
|
|
|
@ -41,6 +41,7 @@ in
|
|||
"searx"
|
||||
"syncthing"
|
||||
"vaultwarden"
|
||||
"opencloud"
|
||||
]
|
||||
)
|
||||
++ (map
|
||||
|
|
56
modules/nixos/services/opencloud/default.nix
Normal file
56
modules/nixos/services/opencloud/default.nix
Normal 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
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue