# Edit this configuration file to define what should be installed on
# your system.  Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).

{
  config,
  pkgs,
  inputs,
  lib,
  system,
  ...
}:

{
  imports = [
    ../../modules/agenix/default.nix
    ../../modules/applications/bash.nix
    ../../modules/applications/gpg.nix
    ../../modules/applications/language.nix
    ../../modules/btrfs/default.nix
    ../../modules/development/devenv.nix
    ../../modules/development/devpod.nix
    ../../modules/development/direnv.nix
    ../../modules/gaming/default.nix
    ../../modules/networking/default.nix
    ../../modules/nixos/default.nix
    ../../modules/services/audio.nix
    ../../modules/services/clamav.nix
    ../../modules/services/gdrive.nix
    ../../modules/suitecloud-sdk/default.nix
    ../../modules/virtualisation/podman.nix
    ../../modules/yubikey/default.nix
    ../../users/marvin/default.nix
  ];

  boot.kernelPackages = pkgs.linuxPackages_6_14;

  # List packages installed in system profile. To search, run:
  # $ nix search wget
  environment = {
    systemPackages = with pkgs; [
      bat
      curl
      eza
      # gcc
      git
      gnupg
      fd
      fzf
      ripgrep
      usbutils
      wget
      wl-clipboard
      inputs.zen-browser.packages.${system}.default # artifacts are downloaded from this repository to guarantee reproducibility
      zoxide
    ];
  };

  fonts = {
    packages = with pkgs; [
      liberation_ttf
      meslo-lgs-nf
      # nerdfonts #TODO upate to new packages
      noto-fonts
      noto-fonts-cjk-sans
    ];
  };

  # Allow unfree packages
  nixpkgs.config.allowUnfree = true;
  # nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
  #     "discord"
  #     "google-chrome"
  #     "obsidian"
  #     "slack"
  #     "spotify"
  #     "vscode"
  #     "vscode-with-extensions"
  # ];

  programs = {
    fzf = {
      fuzzyCompletion = true;
      # keybindings = true;
    };

    lazygit = {
      enable = true;
    };
    partition-manager.enable = true;
    ssh.startAgent = true;
    zsh.enable = true;
  };

  security.rtkit.enable = true;

  services = {
    cron.enable = true;

    # Enable CUPS to print documents.
    printing.enable = false;

    # Enable the X11 windowing system.
    # You can disable this if you're only using the Wayland session.
    xserver.enable = true;
  };

  # This value determines the NixOS release from which the default
  # settings for stateful data, like file locations and database versions
  # on your system were taken. It‘s perfectly fine and recommended to leave
  # this value at the release version of the first install of this system.
  # Before changing this value read the documentation for this option
  # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  system.stateVersion = "24.05"; # Did you read the comment?

  # Set your time zone.
  time.timeZone = "Asia/Taipei";
}