Skip to content

A way to get project root inside of nix develop shell #8145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
srid opened this issue Apr 1, 2023 · 1 comment
Closed

A way to get project root inside of nix develop shell #8145

srid opened this issue Apr 1, 2023 · 1 comment
Labels
feature Feature request or proposal

Comments

@srid
Copy link

srid commented Apr 1, 2023

Is your feature request related to a problem? Please describe.
I'd like a way to know the root of the project from inside the nix develop shell.

Describe the solution you'd like
Running nix develop should automatically set a FLAKE_ROOT env var that points to the absolute path to the directory containing the flake.nix. If nix develop is run on a remote flake URL (eg: nix develop github:user/repo) this environment can be unset.

Describe alternatives you've considered
Set this env var manually in the shellHook, à la: https://github.com/srid/flake-root

Additional context
cachix/git-hooks.nix#268 (review)

Priorities

Add 👍 to issues you find important.

@srid srid added the feature Feature request or proposal label Apr 1, 2023
@roberth
Copy link
Member

roberth commented Apr 9, 2023

Duplicate of #8034

@roberth roberth marked this as a duplicate of #8034 Apr 9, 2023
@srid srid closed this as completed Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request or proposal
Projects
None yet
Development

No branches or pull requests

2 participants