Skip to content

It's not good practice to commit .envrc #114

Open

Description

@stevenroose

For anyone that has direnv installed, the .envrc files will automatically be attempted to be executed once you enter the directory it's in. This is pretty annoying and also quite invasive.

I think it's better practice to have a .envrc.example or .envrc.dist that the user can then cp .envrc.dist .envrc to his own, to opt-in to automatic nix-shell etc.

Activity

  1. RCasatta commented on Sep 24, 2024

    @RCasatta
    Collaborator

    I think your setup (which automatically run the .envrc) is risky because I have to opt-in for .envrc execution explicitly by doing direnv allow If I want it to be executed automatically (and it's required to do it every time the .envrc changes)

  2. shesek commented on Sep 29, 2024

    @shesek
    Collaborator

    I'm not using direnv so not affected by this (I just manually source with set -a if needed), but I'm also used to the practice of committing envrc files as .envrc.example.

    Also its not quite a typical .envrc file, but something specific to nix. Its possible that we might want to have an envrc in the future that's unrelated to nix, which would conflict. So perhaps it would make sense to name this something like nix.envrc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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