server/hosts/kamoshi/configuration.nix
2023-07-09 15:14:43 +02:00

87 lines
2.1 KiB
Nix

{ config, pkgs, ... }:
{
imports =
[
/etc/nixos/hardware-configuration.nix
];
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
# boot.loader.grub.efiSupport = true;
# boot.loader.grub.efiInstallAsRemovable = true;
# boot.loader.efi.efiSysMountPoint = "/boot/efi";
# Define on which hard drive you want to install Grub.
boot.loader.grub.device = "/dev/vda"; # or "nodev" for efi only
networking = {
hostName = "kamoshi";
firewall = {
enable = true;
allowedTCPPorts = [ 22 80 443 2222 ];
};
};
time.timeZone = "Europe/Warsaw";
i18n.defaultLocale = "en_US.UTF-8";
users.users.kamov = {
isNormalUser = true;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keyFiles = [ /etc/nixos/ssh/kamov ];
};
environment.systemPackages = with pkgs; [
git
vim
wget
neovim
neofetch
nushell
];
services = {
endlessh = {
enable = true;
port = 22;
};
openssh = {
enable = true;
ports = [ 2222 ];
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
};
nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
virtualHosts = {
"kamoshi.org" = {
default = true;
root = "/var/www/kamoshi.org";
addSSL = true;
enableACME = true;
};
};
};
};
security.acme = {
acceptTerms = true;
defaults.email = "maciej@kamoshi.org";
};
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.05"; # Did you read the comment?
}