# Danielfm Workstation Flatpak Role

This role manages Flatpak repositories and applications for workstations. It provides:

- Flatpak repository setup for both user and system-wide applications
- Installation of specified Flatpak applications with user or system scope

## Requirements

- A Debian-based or Fedora-based Linux system
- Flatpak package installed on the system
- Root privileges for system-wide Flatpak operations

## Role Variables

Available variables are listed below, along with default values.

**Flatpak repositories to configure:**
```yaml
flatpak_remotes:
  - url: https://dl.flathub.org/repo/flathub.flatpakrepo
    method: user
  - url: https://dl.flathub.org/repo/flathub.flatpakrepo
    method: system
```

Each remote should specify the repository URL and installation method (user or system).

**System-wide Flatpak applications to install:**
```yaml
flatpak_system_apps: []
```

List of Flatpak application names to install system-wide (available to all users):
```yaml
flatpak_system_apps:
  - org.libreoffice.LibreOffice
  - org.gimp.GIMP
```

**User-level Flatpak applications to install:**
```yaml
flatpak_user_apps: []
```

List of Flatpak application names to install for the current user:
```yaml
flatpak_user_apps:
  - org.mozilla.firefox
  - com.spotify.Client
```

## Dependencies

None.

## Example Playbook

```yaml
- hosts: localhost
  connection: local
  vars:
    flatpak_remotes:
      - url: https://dl.flathub.org/repo/flathub.flatpakrepo
        method: user
      - url: https://dl.flathub.org/repo/flathub.flatpakrepo
        method: system
    flatpak_system_apps:
      - org.libreoffice.LibreOffice
      - org.gimp.GIMP
    flatpak_user_apps:
      - org.mozilla.firefox
      - com.spotify.Client
  roles:
    - danielfm.workstation.flatpak
```

## What This Role Configures

**Repository Management:**
- Flatpak repositories (Flathub by default) for user and/or system scope
- Support for multiple repositories with different installation methods

**Application Management:**
- Installation of system-wide Flatpak applications (available to all users)
- Installation of user-level Flatpak applications (for the current user only)
- Simplified configuration with separate lists for system and user applications

**System Integration:**
- Flatpak package installation on supported distributions
- Desktop integration for installed applications
- Automatic updates through system package managers

## Important Notes

- System-wide Flatpak operations require root privileges
- User-level installations don't require elevated permissions
- Applications installed system-wide are available to all users
- The role ensures Flatpak is installed before configuring repositories
- Repository URLs should point to valid .flatpakrepo files

## License

MIT

## Author Information

This role was created by Daniel Martins.
