{ config, pkgs, ... }:

{
  # allow flakes
  nix.settings.experimental-features = [ "nix-command" "flakes" ];

  # common system packages
  environment.systemPackages = with pkgs; [
    # editor
    vim
    # lib
    libz
    openssl
    # shell
    bash
    zsh
    # utility
    acpi
    curl
    dig
    file
    htop
    openssh
    p7zip
    ripgrep
    sbctl
    tree
    unzip
    wget
  ];

  # use the latest kernel
  boot.kernelPackages = pkgs.linuxPackages_latest;

  # timezone
  time.timeZone = "America/New_York";

  # locale
  i18n.defaultLocale = "en_US.UTF-8";

  # services
  networking.networkmanager.enable = true;
  services.fwupd.enable = true;
  services.libinput.enable = true;
  services.pcscd.enable = true;
  services.printing.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    pulse.enable = true;
    jack.enable = true;
  };

  # create user account
  users.users.${config.user} = {
    isNormalUser = true;
    description = config.fullName;
    extraGroups = [ "networkmanager" "wheel" "sys" "video" "audio" ];
    home = config.homePath;
    shell = pkgs.zsh;
  };

  # certs
  security.pki.certificateFiles = [
    ../../files/certs/freyanet.crt
  ];

  # fonts
  fonts.packages = with pkgs; [
    dejavu_fonts
    fira-code
    fira-code-symbols
    jetbrains-mono
    material-icons
    nerd-fonts.fira-code
    noto-fonts
    noto-fonts-cjk-sans
    noto-fonts-emoji
    twemoji-color-font
  ];

  fonts.fontconfig = {
    enable = true;
    defaultFonts = {
      serif = [
        "Twemoji"
        "DejaVu Serif"
      ];
      sansSerif = [
        "Twemoji"
        "DejaVu Sans"
      ];
      monospace = [
        "Fira Code"
        "FiraCode Nerd Font Mono"
        "Font Awesome 6 Pro Regular"
        "Twemoji"
        "DejaVu Sans Mono"
      ];
      emoji = [
        "Twemoji"
        "Noto Color Emoji"
      ];
    };
  };
}