Commit Graph

1553 Commits

Author SHA1 Message Date
Austin Horstman
6ed09becc7 programs/bash: refresh session variables in interactive shells
Interactive non-login Bash shells now apply the current session
variables file before bashrcExtra and initExtra. New terminals pick up
values changed by home-manager switch.

Login shells skip the refresh because .profile already applied it.
Non-interactive shells skip it because sshd can read .bashrc for remote
commands, where startup output can corrupt protocols such as scp and
rsync.

Apply programs.bash.sessionVariables after generic values to preserve
its precedence. Expansions run on every interactive non-login shell, so
warn when direct self-references can change repeatedly. Declarative
search paths remain stable across repeated sourcing.

A profileExtra assignment that collides with a Home Manager-managed
variable is now overwritten in non-login shells. Move such overrides to
initExtra, which runs after the refresh.

targets.genericLinux no longer needs its separate initExtra source.
2026-09-30 21:06:23 -05:00
Austin Horstman
1553bea9ff home-environment: refresh session vars in shells
Move the once-per-session guard to the final extra-code section. Plain
and search variables can then refresh without rerunning arbitrary code.
Keep the extra body top-level so shell parse behavior stays unchanged.

Use an exported generation token for Zsh. Changes to generic or
Zsh-specific values reapply both layers, while unchanged nested shells
keep Zsh precedence and do not repeat self-references.

Plain values are re-evaluated each time the file is applied. Command
substitutions run again, and some self-references can change repeatedly.
Removing a variable still requires a new session.

Closes #3999
Closes #4559
2026-09-30 21:06:23 -05:00
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
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
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
無名氏
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
o-az
b75a0703c9 fnox: add module 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
Austin Horstman
e9796a288e lib/deprecations: name exact settings destinations
Forward converted values to the complete settings path so the standard
changed-option warning identifies the destination key. Preserve legacy
reads, priorities, defaults, and shadowed conversions.

Point mpdris2 at Library.music_dir directly and cover nested paths,
literal dotted keys, and the affected callers in warning tests. The
contributor guidelines now describe `to` as the settings path that
contains `key` instead of the settings root.
2026-09-23 22:37:57 -05:00
Austin Horstman
a5768f1a46 jjui: test configuration discovery and directory overrides
Cover session-variable omission for automatic paths and preservation for
custom paths and Darwin Lua-only configurations.
2026-09-22 16:00:21 -05:00
nyxar77
a3dfb887d4 ninjabrain-bot: init module
adds programs.ninjabrain-bot, this module writes ninjabrainbot '’s Java preferences file from typed nix options
2026-09-21 15:16:33 -05:00
Austin Horstman
a6c231d51f getmail: omit unspecified mailbox settings
Allow native POP3 retrievers without an IMAP mailbox list. Preserve
explicit mailbox defaults and cover the omitted setting in the account
configuration test.
2026-09-21 12:08:57 -05:00
Austin Horstman
0a2d091b2c getmail: add per-account INI settings
Expose native filter, retriever, and destination configuration while
retaining account defaults and legacy boolean aliases. Preserve tuple
rendering and allow complete native retriever configuration without an
IMAP account block.
2026-09-21 12:08:57 -05:00
Austin Horstman
fae3c75896 joplin-desktop: skip empty configuration writes
Leave application-owned settings untouched when no effective settings
are configured. Keep activation merging for canonical and legacy values.
2026-09-21 09:53:13 -05:00
Austin Horstman
a3a247c583 joplin-desktop: use freeform JSON settings
Generate managed JSON from canonical settings while preserving legacy editor and sync conversions. Use the shared overlay helper for extraConfig priorities and effective-key detection.

Keep activation-time merging into the writable application file, including unmanaged settings and historical null and empty-string filtering.
2026-09-21 09:53:13 -05:00
Santhosh Raju
a26f7158fb yopass: add module
Adds programs.yopass for managing the yopass CLI configuration file
(~/.config/yopass/defaults.yml), with an NMT test verifying the
generated settings.

