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.
41 lines
No EOL
864 B
Nix
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";
|
|
} |