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

{
  imports = [
    ../../modules
  ];

  home.username = "cody";
  home.homeDirectory = "/home/cody";
  home.stateVersion = "24.11";

  nixpkgs.config.allowUnfree = true;

  home.packages = with pkgs; [
    kitty
    screenkey
    docker
    tree
    ffmpeg
    tilt
    unzip
    gimp
    ripgrep
    fzf
    lsd
    lazygit
    opencode
    neofetch
    fastfetch
    tree
    git
    nodejs_22
    zig
    tailwindcss
    templ
    imagemagick
    go-blueprint
    protobuf
    air
    pywal
    bat
    # go_1_24
    # go-tools
    # Protocol buffers
    # protobuf
    # Go protoc plugins
    # protoc-gen-go
    # protoc-gen-go-grpc
    cava
    w3m
    nwg-displays
    (writeShellScriptBin "protoc-gen-go" ''
      export PATH=$HOME/.go/bin:$PATH
      go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
    '')

    (writeShellScriptBin "protoc-gen-go-grpc" ''
      export PATH=$HOME/.go/bin:$PATH
      go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
    '')
  ];

  modules.android = {
    enable = false;
    enableEmulator = false;
    apiLevel = 34;
    enableFlutterSupport = false;
  };

  home.sessionVariables = {
    SHELL = "${pkgs.zsh}/bin/zsh";
  };

  programs.dircolors.enable = true;

  home.file.".p10k.zsh".source = ../../.p10k.zsh;
  
  home.activation.copyScripts =
    lib.hm.dag.entryAfter [ "writeBoundary" ] ''
      mkdir -p ~/.local/share/bin
      rm -rf ~/.local/share/bin/*
      cp -r ${../../scripts}/* ~/.local/share/bin/
      chmod +x ~/.local/share/bin/*
      if [ -x ~/.local/share/bin/tmux-session-manager.sh ] && [ ! -e ~/.local/share/bin/tmux-session-manager ]; then
        ln -s ~/.local/share/bin/tmux-session-manager.sh ~/.local/share/bin/tmux-session-manager
      fi
    '';

  home.activation.setupFirefoxCalendarProfile =
    lib.hm.dag.entryAfter [ "writeBoundary" ] ''
      bash ~/.local/share/bin/setup-firefox-calendar-profile.sh
    '';

  home.activation.copyWallpapers =
    lib.hm.dag.entryAfter [ "writeBoundary" ] ''
      mkdir -p ~/Pictures/wallpapers
      rm -rf ~/Pictures/wallpapers/*
      cp -r ${../../wallpapers}/* ~/Pictures/wallpapers/
    '';
}