Assisted-by: Claude Fable 5
2026-09-21 10:07:57 +02:00
Rachit Kumar Verma
4ac5a2ae90 module/impala: TUI for managing wifi on Linux
impala v0.9.0 introduces a configuration file to configure impala.
2026-09-17 20:31:15 -05:00
Utkarsh Gupta
9d485f74cd fish: don't set man.generateCaches default = true if man.package == null 2026-09-17 22:20:41 +02:00
Austin Horstman
ac84366d68 rofi: generate configuration only when configured
Leave native defaults to Rofi instead of injecting location and offset
values. Preserve explicit legacy settings and theme selection, and omit
configuration files when no effective settings or theme are supplied.
2026-09-16 22:06:20 -05:00
Austin Horstman
452bb68b8a rofi: use freeform configuration settings
Generate the Rasi configuration block from merged native settings. Preserve legacy option conversions, overlay precedence, numeric defaults, and theme ordering.

Use the shared settings overlay helper for extraConfig forwarding and key detection. Keep package integration and the existing serializer unchanged.
2026-09-16 22:06:20 -05:00
Austin Horstman
efa3ccb4c3 openstackclient: expose whole-file settings
The old cloud-only mappings cannot express root-level cache and client
settings. Expose complete YAML documents while preserving existing
configurations through standard rename aliases.
2026-09-15 09:27:35 -05:00
Drew Davis
7e3645c737 pnpm: init 2026-09-13 10:01:07 -05:00
Zexin Yuan
937d0571b0 worktrunk: add shell and Claude Code integrations
Build on the existing programs.worktrunk module:

- add bash/zsh/fish/nushell shell integrations, enabled by default via
  the corresponding home.shell.enable<SHELL>Integration options,
- add an opt-in programs.worktrunk.claudeCodeIntegration, which wires
  worktrunk into programs.claude-code: a statusLine, WorktreeCreate/
  WorktreeRemove hooks (so agent isolation routes through wt), activity
  state-marker hooks (🤖/💬 in wt list), and skills. Of the skills,
  /wt-switch-create is on by default while /worktrunk is off by default,
  since settings already manages the config it would help edit.

Both integrations need the wt binary, so they are inert when package is
set to null.

Follow-up to #9226, recreating the integration part of #9788.

