nextcloud: this is goood enough for now, will have to move server shortly
This commit is contained in:
parent
0472019016
commit
9fd4613936
4 changed files with 128 additions and 0 deletions
97
applications/nextcloud.nix
Normal file
97
applications/nextcloud.nix
Normal file
|
@ -0,0 +1,97 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.services.skynet_nextcloud;
|
||||
domain = "${cfg.domain.sub}.${cfg.domain.base}.${cfg.domain.tld}";
|
||||
in {
|
||||
imports = [
|
||||
./acme.nix
|
||||
./dns.nix
|
||||
./nginx.nix
|
||||
];
|
||||
|
||||
options.services.skynet_nextcloud = {
|
||||
enable = mkEnableOption "Skynet Nextcloud";
|
||||
|
||||
host = {
|
||||
ip = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
};
|
||||
|
||||
domain = {
|
||||
tld = mkOption {
|
||||
type = types.str;
|
||||
default = "ie";
|
||||
};
|
||||
|
||||
base = mkOption {
|
||||
type = types.str;
|
||||
default = "skynet";
|
||||
};
|
||||
|
||||
sub = mkOption {
|
||||
type = types.str;
|
||||
default = "nextcloud";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# shove the entire config file into secrets
|
||||
|
||||
age.secrets.nextcloud_admin_pass = {
|
||||
file = ../secrets/nextcloud/pw.age;
|
||||
owner = "nextcloud";
|
||||
group = "nextcloud";
|
||||
};
|
||||
|
||||
skynet_acme.domains = [
|
||||
domain
|
||||
];
|
||||
|
||||
skynet_dns.records = [
|
||||
{
|
||||
record = cfg.domain.sub;
|
||||
r_type = "CNAME";
|
||||
value = cfg.host.name;
|
||||
}
|
||||
];
|
||||
|
||||
# /var/lib/nextcloud/data
|
||||
|
||||
services.nextcloud = {
|
||||
enable = true;
|
||||
package = pkgs.nextcloud27;
|
||||
hostName = domain;
|
||||
https = true;
|
||||
|
||||
config = {
|
||||
trustedProxies = ["193.1.99.65"];
|
||||
adminpassFile = config.age.secrets.nextcloud_admin_pass.path;
|
||||
};
|
||||
|
||||
extraApps = with config.services.nextcloud.package.packages.apps; {
|
||||
inherit files_markdown files_texteditor forms groupfolders mail maps news notes onlyoffice polls;
|
||||
};
|
||||
|
||||
extraOptions = {
|
||||
mail_smtpmode = "sendmail";
|
||||
mail_sendmailmode = "pipe";
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts.${domain} = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "skynet";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue