Commit Graph

7401 Commits

Author SHA1 Message Date
Austin Horstman
793d075a50 lib/shell: warn on self-referential session variables
Warn when session-variable definitions may change if applied more than
once. Apply the check to home and Zsh session variables without changing
their generated output.

Detect direct references after caller-specific rendering while excluding
stable whole-value expansions. Attribute each warning to the surviving
per-attribute definitions, including their module priorities and wrappers.

This gives users advance notice before later work allows the session
configuration to be applied in new shells. Recommend search-variable
options for path-like values and complete assignments for other values.

Tests cover detector boundaries, Zsh escaping, source attribution, and
both module call sites.
2026-09-30 21:06:23 -05:00
Austin Horstman
b10bf13b9b targets/darwin/terminfo: compose TERMINFO_DIRS
Build TERMINFO_DIRS from home.sessionSearchVariables and
home.sessionSearchVariablesAppend instead of a self-referential
home.sessionVariables value.

On the first merge, place Home Manager's directory first and the
system fallback last. Later merges preserve configured entries already
present in TERMINFO_DIRS. Do not add duplicate configured entries.

Add targets.darwin.terminfo.enable as the explicit opt-out. The prior
home.sessionVariables.TERMINFO_DIRS override now composes with the
module's paths instead of disabling them, so document the new opt-out in
news.

Run zsh test commands with -f because zsh reads .zshenv for -c commands.
This prevents host session markers from bypassing test merges.
2026-09-30 21:06:23 -05:00
Austin Horstman
19e005c9b2 home-environment: add sessionSearchVariablesAppend
Add entries after a PATH-like variable's runtime-inherited value.
`home.sessionSearchVariables` still places entries before that value.

`lib.mkAfter` cannot express this. It orders configured entries relative
to each other, but cannot place an entry after a value inherited at
runtime.

On the first merge in a process tree, configured entries are repositioned
according to prepend or append mode. Later merges preserve existing
positions so intervening environment changes are not reordered. An entry
listed in both options therefore takes append position on the first merge
and retains its inherited position later.

Neither option has an `environment.d` counterpart, so neither reaches
systemd user services. Modules that need that set
`systemd.user.sessionVariables` separately.
2026-09-30 21:06:23 -05:00
Austin Horstman
04d39635a6 home-environment: merge search variables idempotently
Switches `home.sessionPath` and `home.sessionSearchVariables` from
concatenation to the merge helper added in the previous commit. The
first merge preserves configured-first search order while removing
duplicate entries. Later merge blocks preserve inherited positions.

Entries that expand to an empty string are ignored. Statically empty
entries also produce an evaluation warning so an accidental
current-directory entry does not disappear silently.

Fish gets a native merge helper because babelfish rejects the POSIX
helper's quoted pattern removal, and Fish stores names ending in PATH as
lists. Candidate assignments and merge calls are translated together so
references to earlier search variables observe the same values as the
POSIX file. The native helper also preserves newline-bearing values
through Fish command substitutions.

A shared behavioral fixture sources both generated files for first and
later merges. It covers expansion and escaping, cross-variable
references, unset and empty values, duplicates, separator-bearing
entries, empty fields, Fish list shape, helper cleanup, and leading,
embedded, and trailing newlines.

Removes `prependToVar`, which has no consumers left and produced the
self-referential form this replaces. It was public through
`lib.hm.shell`, so the release notes include migration guidance.
2026-09-30 21:06:23 -05:00
Austin Horstman
70f396347a lib/shell: add idempotent search-variable merge primitives
Adds a POSIX `__hm_merge` helper and one `mergeSearchVariables`
generator. The generator owns helper setup, prepend and append calls,
marker export, and cleanup so callers cannot misorder those stages.
Nothing consumes it yet; `prependToVar` is untouched.

Adding an entry that is already present never duplicates it. Whether an
already-present entry may be moved depends on where the merge runs:

