Skip to content
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

da/type path resolver #127

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

blaggacao
Copy link
Contributor

@blaggacao blaggacao commented Jun 21, 2021

  • imp: pathType resolves strings that look like relpaths to file
  • imp: add _devshelltoml module arg (only set for toml files)

fixes: #95

E.g. useful for toml strings that should represent a relative
file to the toml file.

fixes: numtide#95
This argument is null otherwise, hence it is only be used
in the concrete context of a devshell toml file

Usage:
```nix
{config, lib, pkgs, _devshelltoml, ...}: let
  pathType = (import ../../nix/types.nix { inherit lib; }).pathType;
in {
  type = pathType _devshellToml; # will handle non-toml files gracefully
}
```
Comment on lines +8 to +10
If it's a string, returns an absolute path transforming relative
paths with regard to the tomlfile attribute, first. Or
transparently passes through path types, otherwise.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs update before merging.

@zimbatm
Copy link
Member

zimbatm commented Dec 13, 2021

Oops, I missed a bunch of PRs. Is this really working? It's hard to wrap my head around the implementation but color me impressed :)

@blaggacao
Copy link
Contributor Author

^^ noted, will try to carve out a spot to context switch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

possible way to expose devshell.toml's path?
2 participants