nix: add vps setup

This commit is contained in:
Oleksandr Smirnov 2026-01-14 21:45:55 +02:00
parent 028a52d9ff
commit 50015669e1
No known key found for this signature in database
10 changed files with 433 additions and 0 deletions

View file

@ -0,0 +1,69 @@
{ config, pkgs, ... }:
{
imports = [
./disko-config.nix
./hardware-configuration.nix
];
system.stateVersion = "24.05";
swapDevices = [
{
device = "/swapfile";
size = 2048; # MB
}
];
boot.loader.grub = {
efiSupport = true;
efiInstallAsRemovable = true;
};
time.timeZone = "Europe/Kyiv";
i18n.defaultLocale = "en_US.UTF-8";
networking = {
hostName = "vps";
useDHCP = true;
# Interface names will be auto-detected in hardware-configuration.nix
# Using generic DHCP setting
interfaces = {};
firewall = {
enable = true;
allowedTCPPorts = [80 443];
};
};
environment.systemPackages = with pkgs; [
neovim
git
htop
tmux
];
services = {
caddy.enable = true;
openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
};
};
};
nix = {
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
settings = {
auto-optimise-store = true;
experimental-features = [
"nix-command"
"flakes"
];
};
};
}