Initial NixOS infra flake skeleton

This commit is contained in:
Eli Fadi 2026-03-03 11:21:32 +01:00
commit 9383d615d7
9 changed files with 267 additions and 0 deletions

38
modules/nextcloud.nix Normal file
View file

@ -0,0 +1,38 @@
{ config, pkgs, lib, ... }:
{
imports = [ ./flowback-options.nix ];
# Enable nginx + ACME (TLS). Works when DNS points correctly.
services.nginx.enable = true;
security.acme.acceptTerms = true;
# I will change this email later
security.acme.defaults.email = "me@example.com";
services.nextcloud = {
enable = true;
hostName = config.services.flowback.nextcloudHost;
https = true;
# Performance / reliability
configureRedis = true;
# DB locally (Postgres) — production-ready baseline
database.createLocally = true;
# Admin bootstrap secret will be wired via sops later.
# For now, placeholder: youll set adminpassFile via sops secret.
config = {
adminuser = "admin";
adminpassFile = "/var/lib/sops-nix/nextcloud-adminpass";
dbtype = "pgsql";
dbpassFile = "/var/lib/sops-nix/nextcloud-dbpass";
};
};
services.nginx.virtualHosts.${config.services.flowback.nextcloudHost} = {
forceSSL = true;
enableACME = true;
};
}