refactor: rename modules to nixosModules
This commit is contained in:
parent
2eb4dc3730
commit
7062c95697
24 changed files with 21 additions and 8 deletions
84
nixosModules/nextcloud.nix
Normal file
84
nixosModules/nextcloud.nix
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
fqdn = "cloud.rpqt.fr";
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./acme-home.nix
|
||||
];
|
||||
|
||||
services.nextcloud = {
|
||||
enable = true;
|
||||
hostName = fqdn;
|
||||
https = true;
|
||||
package = pkgs.nextcloud32;
|
||||
config = {
|
||||
dbtype = "pgsql";
|
||||
dbuser = "nextcloud";
|
||||
dbhost = "/run/postgresql";
|
||||
dbname = "nextcloud";
|
||||
# admin user is only for the initial setup
|
||||
adminuser = "root";
|
||||
adminpassFile = config.clan.core.vars.generators.nextcloud.files.admin-password.path;
|
||||
objectstore.s3 = {
|
||||
enable = true;
|
||||
bucket = "nextcloud";
|
||||
key = config.clan.core.vars.generators.nextcloud-s3-storage.files.access-key-id.value;
|
||||
secretFile = config.clan.core.vars.generators.nextcloud-s3-storage.files.access-key-secret.path;
|
||||
hostname = "[${config.clan.core.vars.generators.zerotier.files.zerotier-ip.value}]";
|
||||
port = 3900;
|
||||
useSsl = false;
|
||||
region = "garage";
|
||||
usePathStyle = true;
|
||||
};
|
||||
};
|
||||
extraAppsEnable = true;
|
||||
extraApps = {
|
||||
inherit (config.services.nextcloud.package.packages.apps) tasks contacts calendar;
|
||||
};
|
||||
};
|
||||
|
||||
clan.core.postgresql = {
|
||||
enable = true;
|
||||
databases = {
|
||||
nextcloud = {
|
||||
create.enable = true;
|
||||
restore.stopOnRestore = [ "nextcloud" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services."nextcloud-setup" = {
|
||||
requires = [ "postgresql.service" ];
|
||||
after = [ "postgresql.service" ];
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts.${config.services.nextcloud.hostName} = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
};
|
||||
|
||||
clan.core.vars.generators.nextcloud = {
|
||||
prompts.admin-password = {
|
||||
description = "nextcloud admin password";
|
||||
type = "hidden";
|
||||
persist = true;
|
||||
};
|
||||
files.admin-password.owner = "nextcloud";
|
||||
};
|
||||
|
||||
clan.core.vars.generators.nextcloud-s3-storage = {
|
||||
prompts.access-key-id = {
|
||||
description = "s3 access key id";
|
||||
type = "line";
|
||||
persist = true;
|
||||
};
|
||||
prompts.access-key-secret = {
|
||||
description = "s3 access key secret";
|
||||
type = "hidden";
|
||||
persist = true;
|
||||
};
|
||||
files.access-key-id.secret = false;
|
||||
files.access-key-secret.owner = "nextcloud";
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue