feat(session): first-boot welcome toast (#81)
All checks were successful
Check / eval (push) Successful in 4m23s

One-shot user unit fires a dismissible "You're set" notification on the
first graphical session (SUPER+M / SUPER+T / SUPER+? + Network + Doctor),
then writes settings.firstBootShown into the flake checkout. Skips the
live ISO hostname (hosts/live.nix keeps its own toast). Toggle:
nomarchy.firstBootWelcome.enable. checks.first-boot covers the gate.

Verified: V2 — flake check --no-build; checks.first-boot green; local
shim smoke; downstream-template-home ships the unit.
This commit is contained in:
Bernardo Magri
2026-07-11 10:19:46 +01:00
parent 073adf743d
commit 8f720b1078
12 changed files with 180 additions and 11 deletions

View File

@@ -28,6 +28,7 @@
./mime.nix # default applications (mimeapps.list), degrades with the suite
./recording.nix # nomarchy-record: screen recording behind Capture + the bar ⏺
./battery-notify.nix # low-battery toasts at the bar's 25/10% thresholds
./first-boot.nix # one-shot "you're set" toast on first session (#81)
./satty.nix # satty screenshot annotation tool, themed
];

View File

@@ -0,0 +1,37 @@
# First-session welcome toast (nomarchy.firstBootWelcome) — one dismissible
# "you're set" notification pointing at SUPER+M / SUPER+T / SUPER+? and
# Network, then writes settings.firstBootShown into the flake checkout
# (GOALS: no state outside the checkout). Live ISO keeps its own toast
# (hosts/live.nix); the script self-skips on hostname nomarchy-live.
{ config, lib, pkgs, ... }:
{
config = lib.mkIf config.nomarchy.firstBootWelcome.enable {
systemd.user.services.nomarchy-first-boot = {
Unit = {
Description = "Nomarchy first-session welcome toast";
PartOf = [ "graphical-session.target" ];
# After the session (and preferably the notification daemon) is up.
After = [ "graphical-session.target" "graphical-session-pre.target" ];
};
Service = {
Type = "oneshot";
# PATH: real notify-send + theme-sync; VM check shims both via PATH.
# NOMARCHY_PATH matches home.sessionVariables so the marker lands
# in the user's flake checkout.
Environment = [
"PATH=${lib.makeBinPath [
pkgs.libnotify
pkgs.nomarchy-theme-sync
pkgs.coreutils
]}"
"NOMARCHY_PATH=%h/.nomarchy"
];
# Brief settle so swaync is accepting toasts (live ISO uses sleep 3).
ExecStartPre = "${pkgs.coreutils}/bin/sleep 2";
ExecStart = "${pkgs.nomarchy-first-boot}/bin/nomarchy-first-boot";
};
Install.WantedBy = [ "graphical-session.target" ];
};
};
}

View File

@@ -364,6 +364,7 @@ in
rofi.enable = lib.mkEnableOption "Nomarchy's themed rofi launcher + the nomarchy-menu dispatcher" // { default = true; };
swaync.enable = lib.mkEnableOption "swaync notifications, themed from the state file" // { default = true; };
batteryNotify.enable = lib.mkEnableOption "low-battery notifications at the bar's thresholds (25% low, 10% critical that one stays up until dismissed); self-gating, a silent no-op on machines without a battery" // { default = true; };
firstBootWelcome.enable = lib.mkEnableOption "one dismissible \"you're set\" toast on the first session (menu/themes/keys + network pointer); marker is settings.firstBootShown in the flake checkout" // { default = true; };
idle.enable = lib.mkEnableOption "hyprlock + hypridle (idle lock, display off, suspend)" // { default = true; };
yazi.enable = lib.mkEnableOption "the yazi TUI file manager, themed with a curated plugin set" // { default = true; };
osd.enable = lib.mkEnableOption "swayosd on-screen display for volume/brightness/mute" // { default = true; };

View File

@@ -70,6 +70,8 @@ let
# name in hyprland.nix — the monitor twin of the keyboard graduation.
# settings.displayProfile / displayProfileAuto: active named layout +
# auto-switch on plug events (hyprland.nix / Display menu).
# settings.firstBootShown: first-session welcome toast gate (#81) —
# written true after the toast fires (nomarchy-first-boot).
# Defaulted so a sparse/older state file still evaluates; nomarchy.settings
# exposes them.
settings = {
@@ -82,6 +84,7 @@ let
autoTimezone = false;
displayProfile = "";
displayProfileAuto = false;
firstBootShown = false;
};
};