Introduces a shared configuration file to streamline machine-specific settings for NixOS deployments. This includes: - Hostname configuration - Common system packages (vim, git, htop) - SSH service enablement - Nginx setup with virtual host configuration - Firewall rules for HTTP/HTTPS access Updates machine-specific configurations to import shared settings, reducing redundancy and improving maintainability. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
33 lines
No EOL
621 B
Nix
33 lines
No EOL
621 B
Nix
{ config, pkgs, hostName, ... }:
|
|
|
|
{
|
|
# Set hostname (passed as parameter)
|
|
networking.hostName = hostName;
|
|
|
|
# System packages
|
|
environment.systemPackages = with pkgs; [
|
|
vim
|
|
git
|
|
htop
|
|
];
|
|
|
|
# Enable SSH
|
|
services.openssh.enable = true;
|
|
|
|
# Enable and configure nginx
|
|
services.nginx = {
|
|
enable = true;
|
|
virtualHosts."${hostName}" = {
|
|
root = "/var/src/web-app-dist";
|
|
locations."/" = {
|
|
index = "index.html";
|
|
};
|
|
};
|
|
};
|
|
|
|
# Open firewall for HTTP/HTTPS
|
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
|
|
|
# NixOS release version
|
|
system.stateVersion = "25.05";
|
|
} |