{ inputs, pkgs, config, lib, ... }: {
  imports = [
    ../../templates/proxmox-lxc.nix
    ../../server.nix
    ../../features/dns-cache.nix
    ../../features/nas0.nix
  ];

  networking.hostName = "nextcloud";
  system.stateVersion = "24.11";
  nixpkgs.hostPlatform = "x86_64-linux";

  sops.secrets.nextcloud_admin_pass = {
    sopsFile = ../../../secrets/nextcloud/default.yaml;
    owner = "nextcloud";
    group = "nextcloud";
    mode = "0444";
  };

  services.nextcloud = {
    enable = true;
    package = pkgs.nextcloud30;
    hostName = "nc.noe.sh";
    settings = {
      trusted_domains = [ "nextcloud.hoki-porgy.ts.net" "nc.noe.sh" ];
    };
    config.adminpassFile = config.sops.secrets.nextcloud_admin_pass.path;
    database.createLocally = true;
    # https = true;
    home = "/mnt/data/nextcloud";
    maxUploadSize = "150M";
  };
}
