nixos-config/hosts/server/default.nix

102 lines
2.9 KiB
Nix
Raw Normal View History

2022-11-19 21:38:55 +01:00
#
# Specific system configuration settings for desktop
#
# flake.nix
# ├─ ./hosts
# │ └─ ./laptop
# │ ├─ default.nix *
# │ └─ hardware-configuration.nix
# └─ ./modules
# ├─ ./desktop
# │ └─ ./hyprland
# │ └─ hyprland.nix
# ├─ ./modules
# │ └─ ./programs
# │ └─ waybar.nix
# └─ ./hardware
# └─ default.nix
#
2024-01-20 17:28:56 +01:00
{ config, pkgs, user, agenix, impermanence, ... }:
2022-11-19 21:38:55 +01:00
{
imports = # For now, if applying to other system, swap files
[(import ./hardware-configuration.nix)] ++ # Current system hardware config @ /etc/nixos/hardware-configuration.nix
2024-05-19 17:57:35 +02:00
[(import ../../modules/wm/virtualisation/docker.nix)] ++ # Docker
(import ../../modules/services/server) ++ # Server Services
2022-11-19 21:38:55 +01:00
(import ../../modules/hardware); # Hardware devices
boot = { # Boot options
kernelPackages = pkgs.linuxPackages_latest;
loader = { # EFI Boot
2022-12-06 22:24:15 +01:00
grub = {
enable = true;
device = "/dev/sda";
};
2022-11-19 21:38:55 +01:00
timeout = 1; # Grub auto select time
};
};
2023-10-16 10:33:47 +02:00
environment = {
etc = {
"fail2ban/filter.d/gitea.conf" = {
source = ../../modules/services/server/fail2ban/filter/gitea.conf;
mode = "0444";
};
"fail2ban/filter.d/nextcloud.conf" = {
source = ../../modules/services/server/fail2ban/filter/nextcloud.conf;
mode = "0444";
};
};
};
2022-11-19 21:38:55 +01:00
programs = { # No xbacklight, this is the alterantive
zsh.enable = true;
2022-11-19 21:38:55 +01:00
ssh.startAgent = false;
gnupg.agent = {
enable = true;
enableSSHSupport = true;
2024-06-03 20:24:22 +02:00
pinentryPackage = pkgs.pinentry-curses;
2022-11-19 21:38:55 +01:00
};
};
services = {
#auto-cpufreq.enable = true;
2023-11-23 21:54:55 +01:00
qemuGuest.enable = true;
2024-06-04 21:11:04 +02:00
#avahi = { # Needed to find wireless printer
# enable = true;
# nssmdns = true;
# publish = { # Needed for detecting the scanner
# enable = true;
# addresses = true;
# userServices = true;
# };
#};
2023-10-16 10:33:47 +02:00
fail2ban = {
enable = true;
maxretry = 5;
jails.DEFAULT.settings = {
findtime = "15m";
};
jails = {
gitea = ''
enabled = true
filter = gitea
backend = systemd
action = iptables-allports
'';
nextcloud = ''
backend = auto
enabled = true
filter = nextcloud
logpath = /var/lib/nextcloud/data/nextcloud.log
action = iptables-allports
'';
};
};
2022-11-19 21:38:55 +01:00
};
}