- First merge in a process tree, detected by
  `__HM_SESS_VARS_MERGED` being unset: configured entries take their
  configured precedence and existing occurrences are repositioned.
- Any later merge: existing entries keep their position, so re-sourcing
  cannot reorder a path a development shell, direnv, or a wrapper put in
  front.

The complete generator exports the marker after the last merge, then
removes its helper and scratch variables. The marker is deliberately
separate from `__HM_SESS_VARS_SOURCED`, whose position relative to the
merges is not fixed.

Entries expand in a double-quoted shell context. Raw double quotes
remain shell syntax so quoted command substitutions keep working; `\"`
produces a literal quote.

The helper lives in `session-search-merge.sh` rather than a Nix string.
It contains no interpolation, so keeping it as shell source avoids three
layers of escaping and lets shellcheck read it.

Removal is join-based rather than token-splitting. Splitting on the
separator is not idempotent for entries that contain the separator:
merging `a:b` into `x:a:b:y` would grow on every source.

Verified in bash, dash, and zsh across substring entries and globs.
Coverage also includes separator-bearing values, marker transitions,
prepend and append ordering, cleanup, and repeated sourcing.
2026-09-30 21:06:12 -05:00
Austin Horstman
7738360307 xdg/systemDirs: use session search variables
`XDG_CONFIG_DIRS` and `XDG_DATA_DIRS` were self-referential
`home.sessionVariables` values. Declare the shell side through
`home.sessionSearchVariables`, which expands to the same search path.

Order the module entries after existing plain search-variable
contributions. This preserves the previous user, module, then inherited
lookup order. `systemd.user.sessionVariables` is unchanged, so the
`environment.d` output is byte-identical.

Add a news entry covering these two names and `NIX_PATH`. A user value
set through `home.sessionVariables` now becomes the trailing value
instead of colliding with the module definition. The entry also
documents list merging, `lib.mkForce`, and the separate `environment.d`
behavior.
2026-09-30 21:06:12 -05:00
Austin Horstman
dfe8d4a44e nix: declare NIX_PATH as a search variable
`nix.nixPath` with `keepOldNixPath` produced a self-referential
`home.sessionVariables.NIX_PATH`. Declare it through
`home.sessionSearchVariables` instead. The generated value keeps the
same search path without depending on the variable it defines.

Order the module entries with `lib.mkAfter` so existing plain
`home.sessionSearchVariables.NIX_PATH` entries retain their precedence.
2026-09-30 21:06:12 -05:00
Austin Horstman
8db8fb9ce3 lib/shell: handle unset search variables
Read inherited search-variable values through `${VAR-}` so generated
files remain safe when sourced under `set -u`.

Preserve ordinary unset, empty, and inherited values. Add runtime
coverage and update the affected search-variable expectations.
2026-09-30 21:06:12 -05:00
John Rinehart
cf22324a27 files: don't prompt when overwriting a read-only backup
With backupFileExtension and overwriteBackup set, an existing backup is
removed with a plain rm before the colliding file is moved over it.
Backups are often read-only: a file an application wrote over a
Home Manager link usually keeps the link target's mode, 0444 for a store
path. rm asks before removing a write-protected file when its input is
a terminal, so an interactive switch stops at

  rm: remove write-protected regular file '...'?

The backup is being replaced on purpose, so remove it with rm -f.
2026-09-30 13:47:41 -05:00
無名氏
fab715cc65 pi-coding-agent: add appendSystem option
Allow configuring APPEND_SYSTEM.md with inline instructions or a file path, following the context option and respecting configDir.
2026-09-30 13:16:34 -05:00
Zexin Yuan
603fbca129 worktrunk: fix skills path after installAgentSkills migration
nixpkgs#558216 switched the worktrunk package to the installAgentSkills
hook, moving the bundled skills from $out/skills/ to
$out/share/skills/worktrunk/.

