Files
Nomarchy/core/home/configs.nix
Bernardo Magri 0fbc3d9c82
All checks were successful
Check / eval-and-lint (push) Successful in 6m40s
fix: ground + fix three Pillar-9 candidate bugs from the script sweep
All three confirmed real on inspection.

1. nomarchy-refresh-config was dead on every system: it read
   /etc/nixos/nomarchy/{core/home/config,features} (the source tree never
   lands there — only /etc/nomarchy on VM-guest/live ISO) and fell back to
   ~/.local/share/nomarchy/config, which nothing deployed despite SKILL.md
   documenting it. Deploy the pristine core/home/config tree to
   ~/.local/share/nomarchy/config via xdg.dataFile and read from there, so it
   works without a source checkout; its live caller nomarchy-refresh-fastfetch
   now succeeds. Fix two stale SKILL.md examples (waybar/, hypr/) that pointed
   at non-existent stock paths.

2. nomarchy-docs-scripts shipped a stale divergent copy in
   features/scripts/utils/ (in the user nomarchy-system-scripts package)
   beside the canonical bin/utils dev tool — it errored outside the repo.
   Grounding it surfaced the identical bug in nomarchy-docs-keybindings.
   Delete both duplicates, add them to the generator's self-reference
   denylist so they don't show as false `missing`, regenerate docs/SCRIPTS.md.

3. Home ~/.config/nomarchy/state.json was never seeded on non-installer
   systems, so nomarchy-installed-summary rendered "—" for theme/font/panel.
   Add an idempotent home-manager activation seed in core/home/state.nix that
   backfills the resolved values (defaults * existing — user choices and
   runtime-only keys like welcome_done always win).

Verified: flake check + full eval matrix clean; refresh-config happy/error
paths and the seed deep-merge proven by hand.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 14:25:02 +01:00

107 lines
3.4 KiB
Nix

{ config, pkgs, lib, ... }:
let
configDir = ./config;
# Explicit list of config items to manage
# This replaces dynamic builtins.readDir for clarity and faster evaluation
configItems = {
# Directories
fastfetch = "directory";
fcitx5 = "directory";
fontconfig = "directory";
git = "directory";
imv = "directory";
"nautilus-python" = "directory";
nomarchy = "directory";
"nomarchy-skill" = "directory";
uwsm = "directory";
wiremix = "directory";
# Files
"brave-flags.conf" = "regular";
"chromium-flags.conf" = "regular";
"starship.toml" = "regular";
"xdg-terminals.list" = "regular";
};
# Files/directories handled elsewhere or not intended for ~/.config/
# - nomarchy.ttf: font file, not a config
# - waybar: handled in waybar.nix
# - walker: handled in walker.nix
# - alacritty: handled in alacritty.nix
# - swayosd: handled in swayosd.nix
# Check for user overrides
userConfigDir = config.nomarchy.configOverrides;
# Generate the xdg.configFile attribute set
makeMapping = name: type:
let
source = if userConfigDir != null then "${userConfigDir}/${name}" else "${configDir}/${name}";
in {
inherit name;
value = lib.mkDefault {
inherit source;
recursive = type == "directory";
};
};
configMappings = lib.mapAttrs' (name: type: makeMapping name type) configItems;
in
{
xdg.configFile = configMappings // {
# mako reads ~/.config/mako/config by default. The themed Nomarchy
# config (urgency rules, app filters, button handlers) lives under
# nomarchy/default/mako/core.ini for organizational reasons, so wire
# it explicitly here. Without this, mako silently falls back to its
# built-in defaults and every Nomarchy notification customization is
# inert.
"mako/config".source = lib.mkDefault ./config/nomarchy/default/mako/core.ini;
# Hyprland's native-Wayland input config — templated from
# nomarchy.keymap.{layout,variant} so non-US users get the right
# layout in Wayland apps. The previous static input.conf hardcoded
# `kb_layout = us`, so the installer's xkb.layout / console.keyMap
# writes only reached XWayland and the TTY. Generated here rather
# than shipped under config/nomarchy/default/hypr/ so the keymap
# values can vary per-host without a source-file edit.
"nomarchy/default/hypr/input.conf".text = lib.mkDefault ''
# https://wiki.hyprland.org/Configuring/Variables/#input
input {
kb_layout = ${config.nomarchy.keymap.layout}
kb_variant = ${config.nomarchy.keymap.variant}
kb_model =
kb_options = compose:caps
kb_rules =
follow_mouse = 1
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
touchpad {
natural_scroll = false
}
}
misc {
key_press_enables_dpms = true # key press will trigger wake
mouse_move_enables_dpms = true # mouse move will trigger wake
}
'';
};
home.file.".XCompose" = lib.mkDefault {
source = ./config/nomarchy/default/xcompose;
};
# Pristine copy of the stock configs, kept out of ~/.config so a user edit
# never touches it. `nomarchy-refresh-config` restores a file in ~/.config
# from here, and SKILL.md points users at it to diff against defaults.
xdg.dataFile."nomarchy/config".source = builtins.path {
name = "nomarchy-config";
path = ./config;
};
}