Assisted-by: Claude-Code:GLM-5.3
2026-09-12 23:01:51 -05:00
Farid Zakaria
2ba72d0237 b4: add module
b4 (https://b4.docs.kernel.org) is a tool for kernel-style patch and
email review workflows on lore.kernel.org. The module installs b4 and
writes its configuration to git-config's [b4] section -- b4 has no
config file of its own -- defaulting to a recommended Claude Code
review-agent wiring.

The review-editor highlighting and agent-reviewer prompt b4 ships under
misc/ are missing from its PyPI sdist; the module pulls them from the
nixpkgs packages added in NixOS/nixpkgs#543347 rather than fetching the
b4 repository itself.

Assisted-By: Claude Opus 4.8 (1M context)
2026-09-12 22:36:06 -05:00
Austin Horstman
02618d94f8 nh: use systemd escaping for cleanup argument lists
Use the shared helper to preserve argument boundaries in ExecStart, including embedded newlines. Keep legacy strings and Darwin behavior unchanged, and cover the newline case in a Linux regression test.
2026-09-12 22:02:25 -05:00
OddMagnet
d3c99311d7 nh: accept a list for clean.extraArgs
Splitting the string on spaces broke arguments that legitimately contain
one, such as `--keep-since=1 day`. Accept a list of strings alongside the
string instead, each element being one argument, and restore the previous
behaviour for strings on both platforms: command line text that systemd
splits on Linux, a single argument on Darwin.

Darwin users passing several flags in one string have to switch to a list
to work around the launchd quoting.

On Linux the arguments are only appended when non-empty, which drops a
trailing space from ExecStart.
2026-09-12 22:02:25 -05:00
OddMagnet
3e05f1d3cd nh: split clean.extraArgs into separate launchd arguments
On darwin, clean.extraArgs was appended to ProgramArguments as a single
list element, so the launchd module rendered it as one shell-quoted word
and nh received every flag as a single argument:

  nh clean user '--keep 5 --keep-since 3d'
  error: unexpected argument '--keep 5 --keep-since 3d' found

Linux is unaffected: there extraArgs is interpolated into ExecStart as
text, and systemd splits that into arguments itself. Split on spaces so
both platforms treat the option the same way, dropping empty fields so
that an unset or space-padded value contributes no arguments.

The existing darwin test never set extraArgs, which is why this went
unnoticed. Add a case covering the option's own documented example.
2026-09-12 22:02:25 -05:00
Austin Horstman
4b14cf08ff firefox: use default paths in package identity test
The Nixpkgs wrapper now applies appDataDir, so a custom configPath
changes the Firefox and Floorp derivations. Test package identity with
each browser default and leave custom paths to the config-path tests.
2026-09-11 22:23:22 -05:00
Austin Horstman
f06a5c6838 rofi-pass: remove module
Nixpkgs removed rofi-pass because it is unmaintained upstream.
Report the removal through an explicit option assertion and news entry.
2026-09-11 22:23:22 -05:00
Aly Raffauf
cd0e747f6a vscode: add mutable user settings 2026-09-11 21:08:12 -05:00
Malix - Alix Brunet
61b08afca3 direnv: git.ignores drop .envrc 2026-09-11 11:27:55 -05:00
Vinicius Deolindo
d0fd95e15e moor: init 2026-09-11 09:27:35 -05:00
Ihar Hrachyshka
c41f8b81d1 firefox: set non-default configPath on darwin
On macOS 27+, wrapped package will have no Mozilla signature and will
fail to access the default datadir. Move users with recent stateVersion
to a non-default datadir recommended by:

https://github.com/NixOS/nixpkgs/pull/556611

Users with existing profiles under default datadir will have to migrate
them to a different location on macOS 27 upgrade. Migrating existing
directory is out of scope for Home Manager.
2026-09-10 22:57:58 -05:00
Ihar Hrachyshka
922a645e84 firefox: apply configPath to package wrapper
This is a counterpart for: https://github.com/NixOS/nixpkgs/pull/556611

When configPath is overridden, if wrapper supports the new appDataDir
argument, we pass configPath's absolute form to tell the app to look for
its datadir in the correct directory.

This will become necessary on macOS 27+ where Firefox that is not signed
by Mozilla has no access to its default datadir.
2026-09-10 22:57:58 -05:00
Austin Horstman
150f9ce4dd qcal: add freeform settings
Expose qcal's JSON configuration through programs.qcal.settings and
per-calendar entries through accounts.calendar.accounts.<name>.qcal.settings.
Generated Calendars entries and the account remote projections use
mkDefault so users can override or extend them. timezone and
defaultNumDays become renamed aliases of the settings keys.
2026-09-10 15:21:46 -05:00
eveeifyeve
df044b78fd worktrunk: add module
Co-authored-by: Willi Carlsen <carlsenwilli@gmail.com>
Co-authored-by: Robert Helgesson <robert@rycee.net>
2026-09-09 23:02:07 -05:00
Austin Horstman
448c15a7fe radio-active: wrap executables for player lookup
Custom packages can expose overrideAttrs without running patch hooks.
Provide mpv and vlc through runtime wrappers instead, covering both
upstream entry points and custom executable names. Test player lookup,
PATH precedence, and inherited helpers with executable fixtures.
2026-09-09 16:22:45 -05:00
Austin Horstman
a8f6b014a4 radio-active: honor package and settings options
Use the configured package for installation and player-specific patching, while preserving configuration generation when package is null. Generate any declared INI section and correct the settings example to match the nested section type.
2026-09-09 16:22:45 -05:00
repparw
9c997ea660 opencode: preserve service PATH 2026-09-09 15:50:58 -05:00
repparw
0b8d588fc2 opencode: set PATH for web service
Set PATH=${config.home.profileDirectory}/bin in the opencode-web
systemd service and launchd agent environment. This gives the service
access to packages installed via Home Manager.
2026-09-09 15:50:58 -05:00
Malix - Alix Brunet
9bdbf42351 direnv: add enableGitIntegration option
Allows automatically adding .envrc and .direnv/ to
programs.git.ignores when enabled.
2026-09-09 15:23:06 -05:00
Antonio Spadaro
2c0350c759 firefoxpwa: add test for non-PWA websites 2026-09-05 18:46:00 -05:00
mikaeladev
a49f50d595 gram: add module 2026-09-05 18:29:19 -05:00
David Sánchez
4c57ede073 omniwm: add module 2026-09-05 16:31:52 -05:00