# Miasma OS Installer

Opinionated Arch Linux installer built with Go that leverages the alis (Arch Linux Install Script) framework.
This installer creates a security-hardened, immutable Miasma OS with Cosmic Desktop.

## Features

- **Filesystem**: btrfs with optimized subvolume layout and snapshots
- **Desktop**: Cosmic Desktop (Rust-based, memory-safe)
- **Kernel**: linux-hardened for security
- **Encryption**: LUKS2 by default (optional)
- **Boot**: UEFI only (systemd-boot) with Secure Boot support
- **Configuration**: Generates alis-compatible configuration files
- **Security**: 
  - OpenDoas instead of sudo
  - Firejail and AppArmor for application containerization
  - nftables firewall with restrictive defaults
  - XWayland-Satellite for better X11 app isolation
- **Additional Features**:
  - Chromium with Wayland support
  - Neovim
  - Kanagawa Dragon theme everywhere
  - Alacritty terminal emulator
  - Zsh shell

## Quick Install

Boot into Arch Linux installation media and run:

```bash
# Build and run installer
./build.sh
sudo ./miasma-installer
```

## How It Works

This installer uses the alis (Arch Linux Install Script) framework to perform the base system installation.
The process is:

1. The Go installer prompts for user input (disk, username, password)
2. Creates alis configuration files (`alis.conf` and `alis-packages.conf`)
3. Runs the alis installation script to install the base system
4. Applies Miasma-specific post-installation configurations via `miasma-post-install.sh`

## Configuration Files

The installer generates alis-compatible configuration files:
- `alis.conf` - System configuration (disk layout, packages, services, etc.)
- `alis-packages.conf` - Package installation configuration

## Development

### Prerequisites

- Go 1.19 or later
- Arch Linux (for testing)

### Building

```bash
# Build binary
./build.sh

# Run directly
sudo ./miasma-installer
```

## Project Structure

```
.
├── alis/              # alis framework (submodule)
├── alis.conf          # alis system configuration (generated)
├── alis-packages.conf # alis packages configuration (generated)
├── miasma-post-install.sh # Post-installation script
├── build.sh           # Build script
└── main.go            # Entry point
```

## Post-Install Script

The `miasma-post-install.sh` script runs after the alis installation completes:

- Enables AppArmor, Firejail, and nftables services
- Configures opendoas
- Sets zsh as the default shell
- Enables systemd-timesyncd for time synchronization

## License

MIT