nextcloud draft
This commit is contained in:
parent
e699b6cc42
commit
a63014d4ea
@ -2,6 +2,7 @@
|
|||||||
imports = [
|
imports = [
|
||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
# ./hardware-configuration.nix
|
# ./hardware-configuration.nix
|
||||||
|
../../modules/services/nextcloud-instance.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Configure nix and garbage collection
|
# Configure nix and garbage collection
|
||||||
@ -35,6 +36,9 @@
|
|||||||
settings.KbdInteractiveAuthentication = false;
|
settings.KbdInteractiveAuthentication = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.nextcloud-instance.enable = true;
|
||||||
|
services.nextcloud-instance.instanceFQDN = "replace.me";
|
||||||
|
|
||||||
# Allow unfree packages
|
# Allow unfree packages
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
|||||||
42
modules/services/nextcloud-instance.nix
Normal file
42
modules/services/nextcloud-instance.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user