-
Notifications
You must be signed in to change notification settings - Fork 355
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
Utility for git repository absolute paths #1697
Comments
Nice! The issue with adding it now is that it'll be broken out of the box, unless you use If you're happy with that trade-off, you can add Marking this as a good addition for #1548. |
@sandydoo I just tried the If the devenv environment resides in a path that is not the repository root, we end up with a wrong path. e.g: For a repository with this structure:
And a # /app/devenv.nix
{ config, pkgs, ... }:
let
projectPath = path: config.devenv.root + path;
utils = import (projectPath "/utils/default.nix") { inherit pkgs };
in {
packages = [ utils ];
} We get the following error:
|
It looks like referencing relative paths within # /app/devenv.yaml
inputs:
utils:path:./utils # A devenv bug where ./. is actually the root of the repository and not the current directory? # /app/devenv.nix
{ config, inputs, pkgs, ... }:
let
utils = import inputs.utils { inherit pkgs; };
in {
packages = [ utils ];
} @sandydoo Should we add documentation for this? I'm still not sure if this should be the official way to do this. |
Hey there,
I wonder if there's a way to reference a path within the git repository in an absolute way so I don't have to do
../../../.
when importing from higher directory levels.Something like Makes's projectPath that allows us to reference files using absolute paths from the repo root:
e.g
Thanks!
The text was updated successfully, but these errors were encountered: