58 lines
2 KiB
Nix
58 lines
2 KiB
Nix
{ config, pkgs, lib, name, ... }:
|
|
|
|
{
|
|
imports = [
|
|
./hardware-configuration.nix
|
|
../../modules/common.nix
|
|
../../modules/sops.nix
|
|
../../modules/nextcloud.nix
|
|
../../modules/forgejo.nix
|
|
];
|
|
|
|
networking.hostName = name;
|
|
|
|
# Staging: open ports for web
|
|
networking.firewall.allowedTCPPorts = [ 80 443 22 ];
|
|
|
|
# Put placeholders for domains now; you can change later
|
|
services.flowback = {
|
|
nextcloudHost = "cloud-staging.example.com";
|
|
forgejoHost = "git-staging.example.com";
|
|
};
|
|
|
|
# Minimal user (replace with your SSH key)
|
|
users.users.elifa = {
|
|
isNormalUser = true;
|
|
extraGroups = [ "wheel" ];
|
|
openssh.authorizedKeys.keys = [
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGI1L2SZzAfxkdHPsgJe0cx9s0owlMPyS6LnAURzXyad eli@wsl"
|
|
];
|
|
};
|
|
|
|
security.sudo.wheelNeedsPassword = false;
|
|
# Local VM overrides (so you can test immediately without real DNS/TLS/secrets)
|
|
virtualisation.vmVariant = { lib, config, ... }: {
|
|
# Forward guest port 80 -> host port 8080
|
|
virtualisation.forwardPorts = [
|
|
{ from = "host"; host.port = 8080; guest.port = 80; }
|
|
];
|
|
|
|
# Disable ACME/forced SSL for VM testing
|
|
security.acme.acceptTerms = lib.mkForce false;
|
|
services.nginx.virtualHosts.${config.services.flowback.nextcloudHost}.enableACME = lib.mkForce false;
|
|
services.nginx.virtualHosts.${config.services.flowback.nextcloudHost}.forceSSL = lib.mkForce false;
|
|
services.nginx.virtualHosts.${config.services.flowback.forgejoHost}.enableACME = lib.mkForce false;
|
|
services.nginx.virtualHosts.${config.services.flowback.forgejoHost}.forceSSL = lib.mkForce false;
|
|
|
|
# Nextcloud over HTTP in VM
|
|
services.nextcloud.https = lib.mkForce false;
|
|
|
|
# VM-only admin password file (OK for local testing)
|
|
environment.etc."nextcloud-adminpass".text = "admin123admin123";
|
|
services.nextcloud.config.adminpassFile = lib.mkForce "/etc/nextcloud-adminpass";
|
|
|
|
# Allow Forgejo user creation in VM (first user becomes admin during setup)
|
|
services.forgejo.settings.service.DISABLE_REGISTRATION = lib.mkForce false;
|
|
};
|
|
system.stateVersion = "25.11";
|
|
}
|