{ pkgs, inputs, ... }:
{
  imports = [
    ./hardware-configuration.nix
    "${inputs.self}/modules/mizukios/base"
    "${inputs.self}/modules/mizukios/features/system/boot.nix"
    "${inputs.self}/modules/mizukios/features/remote/ssh.nix"
    "${inputs.self}/modules/mizukios/features/management/docker.nix"
  ];

  virtualisation.docker.daemon.settings = {
    fixed-cidr-v6 = "fd00::/80";
    ipv6 = true;
  };

  # 2. 크론 설정
  services.cron = {
    enable = true;
    systemCronJobs = [
      "1 0 * * *  imnyang  * * * * * printf '\n%s : ' '$(date)' >> /home/imnyang/codelounge.log && /home/imnyang/codelounge.sh >> /home/imnyang/codelounge.log"
    ];
  };
  services.netbird.enable = true;

  # 3. 사용자 SSH 키 등록
  users.users.imnyang.openssh.authorizedKeys.keys = [
    "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOHP3Z+AYrRh9f8TYyqChKfeyNm3lOe0F75AwRHTTaxD imnyang@kazusa"
    "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIrpjEYOBx7LTGb7QsPrmPBboqyTUNm/e+4+yqWruljv imnyang@natsu"
  ];

  environment.systemPackages = with pkgs; [
    eza
    neovim
    nil
    nixd
    bun
    stdenv.cc.cc.lib
  ];

  programs.nix-ld.enable = true;

  systemd.services.blog = {
    description = "blog.imnya.ng";
    after = [ "network-online.target" ];
    wants = [ "network-online.target" ];
    wantedBy = [ "multi-user.target" ];

    serviceConfig = {
      Type = "simple";
      User = "imnyang";
      Environment = [
        "LD_LIBRARY_PATH=${pkgs.stdenv.cc.cc.lib}/lib"
      ];
      WorkingDirectory = "/home/imnyang/git/imnyang/blog";
      ExecStart = "${pkgs.bun}/bin/bun run preview";
      Restart = "always";
      RestartSec = 5;
    };

    path = [ pkgs.bun ];
  };

  services.qemuGuest.enable = true;

  boot.kernel.sysctl = {
    "net.ipv4.ip_forward" = 1;
    "net.ipv6.conf.all.forwarding" = 1;
  };

  programs.git.config = {
    safe.directory = "*";
  };

  networking.firewall.allowedTCPPorts = [
    22
    80
    443
  ];

  networking.hostName = "natsu";
  system.stateVersion = "26.05";
}
