profiles:
  macos:
    os: macos
    package-manager: brew
    shell: zsh
    requires: [HOSTNAME, USER_EMAIL]
    hostname: "{{ env.HOSTNAME }}"
    packages:
      - git
      - tmux
      - zsh
      - dnsmasq
      - cask/brave
      - cask/bruno
      - cask/dbeaver
      - cask/discord
      - cask/firefox
      - cask/font-maple-mono
      - cask/font-maple-mono-nf
      - cask/ghostty
      - cask/chrome
      - cask/karabiner
      - cask/linearmouse
      - cask/macfuse
      - cask/orbstack
      - cask/proton-drive
      - cask/protonvpn
      - cask/rectangle
      - cask/slack
      - cask/sol
      - cask/spotify
      - cask/sublime-text
      - cask/utm
      - cask/zoom
      - name: setup
        post-install: |
          chmod +x ~/.local/share/setup/* 2>/dev/null || true
          if [ -f ~/.local/share/setup/macos-defaults ]; then
            ~/.local/share/setup/macos-defaults
          fi
      - name: dnsmasq-service
        allow_sudo: true
        post-install: |
          sudo brew services restart dnsmasq || sudo brew services start dnsmasq
    ssh-keygen:
      - type: ed25519
        filename: id_ed25519
        comment: "{{ env.USER_EMAIL }}"
      - type: ed25519
        filename: id_ed25519_git
        comment: "{{ env.USER_EMAIL }}"
    runcmd:
      - mkdir -p ~/projects
      - mkdir -p ~/.bin
      - git config --global user.email "{{ env.USER_EMAIL }}"
      - git config --global user.name "Tomas Mirchev"
      - chmod +x ~/.bin/* 2>/dev/null || true
    post-link: |
      echo "macOS dotfiles linked."
      echo "Import Rectangle config from ~/.config/rectangle/RectangleConfig.json"

  linux:
    os: linux
    requires: [USER_EMAIL]
    shell: zsh
    packages:
      - name: window-tagger
        post-install: |
          echo "Window Tagger config linked to ~/.local/share/kwin/scripts/window-tagger"
    ssh-keygen:
      - type: ed25519
        filename: id_ed25519
        comment: "{{ env.USER_EMAIL }}"
    runcmd:
      - mkdir -p ~/projects
      - mkdir -p ~/.bin
      - git config --global user.email "{{ env.USER_EMAIL }}"
      - git config --global user.name "Tomas Mirchev"
