nix-dotfiles/baldur/configuration.nix

97 lines
2.4 KiB
Nix

{ pkgs, lib, ... }:
with lib; {
boot = {
growPartition = true;
kernelParams = [ "console=ttyS0" "panic=1" "boot.panic_on_fail" ];
initrd.kernelModules = [ "virtio_scsi" ];
kernelModules = [ "virtio_pci" "virtio_net" ];
loader = {
grub.device = "/dev/vda";
timeout = 0;
grub.configurationLimit = 0;
};
};
console = { font = "Lat2-Terminus16"; keyMap = "it"; };
environment = {
pathsToLink = [ "/share/zsh" ];
systemPackages = with pkgs; [ tmux vim kitty ];
};
i18n.defaultLocale = "it_IT.UTF-8";
programs = {
gnupg.agent = { enable = true; enableSSHSupport = true; };
zsh = { enable = true; syntaxHighlighting.enable = true; };
};
networking.hostName = "baldur";
time.timeZone = "Europe/Rome";
services = {
avahi = {
enable = true;
openFirewall = true;
interfaces = [ "ztmjfdwjkp" ];
nssmdns = true;
publish = {
enable = true;
addresses = true;
domain = true;
userServices = true;
workstation = true;
};
extraServiceFiles = {
ssh = "${pkgs.avahi}/etc/avahi/services/ssh.service";
};
};
fail2ban = { enable = true; bantime-increment.enable = true; };
nginx = {
enable = true;
recommendedProxySettings = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
recommendedTlsSettings = true;
virtualHosts = let ssl = { enableACME = true; forceSSL = true; }; in
{
"unimi.bertof.net" = ssl // { locations."/".extraConfig = "rewrite ^/(.*)$ https://homes.di.unimi.it/berto/$1 redirect ;"; };
"home-manager.bertof.net" = ssl // { locations."/".proxyPass = "http://loki.local:8123/"; };
};
};
openssh = { enable = true; openFirewall = true; };
};
security.acme = {
acceptTerms = true;
defaults.email = "filippo.berto95@gmail.com";
};
users.users.bertof = {
isNormalUser = true;
extraGroups = [
"audio"
"input"
"docker"
"libvirtd"
"network"
"networkmanager"
"usb"
"video"
"wheel"
];
shell = pkgs.zsh;
};
networking.firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = [ 8000 80 443 ];
# allowedUDPPorts = [ ];
# extraCommands = ''iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns'';
};
system.stateVersion = "22.11";
}