nextcloud draft

This commit is contained in:
Jonas Röger 2025-04-03 13:01:46 +02:00
parent e699b6cc42
commit a63014d4ea
Signed by: jonas
GPG Key ID: 4000EB35E1AE0F07
2 changed files with 46 additions and 0 deletions

View File

@ -2,6 +2,7 @@
imports = [
# Include the results of the hardware scan.
# ./hardware-configuration.nix
../../modules/services/nextcloud-instance.nix
];
# Configure nix and garbage collection
@ -35,6 +36,9 @@
settings.KbdInteractiveAuthentication = false;
};
services.nextcloud-instance.enable = true;
services.nextcloud-instance.instanceFQDN = "replace.me";
# Allow unfree packages
nixpkgs.config.allowUnfree = true;

View File

@ -0,0 +1,42 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.services.nextcloud-instance;
in {
options.services.nextcloud-instance = {
enable = lib.mkEnableOption "Enable the Nextcloud instance";
instanceFQDN = lib.mkOption {
type = lib.types.str;
example = "nextcloud.example.com";
description = "Fully qualified domain name of the Nextcloud instance";
};
};
config = lib.mkIf cfg.enable {
environment.etc."nc-admin-pass.txt".text = "replace-me-with-a-sops-secret";
services.nextcloud = {
enable = true;
hostName = cfg.instanceFQDN;
https = false;
config.dbtype = "mysql";
config.adminpassFile = "/etc/nc-admin-pass.txt"; # FIXME: sops
};
services.nginx.virtualHosts.${cfg.instanceFQDN}.listen = [
{
port = 8080;
addr = "0.0.0.0";
}
];
services.mysql = {
enable = true;
package = pkgs.mariadb;
};
};
}