krops-multi-deploy/config/shared.nix
padreug aa0381c42b Refactor LNBits configuration to utilize flake imports and enhance modularity
Updated the lnbits.nix configuration to import the LNBits service module from a flake, improving maintainability and alignment with deployment practices. Adjusted the shared configuration to make the 'domain' parameter accessible to all imported modules, and removed the deprecated lnbits-service.nix file to streamline the setup.
2025-10-11 10:28:58 +02:00

42 lines
990 B
Nix

{ config, pkgs, domain, ... }:
{
imports = [
/var/src/config-nginx
{ _module.args = { inherit domain; }; } # passes <mydomain.com> for nginx virtualHosts
/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";
}