Assisted-by: Claude-Code:GLM-5.3
Co-authored-by: Austin Horstman <khaneliman12@gmail.com>
2026-09-30 13:15:22 -05:00
Clément DOUIN
7c0c726efe himalaya: bring v2 support 2026-09-30 13:08:34 -05:00
home-manager-ci[bot]
bf9c5ff370 maintainers: update all-maintainers.nix
Automated update of the master maintainers list combining:
- Home Manager specific maintainers from modules/lib/maintainers.nix
- Nixpkgs maintainers referenced in Home Manager modules

**Added:** 1 maintainers
**Removed:** 0 maintainers
**Total:** 319 → 320 maintainers

**✅ Added:** o-az

Generated by: lib/python/generate-all-maintainers.py
2026-09-30 13:05:08 -05:00
o-az
b75a0703c9 fnox: add module 2026-09-30 16:47:55 +02:00
o-az
f0807df654 maintainers: add o-az 2026-09-30 16:47:55 +02:00
Austin Horstman
bf3f7a120d astroid: migrate to native JSON settings
Add programs.astroid.settings for native JSON configuration and
generate the configuration file from it.

The extraConfig and externalEditor options become deprecated aliases
into settings. Home Manager no longer writes its bundled template;
Astroid's built-in defaults match it except editor.markdown_processor.
Astroid accounts still supply account settings, the notmuch path, and
the GPG path as per-key defaults. Empty settings write no file.

externalEditor now merges at ordinary priority instead of replacing
the editor keys, and priorities on extraConfig sections apply to the
section as a unit. The release notes describe both changes.
2026-09-30 08:40:10 -05:00
Austin Horstman
d4941d9c8d notmuch: migrate to native INI settings
Add programs.notmuch.settings for native INI configuration with list
values, and generate the configuration file from it.

The new.ignore, new.tags, maildir.synchronizeFlags, search.excludeTags,
and extraConfig options become deprecated aliases into settings.
Settings carry no static defaults: new.tags, new.ignore, and
maildir.synchronize_flags fall back to notmuch's identical defaults.
State versions before 26.11 keep search.exclude_tags = deleted;spam and
write database.path even without email accounts. Enabled email
accounts supply database.path, and notmuch-enabled accounts the user
identity. Null values and empty sections are omitted so a derived
value can be removed.

extraConfig no longer overwrites modeled values unconditionally: forced
definitions win and ordinary collisions fail. The release notes
describe the migration.

Mbsync, lieer, and mujmap now write settings.new.ignore directly, so
they do not trigger deprecation warnings.
2026-09-30 08:23:14 -05:00
Austin Horstman
7d46509d83 borgmatic: migrate backups to native settings
Add programs.borgmatic.backups.<name>.settings for native borgmatic
YAML and generate each backup file from it.

The location, storage, retention, and consistency options and the
section extraConfig options become deprecated aliases into settings.
Warnings name the affected backup. Legacy configurations without
overlapping keys produce the same YAML, and Home Manager symlink
exclusions still append to exclude_from.

