krops-multi-deploy/config/shared.nix
padreug c858eebb93 Refactor shared Nix configuration to improve hostname handling and module imports
Updated the shared Nix configuration to extract the hostname from the domain, enhancing clarity in the setup. Reordered module imports to ensure proper dependency management, including the addition of module arguments for better customization. This change improves the overall organization and maintainability of the NixOS configuration.
2025-10-09 18:07:46 +02:00

41 lines
No EOL
864 B
Nix

{ config, pkgs, domain, ... }:
{
imports = [
./nginx.nix
./modules/lnbits-service.nix
{ _module.args = { inherit domain; }; }
./pict-rs.nix
./lnbits.nix
];
# Set hostname (extract from domain, e.g., "4lpaca" from "4lpaca.io")
networking.hostName = builtins.head (pkgs.lib.splitString "." domain);
# System packages
environment.systemPackages = with pkgs; [
vim
git
htop
];
# Enable SSH
services.openssh.enable = true;
# Configure domain-specific virtual hosts
services.nginx.virtualHosts = {
# Web-app service
"app.${domain}" = {
forceSSL = true;
enableACME = true;
root = "/var/src/web-app-dist";
locations."/" = {
index = "index.html";
tryFiles = "$uri $uri/ /index.html";
};
};
};
# NixOS release version
system.stateVersion = "25.05";
}