Giter Site home page Giter Site logo

Comments (11)

fdncred avatar fdncred commented on June 3, 2024 2

We've talked about this recently in some other issue that I can't find. The synopsis, as I remember it, was to have something like NU_LIB_DIRS where script files/modules could be stored and if they are present get sourced on startup. I probably won't support folder named conf.d and modules.d because they're way to Linux-y. However, if there was something like NU_AUTO_SOURCE, and it was a list of folders, you could name them anything you want.

from nushell.

fdncred avatar fdncred commented on June 3, 2024 1

Is there an ETA on this? This is one of the most important thing missing for me to switch to nushell. Managing config files in 3rd party tools (part of dotfiles) would be much more easy.

It's just waiting on someone to implement it.

from nushell.

ADIX7 avatar ADIX7 commented on June 3, 2024

Is there an ETA on this? This is one of the most important thing missing for me to switch to nushell. Managing config files in 3rd party tools (part of dotfiles) would be much more easy.

from nushell.

NotTheDr01ds avatar NotTheDr01ds commented on June 3, 2024

@ADIX7 I'm not a Rust developer (yet, but I'd love to learn), but it seems to me to be a relatively easy implementation. Might be a "Good First Issue" for someone to work on, but I'll let a Nu team member make that determination.

from nushell.

NotTheDr01ds avatar NotTheDr01ds commented on June 3, 2024

And I came back over to add that this isn't only for third-party modules.

It's far more easy to just <nano/vi/edit/code> ~/.config/nushell/conf.d/my_function.nu and edit away than it is to find the function/custom command declaration in a monolithic config.nu, even with the best of IDE/editors.

from nushell.

NotTheDr01ds avatar NotTheDr01ds commented on June 3, 2024

Throwing out a ... maybe ... include subdirectories of conf.d/modules.d automatically as well? This would allow you to git clone a module/script directly into the directory ...

The structure of the repo would have to be "just right" though, or would need some convention to specify what to load (and what not to).

Which reminds me, this ultimately goes to a "convention over configuration" mindset, I believe.

from nushell.

NotTheDr01ds avatar NotTheDr01ds commented on June 3, 2024

Is there an ETA on this? This is one of the most important thing missing for me to switch to nushell. Managing config files in 3rd party tools (part of dotfiles) would be much more easy.

It's just waiting on someone to implement it.

Good first issue for someone, or are there nuances I'm not anticipating?

from nushell.

fdncred avatar fdncred commented on June 3, 2024

Good first issue for someone, or are there nuances I'm not anticipating?

Yes, there will be nuances like:

  1. when should they be loaded, before x file, after y file
  2. when should they be loaded, with x parameter or with y parameter
  3. should all of these be merged into the root overlay or should it be a new one
  4. probably other concerns here too

from nushell.

NotTheDr01ds avatar NotTheDr01ds commented on June 3, 2024

@fdncred Fair enough

I'll try to experiment with various flavors of this (via hard-coded source and use statements in config.nu for now) to see if I can flesh out the recommended implementation.

For #1, at least, I recommend loading after all default configs are processed (env.nu, config.nu, and login.nu - Is that the complete set?). This allows the conf.d files to act as overrides on any "default" or pre-existing settings. Again, that's the way other conf.d implementations tend to go.

The main question on item 1, though, that I'm not sure about is how to choose the ordering of modules vs. source'd files. Again, I'll experiment.

from nushell.

fdncred avatar fdncred commented on June 3, 2024

I recommend loading after all default configs are processed

i agree

number 2 is about nu --parameters e.g. should it be loaded with nu -c, what about nu -c -l, what about nu --stdin, what about....

that I'm not sure about is how to choose the ordering of modules vs. source'd files.

One thing about ordering, iirc, some linux types do 1.filename 2.filename 3.filename, etc. i'm not sure we need to do that or not and i'm also not sure how that plays with source, source-env, use, overlay, overlay use, etc

from nushell.

lpnh avatar lpnh commented on June 3, 2024

If I've understood correctly, this sounds like a great feature to be implemented!

Could this be related to the following? #5682 #8214

from nushell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.