Skip to content

Conversation

phip1611
Copy link

@phip1611 phip1611 commented Jun 27, 2025

Description

This adds the ZSH options INC_APPEND_HISTORY and
INC_APPEND_HISTORY_TIME.

Checklist

  • Change is backwards compatible.

  • Code formatted with nix fmt or
    nix-shell -p treefmt nixfmt-rfc-style keep-sorted --run treefmt.

  • Code tested through nix-shell --pure tests -A run.all
    or nix build --reference-lock-file flake.lock ./tests#test-all using Flakes.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.

Maintainer CC

Makes it easier to keep the overview as new options
are added.
This adds the ZSH options `INC_APPEND_HISTORY` and
`INC_APPEND_HISTORY_TIME`.
@phip1611
Copy link
Author

Rebased. Are we good to go now, @teto @khaneliman?

@khaneliman
Copy link
Collaborator

Just not a fan of this option set in the current form. It is too verbose and maintenance heavy to keep adding a new option for each possible setopt and unsetopt. We currently have setOptions available to do the same thing.

Seems more like we should deprecate these options and encourage usage of that setOptions option? Or is this something that needs to be set in a specific location in the file?

@phip1611
Copy link
Author

phip1611 commented Aug 27, 2025

I agree that this is verbose. I wasn't aware of setOptions. Should be sufficient!

Personally, my favorite form would be something like:

setOptions = 
          lib.mapAttrsToList (name: enabled: if enabled then name else "NO_${name}") {
            APPEND_HISTORY = false;
            EXTENDED_HISTORY = true;
            HIST_EXPIRE_DUPS_FIRST = false;
            HIST_FCNTL_LOCK = true;
            HIST_FIND_NO_DUPS = false;
            HIST_IGNORE_ALL_DUPS = false;
            HIST_IGNORE_DUPS = true;
            HIST_IGNORE_SPACE = true;
            HIST_SAVE_NO_DUPS = false;
            INC_APPEND_HISTORY = true;
            SHARE_HISTORY = false;
          };

This helps to keep alphabetical sorting. But the current setOptions is also fine.

phip1611 added a commit to phip1611/nixos-configs that referenced this pull request Aug 27, 2025
phip1611 added a commit to phip1611/nixos-configs that referenced this pull request Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants