{ config, pkgs, ... }:

{
  imports = [
    ./hardware-configuration.nix
    ./system.nix
    ./power.nix

    ./services/caddy.nix
    ./services/status.nix

    ./services/wireguard.nix
    ./services/qbittorrent.nix
    ./services/starr.nix
    ./services/jelly.nix

    ./services/immich.nix
    ./services/vaultwarden.nix
    ./services/forgejo.nix
    ./services/fedi.nix
  ];

  networking.firewall = {
    enable = true;
    allowedTCPPorts = [ 22 80 443 8888 ];
  };

  systemd.tmpfiles.rules = [
    "d /var/lib/data 0775 daniel users -"
  ];

  environment.systemPackages = with pkgs; [
    neovim
    git
    htop
    inetutils
  ];

  environment.shellAliases = {
    rebuild = "sudo nixos-rebuild switch --flake ~/server-config#server";
    rebuild-test = "sudo nixos-rebuild test --flake ~/server-config#server";
    rebuild-dry = "nixos-rebuild dry-run --flake ~/server-config#server";
  };

}