Drop the assertions that rejected backups setting both or neither of
sourceDirectories and patterns, so native source patterns and
database-only backups work.
2026-09-30 07:59:27 -05:00
Austin Horstman
31830be4fc borgmatic: omit unspecified check frequency
Consistency checks without a frequency were written as
`frequency: null`, which borgmatic rejects during configuration
validation. Omit null check fields so borgmatic applies its own
default.
2026-09-30 07:59:27 -05:00
dependabot[bot]
0aefa652eb flake: bump nixpkgs from a32edd7 to 7d5589b
Bumps [nixpkgs](https://github.com/NixOS/nixpkgs) from `a32edd7` to `7d5589b`.
- [Commits](https://github.com/NixOS/nixpkgs/commits)

---
updated-dependencies:
- dependency-name: nixpkgs
  dependency-version: 7d5589bbf421c7b6f4185371abe3c465b1b557e9
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-29 23:23:50 -05:00
Austin Horstman
c421f4751f nixos: pass driver version to user service
The user-service drop-in invoked activate without a driver version, so
the script defaulted to driver 0 and always managed the per-user
home-manager profile, ignoring enableLegacyProfileManagement. Use the
same version as the system service and assert both generated
user-service commands.
2026-09-29 22:51:37 -05:00
ash
b0d0106ef6 difftastic: fix terminal width detection in jujutsu integration 2026-09-29 19:04:11 -05:00
home-manager-ci[bot]
7b4c5ec4be maintainers: update all-maintainers.nix
Automated update of the master maintainers list combining:
- Home Manager specific maintainers from modules/lib/maintainers.nix
- Nixpkgs maintainers referenced in Home Manager modules

**Added:** 1 maintainers
**Removed:** 0 maintainers
**Total:** 318 → 319 maintainers

**✅ Added:** nyxar77

Generated by: lib/python/generate-all-maintainers.py
2026-09-25 14:51:25 -05:00
Austin Horstman
6fa0edfe6a zellij: update the plugins example
zellijPlugins.vim-plugins-navigator does not exist; the plugin is
zellijPlugins.vim-zellij-navigator.
2026-09-25 13:02:11 -05:00
Austin Horstman
749b1f4a29 neovim: update the plugins example
vimPlugins.yankring is an alias; the plugin is vimPlugins.YankRing-vim.
2026-09-25 13:02:11 -05:00
Austin Horstman
afe5a94001 vim: update the plugins example
vimPlugins.YankRing does not exist; the plugin is
vimPlugins.YankRing-vim.
2026-09-25 13:02:11 -05:00
Austin Horstman
7957a803d3 thunderbird: update the package example
thunderbird-91 no longer exists; use thunderbird-esr.
2026-09-25 13:02:11 -05:00
Austin Horstman
7337e62937 bspwm: drop the package example
The example pointed at pkgs.bspwm-unstable, which does not exist.
2026-09-25 13:02:11 -05:00
Austin Horstman
a431cbf6bd emacs: update the package example
emacs25-nox no longer exists; use emacs-nox.
2026-09-25 13:02:11 -05:00
Austin Horstman
7f8da23ceb offlineimap: update the package example
python3Packages.requests_oauthlib was removed and python3Packages.gpgme
is an alias; the packages are requests-oauthlib and gpg. The example
also extended old.propagatedBuildInputs, which the package does not
set because it lists its Python dependencies in dependencies, so it
failed to evaluate. Extend old.dependencies instead.
2026-09-25 13:02:11 -05:00
Austin Horstman
563b616d79 gnome-shell: update the theme examples
plata-theme was removed from nixpkgs. Use orchis-theme, which ships
share/themes/Orchis/gnome-shell.
2026-09-25 13:02:11 -05:00
Austin Horstman
18ffa3c0db kdeconnect: drop the plasma5 package example
The example pointed at pkgs.plasma5Packages.kdeconnect-kde, which no
longer exists; the default is already pkgs.kdePackages.kdeconnect-kde.
2026-09-25 13:02:11 -05:00
Austin Horstman
c11a84c495 pidgin: update the plugins example
The pidgin plugins moved into pkgs.pidginPackages.
2026-09-25 13:02:11 -05:00
Austin Horstman
77beb2db84 borgmatic: update the encryptionPasscommand example
pkgs.password-store does not exist; the password-store package is
pkgs.pass.
2026-09-25 13:02:11 -05:00
Austin Horstman
8a08680362 firefox: update the okular handler example
pkgs.okular no longer exists at the top level; the package is
pkgs.kdePackages.okular.
2026-09-25 13:02:11 -05:00
Austin Horstman
41d87d0517 pipewire: update the extraLadspaPackages example
pkgs.noisetorch-ladspa does not exist in nixpkgs. rnnoise-plugin
provides a LADSPA noise suppression plugin under lib/ladspa.
2026-09-25 13:02:11 -05:00
Austin Horstman
f9d4ef7e2a helix: update the languages example
The example took typescript-language-server and typescript from
pkgs.nodePackages, which nixpkgs removed, and passed --tsserver-path,
which typescript-language-server 5.3.0 rejects as an unknown option,
so the server exited at startup. Run the top-level
typescript-language-server with --stdio only; the nixpkgs package
already falls back to the tsserver from typescript_5.
2026-09-25 13:02:11 -05:00
Austin Horstman
10b06e1fca lorri: update the nixPackage example
nixVersions.unstable was removed; use nixVersions.latest.
2026-09-25 13:02:11 -05:00
Austin Horstman
ecca7fc52e mpv: update the package example
pkgs.mpv-unwrapped.wrapper no longer exists. Show the same build through
pkgs.mpv.override, which evaluates against current nixpkgs.
2026-09-25 13:02:11 -05:00
Austin Horstman
7e613901a7 kakoune: update the plugins example
kakounePlugins.kak-fzf is an alias; the plugin is kakounePlugins.fzf-kak.
2026-09-25 13:02:11 -05:00
Austin Horstman
b5199e1094 jetbrains-remote: update the ides example
jetbrains.pycharm-professional was renamed to jetbrains.pycharm.
2026-09-25 13:02:11 -05:00
Austin Horstman
9e2ecc795e xmonad: update the haskellPackages example
pkgs.haskell.packages.ghc784 no longer exists. Show ghc912: the option
is for building xmonad with a different GHC, and the default package
set already uses GHC 9.10.
2026-09-25 13:02:11 -05:00
Austin Horstman
5a1b841d8d gradle: update the package example
nixpkgs removed gradle_7. The default gradle is already gradle_8, so
show gradle_9 as the example of picking another version.
2026-09-25 13:02:11 -05:00
Austin Horstman
190387403f gpg: update the package example
nixpkgs no longer has gnupg23; use gnupg24 as the example instead.
2026-09-25 13:02:11 -05:00
Austin Horstman
d57552fd65 gtk: update the theme package examples
pkgs.gnome.gnome-themes-extra is a removed alias; the package is now
pkgs.gnome-themes-extra.
2026-09-25 13:02:11 -05:00
Austin Horstman
5880337093 xdg-portal: update the configPackages example
pkgs.gnome.gnome-session is a removed alias; the package is now
pkgs.gnome-session.
2026-09-25 13:02:11 -05:00
Austin Horstman
0ddbfb5dc0 rbw: suggest gcr_3 for pinentry-gnome3
The pinentry description told users to add pkgs.gcr to
services.dbus.packages, but nixpkgs removed it. Suggest pkgs.gcr_3,
which NixOS uses for pinentry-gnome3.
2026-09-25 13:02:11 -05:00
Austin Horstman
d762b6e272 gpg-agent: suggest gcr_3 for pinentry-gnome3
The pinentry description told users to add pkgs.gcr, which nixpkgs
removed. NixOS uses pkgs.gcr_3 for pinentry-gnome3, so suggest that.
2026-09-25 13:02:11 -05:00
Austin Horstman
5023607510 mpd-mpris: accept strings and paths for pwd-file
pwd-file was typed as a path, but ExecStart renders settings through
lib.cli.toCommandLine, whose default value formatter has no case for
paths, so a path literal such as ./mpd-password aborted evaluation with
"generators.mkValueStringDefault: this value is not supported".

Accept a string or a path, and render path-like values with toString,
which gives a path literal's location without copying the file into the
Nix store. Strings and derivations render as before. Add a test for a
path literal.
2026-09-25 13:01:17 -05:00
Austin Horstman
c5a75f0f75 mpd-mpris: use the settings rename helper
The network, host, and port migrations from services.mpd-mpris.mpd to
services.mpd-mpris.settings share the same prefixes and option names,
so lib.hm.deprecations.mkSettingsRenamedOptionModules expresses them
without repeating each option path. It expands to the same
mkRenamedOptionModule calls.

Add a test that sets the old options and checks the rename warnings and
the generated unit, which no existing test covered.
2026-09-25 13:01:17 -05:00