From 406866d96a27b52149c8e0f48751e125580ebed8 Mon Sep 17 00:00:00 2001 From: Ruixi-rebirth Date: Wed, 13 May 2026 05:11:57 +0800 Subject: [PATCH] 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 --- docs/installation.md | 75 +++++++++++++++++++++++++++++++++++++++++-- nix/hm-modules.nix | 2 +- nix/nixos-modules.nix | 2 +- 3 files changed, 74 insertions(+), 5 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 6f3927a0..903d7cb9 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -58,6 +58,7 @@ dnf install mangowm The package is hosted in the community-maintained **GURU** repository. 1. **Add the GURU repository** + ```bash emerge --ask --verbose eselect-repository eselect repository enable guru @@ -82,6 +83,7 @@ The package definition is described in the source repository. 1. **Add mango channel** Add to `$HOME/.config/guix/channels.scm`: + ```scheme (cons (channel (name 'mangowm) @@ -92,11 +94,13 @@ The package definition is described in the source repository. 2. **Install** After running `guix pull`, you can install mangowm: + ```bash guix install mangowm ``` Or add it to your system configuration using the mangowm module: + ```scheme (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. 1. **Add flake input** + ```nix # flake.nix { @@ -132,6 +137,7 @@ The repository provides a Flake with a NixOS module. 2. **Import the NixOS module** **Option A — Import in `configuration.nix`:** + ```nix # configuration.nix (or any other file that you import) {inputs, ...}: { @@ -145,6 +151,7 @@ The repository provides a Flake with a NixOS module. ``` **Option B — Import directly in flake:** + ```nix # flake.nix { @@ -165,6 +172,7 @@ The repository provides a Flake with a NixOS module. ``` 3. **Enable the module** + ```nix # 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** - - `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 +4. **Start mango on login** + + 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. > **Info:** Ensure the following dependencies are installed before proceeding: +> > - `wayland` > - `wayland-protocols` > - `libinput` @@ -213,6 +280,7 @@ You will need to build `wlroots` and `scenefx` manually as well. 1. **Build wlroots** Clone and install the specific version required (check README for latest version). + ```bash git clone -b 0.19.3 https://gitlab.freedesktop.org/wlroots/wlroots.git cd wlroots @@ -222,6 +290,7 @@ You will need to build `wlroots` and `scenefx` manually as well. 2. **Build scenefx** This library handles the visual effects. + ```bash git clone -b 0.4.1 https://github.com/wlrfx/scenefx.git cd scenefx diff --git a/nix/hm-modules.nix b/nix/hm-modules.nix index f9a341a3..eba05e2f 100644 --- a/nix/hm-modules.nix +++ b/nix/hm-modules.nix @@ -102,7 +102,7 @@ in description = '' Mango configuration written in Nix. Entries with the same key should be written as lists. Variables and colors names should be - quoted. See for more examples. + quoted. See for more examples. ::: {.note} This option uses a structured format that is converted to Mango's diff --git a/nix/nixos-modules.nix b/nix/nixos-modules.nix index 7295fffa..9144bbf1 100644 --- a/nix/nixos-modules.nix +++ b/nix/nixos-modules.nix @@ -12,7 +12,7 @@ in { addLoginEntry = lib.mkOption { type = lib.types.bool; 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 { type = lib.types.package;