diff --git a/docs/MIGRATION.md b/docs/MIGRATION.md index b3ceb35..5d68162 100644 --- a/docs/MIGRATION.md +++ b/docs/MIGRATION.md @@ -210,7 +210,7 @@ and it's whichever has higher Nix priority. Fix these explicitly: | Graphics | `hardware.graphics.enable = true` (was `hardware.opengl`) | Probably already enabled — fine | | User groups | needs `video render networkmanager` | Add to your `users.users..extraGroups` | | `/etc/os-release` | `ID=nomarchy`, `NAME=Nomarchy` | A few third-party scripts grep `ID=nixos` — adjust them or rely on `ID_LIKE` (TBD) | -| autoLogin | `enable = true; user = "nomarchy";` (mkDefault) | Override with `services.displayManager.autoLogin.user = ""` or disable | +| autoLogin | `enable = false; user = "nomarchy";` (mkDefault) | Off by default — opt in with `services.displayManager.autoLogin = { enable = true; user = ""; };` if you want it | Impermanence is **off** unless you set `nomarchy.system.impermanence.enable = true`, and it requires a BTRFS layout with a `root-blank` snapshot. Don't enable it diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 3f1187a..153a608 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -40,6 +40,7 @@ Guardrails (apply when adding anything): - **Forgejo release pipeline.** `vYY.MM.x` tags matching the upstream NixOS channel; the pipeline pushes the three ISOs and an updated `flake.lock` snapshot. - **Optional `nomarchy-installer-vm`** rebuilt as a real flake app (not a one-off shell script) so users can install Nomarchy into a libvirt VM declaratively. - **Surface support module** via the relevant `nixos-hardware` profile + Surface kernel patches behind a `nomarchy.hardware.isSurface` toggle. +- **Consolidate palette imports in `flake.nix` via `nomarchyLib`.** `flake.nix:79-80` re-imports `./themes/palettes` and recomputes `themeNames` even though `lib/default.nix` already exports both. Two computations, same result today — drift risk tomorrow. Import `nomarchyLib = import ./lib { inherit lib; }` once and use `nomarchyLib.{palettes,themeNames}` to make `lib/default.nix` the single source of truth for the theme list. ## 3. Pillar: Script & menu audit diff --git a/features/scripts/utils/nomarchy-welcome b/features/scripts/utils/nomarchy-welcome index 4ce78f6..bf30367 100755 --- a/features/scripts/utils/nomarchy-welcome +++ b/features/scripts/utils/nomarchy-welcome @@ -59,39 +59,9 @@ if [[ "$USER" == "nixos" ]]; then exit 0 fi -# 4. Starter home.nix +# 4. Setup Local Repo (Crucial for nomarchy-env-update to work) echo "" -echo "Step 4: Starter home.nix" -HOME_NIX="$HOME/.config/home-manager/home.nix" -if [ ! -f "$HOME_NIX" ]; then - echo "It looks like you don't have a ~/.config/home-manager/home.nix file yet." - echo "Nomarchy uses this file to manage your user-level packages and settings." - if gum confirm "Would you like to generate a starter home.nix?"; then - mkdir -p "$(dirname "$HOME_NIX")" - cat < "$HOME_NIX" -{ pkgs, ... }: -{ - # Nomarchy starter home.nix - # Add your user packages here. - home.packages = with pkgs; [ - btop - fastfetch - chromium - # Add more packages here - ]; - - # home.stateVersion = "25.11"; # Consult docs/MIGRATION.md if you change this -} -EOF - echo "Starter home.nix generated at $HOME_NIX" - fi -else - echo "Detected existing home.nix at $HOME_NIX. Skipping generation." -fi - -# 5. Setup Local Repo (Crucial for nomarchy-env-update to work) -echo "" -echo "Step 5: Git Repository Check" +echo "Step 4: Git Repository Check" echo "Nomarchy relies on a local git repository for declarative updates." if [ ! -d "/etc/nixos/.git" ]; then echo "Warning: /etc/nixos is not a git repository. Declarative updates might fail." @@ -102,7 +72,7 @@ if [ ! -d "/etc/nixos/.git" ]; then fi fi -# 6. Success +# 5. Success echo "" echo "Applying all changes..." nomarchy-env-update diff --git a/lib/default.nix b/lib/default.nix index 18c2feb..a90b941 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -98,7 +98,6 @@ let in { inherit palettes - readState readHomeState readSystemState resolveWallpaper diff --git a/lib/state-schema.nix b/lib/state-schema.nix index bc98b87..50bb2d5 100644 --- a/lib/state-schema.nix +++ b/lib/state-schema.nix @@ -1,5 +1,13 @@ # Nomarchy State Schema -# Defines the complete state shape with defaults for both home and system state +# +# Defines the default values for every state.json field that's consumed by a +# Nix option. Read by core/{system,home}/options.nix (for `default = …`) and +# by core/{system,home}/state.nix (for `or` fallbacks). +# +# state.json may also hold runtime-only fields that aren't declared here — +# notably `welcome_done`, managed by `nomarchy-welcome`. Those are intentionally +# off-schema because no Nix option reads them; the schema is the "consumed by +# Nix" surface, not the full state.json shape. { lib }: { @@ -54,14 +62,4 @@ }; }; - # Get a value from state with fallback to default - getWithDefault = state: path: default: - let - pathList = lib.splitString "." path; - getValue = obj: remaining: - if remaining == [] then obj - else if builtins.isAttrs obj && builtins.hasAttr (builtins.head remaining) obj - then getValue obj.${builtins.head remaining} (builtins.tail remaining) - else default; - in getValue state pathList; } diff --git a/themes/engine/sddm.nix b/themes/engine/sddm.nix index 6e0e851..eb57ce7 100644 --- a/themes/engine/sddm.nix +++ b/themes/engine/sddm.nix @@ -27,8 +27,12 @@ in services.displayManager.defaultSession = lib.mkDefault "hyprland-uwsm"; + # autoLogin defaults off so hand-migrated configs (no installer-written + # username) don't try to log in as a nonexistent "nomarchy" user. The + # installer-generated system.nix sets both `enable = true;` and + # `user = "$USERNAME";` at normal priority, overriding these defaults. services.displayManager.autoLogin = { - enable = lib.mkDefault true; + enable = lib.mkDefault false; user = lib.mkDefault "nomarchy"; };