bonfire/nixosConfigurations/catarina/default.nix

238 lines
5.2 KiB
Nix
Raw Normal View History

{ config, pkgs, lib, inputs, self, ... }:
2024-01-16 12:58:07 +05:00
rec {
2024-01-06 18:06:02 +05:00
system.stateVersion = "23.11";
2024-01-25 18:09:52 +05:00
imports = [
./hardware.nix ./users.nix
./services/papermc.nix
./services/gitea.nix
];
2024-01-06 18:06:02 +05:00
# Nix settings
nix = {
settings = {
experimental-features = [ "nix-command" "flakes" ];
trusted-users = [ "nafaryus" ];
allowed-users = [ "nafaryus" ];
substituters = [ "https://nix-community.cachix.org" ];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
auto-optimise-store = true;
};
gc = {
automatic = lib.mkDefault true;
dates = lib.mkDefault "weekly";
options = lib.mkDefault "--delete-older-than 14d";
};
};
# Nix packages
nixpkgs = {
hostPlatform = lib.mkDefault "x86_64-linux";
config.allowUnfree = true;
config.cudaSupport = false;
config.packageOverrides = super: {
lego = self.packages.${pkgs.system}.lego;
};
2024-01-06 18:06:02 +05:00
};
# Services
services.xserver = {
enable = true;
layout = "us";
xkbVariant = "";
videoDrivers = [ "nvidia" ];
displayManager.gdm = {
2024-02-29 16:15:16 +05:00
enable = false;
autoSuspend = false;
};
2024-02-29 16:15:16 +05:00
desktopManager.gnome.enable = false;
2024-01-06 18:06:02 +05:00
};
services.printing.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
services.openssh = {
enable = true;
startWhenNeeded = true;
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
2024-01-06 18:06:02 +05:00
};
services.blueman.enable = true;
services.fail2ban = {
enable = true;
maxretry = 12;
ignoreIP = [
"192.168.0.0/16"
];
bantime = "3h";
bantime-increment = {
enable = true;
2024-01-16 13:05:15 +05:00
multipliers = "1 2 4 8 16 32 64";
maxtime = "168h";
overalljails = true;
};
};
sops = {
defaultSopsFile = ../../.secrets/secrets.yaml;
age.keyFile = "/var/lib/secrets/sops-nix/catarina.txt";
secrets = import ../../.secrets/sops-secrets.nix;
};
security.acme = {
acceptTerms = true;
2024-02-29 16:15:16 +05:00
defaults.email = "l.nafaryus@elnafo.ru";
defaults.group = "nginx";
certs = {
"elnafo.ru" = {
2024-02-29 16:15:16 +05:00
extraDomainNames = [ "*.elnafo.ru" ];
dnsProvider = "webnames";
credentialsFile = config.sops.secrets."dns".path;
webroot = null;
};
};
};
2024-01-25 18:09:52 +05:00
2024-01-09 19:26:30 +05:00
services.nginx = {
enable = true;
package = pkgs.nginx.override { withMail = true; };
2024-01-09 19:26:30 +05:00
recommendedProxySettings = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
recommendedTlsSettings = true;
clientMaxBodySize = "5G";
virtualHosts = {
"elnafo.ru" = {
forceSSL = true;
enableACME = true;
root = "/var/www";
};
"www.elnafo.ru" = {
forceSSL = true;
useACMEHost = "elnafo.ru";
globalRedirect = "elnafo.ru";
};
"media.elnafo.ru" = {
forceSSL = true;
useACMEHost = "elnafo.ru";
http2 = true;
locations."/".proxyPass = "http://127.0.0.1:8096";
};
};
2024-01-16 12:58:07 +05:00
};
mailserver = {
enable = true;
fqdn = "elnafo.ru";
domains = [ "elnafo.ru" ];
certificateScheme = "acme-nginx";
enableImapSsl = true;
openFirewall = true;
2024-02-29 16:15:16 +05:00
localDnsResolver = true;
loginAccounts = import ../../.secrets/mail-recipients.nix { inherit config; };
};
services.jellyfin = {
enable = true;
openFirewall = true;
};
2024-01-06 18:06:02 +05:00
services.spoofdpi.enable = true;
2024-02-29 16:15:16 +05:00
#services.btrbk = {
# instances."catarina" = {
# onCalendar = "weekly";
# settings = {
# volume."/" = {
#
# };
# };
# };
#};
2024-01-06 18:06:02 +05:00
# Packages
environment.systemPackages = with pkgs; [
wget
ntfs3g
sshfs
exfat
2024-02-29 16:15:16 +05:00
btrfs-progs
2024-01-06 18:06:02 +05:00
lm_sensors
git
ripgrep
fd
lazygit
unzip
gnumake
fishPlugins.fzf-fish
fishPlugins.tide
fishPlugins.grc
fishPlugins.hydro
nnn
fzf
grc
gcc
cachix
gnupg
nnn
htop
];
programs = {
fish.enable = true;
neovim = {
enable = true;
defaultEditor = true;
};
};
programs.ssh.extraConfig = ''
Host astora
HostName 192.168.156.101
Port 22
User nafaryus
Host catarina
HostName 192.168.156.102
Port 22
2024-02-29 16:15:16 +05:00
User l.nafaryus
'';
2024-01-06 18:06:02 +05:00
programs.direnv.enable = true;
fonts.packages = with pkgs; [ nerdfonts ];
}