krops-multi-deploy/config/shared.nix
padreug c27fb73f3e Refactor shared Nix configuration to improve hostname handling and enable experimental features
Updated the shared Nix configuration to replace dots in the domain with hyphens for hostname setting, enhancing clarity. Additionally, enabled experimental Nix features, including 'nix-command' and 'flakes', to improve functionality and flexibility in the NixOS setup.
2025-10-09 18:07:46 +02:00

41 lines
No EOL
877 B
Nix

{ config, pkgs, domain, ... }:
{
imports = [
./nginx.nix
./modules/lnbits-service.nix
{ _module.args = { inherit domain; }; }
./pict-rs.nix
./lnbits.nix
];
# Set hostname (replace dots with hyphens, e.g., "demo.ariege.io" → "demo-ariege-io")
networking.hostName = builtins.replaceStrings ["."] ["-"] 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";
}