Modified krops.nix to switch to a git-based nixpkgs source, noting the initial download cost. Updated shared.nix to change module imports to absolute paths and enabled experimental Nix features. Adjusted configuration.nix to import shared configuration from an absolute path and updated the domain name for machine1. These changes enhance clarity, maintainability, and functionality in the NixOS setup.
43 lines
990 B
Nix
43 lines
990 B
Nix
{ config, pkgs, domain, ... }:
|
|
|
|
{
|
|
imports = [
|
|
/var/src/config-nginx
|
|
/var/src/config-modules/lnbits-service.nix
|
|
{ _module.args = { inherit domain; }; }
|
|
/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";
|
|
}
|