krops-multi-deploy/config/shared.nix
padreug 30a1ae28f7 Refactor shared configuration and update LNBits service for improved domain handling
Updated shared.nix to enhance domain parameter propagation and modified configuration.nix to utilize the inherited domain for machine-specific setups. Adjusted example-service.nix to accept the domain as an argument, improving modularity. Additionally, added a new documentation file explaining the LNBits flake deployment process, detailing architecture, key components, and deployment instructions for better onboarding and understanding of the system.
2025-10-12 08:52:56 +02:00

44 lines
1 KiB
Nix

{ config, pkgs, domain, ... }:
{
imports = [
# Note: 'domain' is made available via _module.args in the machine's configuration.nix
# It's passed to this module and propagated to all imports automatically
/var/src/config-nginx
/var/src/config-pict-rs
/var/src/config-lnbits
];
# Set hostname (replace dots with hyphens, e.g., "demo.ariege.io" → "demo-ariege-io")
networking.hostName = builtins.replaceStrings ["."] ["-"] domain;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# 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";
}