lite smått och gott

This commit is contained in:
fwastring 2025-12-01 09:40:52 +01:00
parent 66c3692ea4
commit f347964ef9
6 changed files with 94 additions and 15 deletions

View file

@ -11,23 +11,29 @@ let
in
with lib;
{
imports = [
"${
fetchTarball {
url = "https://github.com/onny/nixos-nextcloud-testumgebung/archive/fa6f062830b4bc3cedb9694c1dbf01d5fdf775ac.tar.gz";
sha256 = "0gzd0276b8da3ykapgqks2zhsqdv4jjvbv97dsxg0hgrhb74z0fs";
}
}/nextcloud-extras.nix"
];
options = {
nextcloud = {
enable = mkEnableOption "enables nextcloud";
port = lib.mkOption {
type = lib.types.int;
default = 8003;
description = "The port that Nextcloud is served on.";
};
domain = lib.mkOption {
type = lib.types.str;
default = "files.wastring.com";
description = "The hostname that Nextcloud is served on.";
};
fail2ban = {
enable = mkEnableOption "enables fail2ban integration";
};
};
};
config = mkMerge [
(mkIf config.nextloud.enable {
(mkIf config.nextcloud.enable {
services.nginx = {
virtualHosts.${config.nextcloud.domain} = {
forceSSL = true;
@ -38,6 +44,7 @@ with lib;
sops.secrets.nextcloud-admin-password = { };
sops.secrets.nextcloud-fw-password = { };
sops.secrets.nextcloud-disa-password = { };
sops.secrets.nextcloud-database-password = { };
services.nextcloud = {
enable = true;
@ -45,8 +52,10 @@ with lib;
hostName = config.nextcloud.domain;
https = true;
configureRedis = true;
config.adminpassFile = config.sops.secrets.nextcloud-admin-password.path;
config.dbtype = "sqlite";
config = {
adminpassFile = config.sops.secrets.nextcloud-admin-password.path;
dbtype = "sqlite";
};
ensureUsers = {
fw = {
email = "fredrik@wastring.com";
@ -79,7 +88,8 @@ with lib;
"OC\\Preview\\HEIC"
];
};
})
(mkIf config.nextcloud.fail2ban.enable {
services.fail2ban = {
enable = true;
jails = {
@ -96,6 +106,7 @@ with lib;
};
};
};
})
];