Skip to content

Utility for git repository absolute paths #1697

Open
@dsalaza4

Description

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

# /some/path/within/repo/devenv.nix

{ pkgs, lib, ... }:
let
  my-custom-utils = import (lib.projectPath "/some/other/path/within/repo") { inherit pkgs };
in {
  packages = [ my-custom-utils ];
}

Thanks!

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions