docs(nix): add startup guide and clarify addLoginEntry

- Replace 'Extra options' with greetd and getty autologin examples
- Add bash/zsh and fish variants for getty autologin
- Add link to Nix Module Options reference
- Clarify addLoginEntry only has effect when a DM is configured
This commit is contained in:
Ruixi-rebirth 2026-05-13 05:11:57 +08:00
parent d5db98cfb7
commit 406866d96a
No known key found for this signature in database
GPG key ID: 847E32F6F2F1D108
3 changed files with 74 additions and 5 deletions

View file

@ -58,6 +58,7 @@ dnf install mangowm
The package is hosted in the community-maintained **GURU** repository. The package is hosted in the community-maintained **GURU** repository.
1. **Add the GURU repository** 1. **Add the GURU repository**
```bash ```bash
emerge --ask --verbose eselect-repository emerge --ask --verbose eselect-repository
eselect repository enable guru eselect repository enable guru
@ -82,6 +83,7 @@ The package definition is described in the source repository.
1. **Add mango channel** 1. **Add mango channel**
Add to `$HOME/.config/guix/channels.scm`: Add to `$HOME/.config/guix/channels.scm`:
```scheme ```scheme
(cons (channel (cons (channel
(name 'mangowm) (name 'mangowm)
@ -92,11 +94,13 @@ The package definition is described in the source repository.
2. **Install** 2. **Install**
After running `guix pull`, you can install mangowm: After running `guix pull`, you can install mangowm:
```bash ```bash
guix install mangowm guix install mangowm
``` ```
Or add it to your system configuration using the mangowm module: Or add it to your system configuration using the mangowm module:
```scheme ```scheme
(use-modules (mangowm)) (use-modules (mangowm))
@ -115,6 +119,7 @@ The package definition is described in the source repository.
The repository provides a Flake with a NixOS module. The repository provides a Flake with a NixOS module.
1. **Add flake input** 1. **Add flake input**
```nix ```nix
# flake.nix # flake.nix
{ {
@ -132,6 +137,7 @@ The repository provides a Flake with a NixOS module.
2. **Import the NixOS module** 2. **Import the NixOS module**
**Option A — Import in `configuration.nix`:** **Option A — Import in `configuration.nix`:**
```nix ```nix
# configuration.nix (or any other file that you import) # configuration.nix (or any other file that you import)
{inputs, ...}: { {inputs, ...}: {
@ -145,6 +151,7 @@ The repository provides a Flake with a NixOS module.
``` ```
**Option B — Import directly in flake:** **Option B — Import directly in flake:**
```nix ```nix
# flake.nix # flake.nix
{ {
@ -165,6 +172,7 @@ The repository provides a Flake with a NixOS module.
``` ```
3. **Enable the module** 3. **Enable the module**
```nix ```nix
# configuration.nix (or any other file that you import) # configuration.nix (or any other file that you import)
{ {
@ -172,9 +180,67 @@ The repository provides a Flake with a NixOS module.
} }
``` ```
4. **Extra options** 4. **Start mango on login**
- `programs.mango.package` — the mango package to use, allows usage of custom mango drvs
- `programs.mango.addLoginEntry` (default: `true`) — adds login entry to the display manager The following are common examples. Refer to the official NixOS documentation for full configuration options.
**Option A — greetd:** Autologin on first start; login screen after logout.
```nix
services.greetd = {
enable = true;
settings = {
initial_session = {
command = "mango";
user = "your-username"; # auto-login on first start, no password required
};
default_session = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --cmd mango";
user = "greeter";
};
};
};
```
**Option B — Display manager autologin:** Autologin via an existing display manager (e.g. SDDM, GDM). [`addLoginEntry`](/docs/nix-module#addloginentry) (default: `true`) automatically registers mango as a session.
```nix
services.displayManager = {
defaultSession = "mango"; # derived from mango.desktop filename
autoLogin = {
enable = true;
user = "your-username";
};
};
```
**Option C — getty autologin:** No login screen, boots directly into mango on TTY1.
For bash/zsh:
```nix
services.getty.autologinUser = "your-username";
environment.loginShellInit = ''
[ "$(tty)" = /dev/tty1 ] && exec mango
'';
```
For fish:
```nix
services.getty.autologinUser = "your-username";
programs.fish.loginShellInit = ''
if test (tty) = /dev/tty1
exec mango
end
'';
```
5. **All available options**
See [Nix Module Options](/docs/nix-module) for the full list of NixOS and Home Manager options.
--- ---
@ -195,6 +261,7 @@ pikman install mangowm
If your distribution isn't listed above, or you want the latest unreleased changes, you can build mangowm from source. If your distribution isn't listed above, or you want the latest unreleased changes, you can build mangowm from source.
> **Info:** Ensure the following dependencies are installed before proceeding: > **Info:** Ensure the following dependencies are installed before proceeding:
>
> - `wayland` > - `wayland`
> - `wayland-protocols` > - `wayland-protocols`
> - `libinput` > - `libinput`
@ -213,6 +280,7 @@ You will need to build `wlroots` and `scenefx` manually as well.
1. **Build wlroots** 1. **Build wlroots**
Clone and install the specific version required (check README for latest version). Clone and install the specific version required (check README for latest version).
```bash ```bash
git clone -b 0.19.3 https://gitlab.freedesktop.org/wlroots/wlroots.git git clone -b 0.19.3 https://gitlab.freedesktop.org/wlroots/wlroots.git
cd wlroots cd wlroots
@ -222,6 +290,7 @@ You will need to build `wlroots` and `scenefx` manually as well.
2. **Build scenefx** 2. **Build scenefx**
This library handles the visual effects. This library handles the visual effects.
```bash ```bash
git clone -b 0.4.1 https://github.com/wlrfx/scenefx.git git clone -b 0.4.1 https://github.com/wlrfx/scenefx.git
cd scenefx cd scenefx

View file

@ -102,7 +102,7 @@ in
description = '' description = ''
Mango configuration written in Nix. Entries with the same key Mango configuration written in Nix. Entries with the same key
should be written as lists. Variables and colors names should be should be written as lists. Variables and colors names should be
quoted. See <https://mangowc.vercel.app/docs> for more examples. quoted. See <https://mangowm.github.io/docs> for more examples.
::: {.note} ::: {.note}
This option uses a structured format that is converted to Mango's This option uses a structured format that is converted to Mango's

View file

@ -12,7 +12,7 @@ in {
addLoginEntry = lib.mkOption { addLoginEntry = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
default = true; default = true;
description = "Whether to add a login entry to the display manager for mango"; description = "Whether to add a login entry to the display manager for mango. Only has effect if a display manager is configured (e.g. SDDM, GDM via `services.displayManager`).";
}; };
package = lib.mkOption { package = lib.mkOption {
type = lib.types.package; type = lib.types.package;