Skip to content

Consider deprecating function names shadowing upstream #607

@bbenne10

Description

@bbenne10

We not infrequently see users confused about which implementation of use nix and use flake they're actually using. This is a solvable problem: We simply need to stop shadowing the names provided by direnv itself. Direnv authors have mentioned directly that this sort of behavior has undesirable effects upstream as well.

I will propose use_cached_flake and use_cached_nix as the new names and something like a year long deprecation period. First: We soft deprecate the names, pointing users at the new function names by way of a warning when invoking the old names, like so:

function use_cached_flake () {
  # all the things we do now
}

function use_flake () {
  _nix_direnv_warning "use_flake is a deprecated name alias for use_cached_flake and will become invalid after {some date? some version?}. Please update your .envrc to call use_cached_flake instead."
  use_cached_flake "$@"
}

After the target date passes or the target version is released, we can change the use_flake implementation to simply return an error or to call the upstream non-caching variants (wrapped with an error message?)

I'm open to discussing the naming of the new functions and target date and/or version as well as the short and long term impacts of this shift.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions