-
Notifications
You must be signed in to change notification settings - Fork 79
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
Allow custom location for nix/sources.json #159
Conversation
This turns `sources.nix` into a functor that acceps an argument: ``` nix { sourcesJson = <path/to/sources.json> ; } ``` The `sourcesJson` will be used instead of `./sources.json`.
The CLI was updated to allow for custom locations of the `nix/sources.json`: ``` Usage: niv [-s|--sources-json FILE] COMMAND Available options: -s,--sources-json FILE Use FILE instead of nix/sources.json -h,--help Show this help text ```
70fb76c
to
8d83a8d
Compare
@nmattia I was just playing with this, looks like there's some slight inaccuracy in the messaging. When you
Which says to set |
Also I notice that I can now easily move |
Also thank you so much for doing this, this PR makes me incredibly happy :D |
Also (last also I promise) in case anyone is interested here's the commit where I changed my dotfiles to take advantage of this: cprussin/dotfiles@4fbdc79 |
Dang, you're absolutely right! Hackage went down right when I tried to publish the latest version, that was probably a sign. Feel like submitting a PR? :)
That shouldn't be a problem, right?
Yeah, that's right. As a disclaimer I gave #132 a lot of thought this weekend, and the motivation for making the |
cprussin/dotfiles@4fbdc79 nice! I'm curious, what's your plan for updating I was also thinking about an alternative to |
Also (last also I promise), have you checked out https://github.com/nmattia/homies ? I used to keep my dotfiles around but then decided to make the whole shizzle actually reproducible, with some nice helpers for installing the packages. |
For update, it's just the warning, so not really a problem. For
That sounds like a much better approach. I'm certainly happy to live with some friction until that lands. If that's where things are going I wouldn't worry too much about this workflow in the meantime. Out of curiosity, since I've started using niv and especially with that insight I've wondered why niv doesn't just generate a nix file instead of json. That would remove the need to even have a
Yeah basically; that repo is 100% nix since it's my dotfiles and so it's really awkward to have a
I don't really have much of a strong opinion, but I tend to prefer not forcing names of things (it's not unreasonable to want to colocate niv files with other things that might happen to already have names like
This is super cool and I had not seen it before... I will be stealing some ideas :). I have some questions but I will post them over there to keep this thread on topic. |
I just had an idea: could you distribute import "${nivPkgs.niv}/share/sources.nix" {
sourcesFile = ./lol_I_name_files_poorly.json;
} |
Sorry, haven't had a chance to play around with my niv config recently, but I'll try to give this a spin this weekend. Thanks again for all the effort that went into implementing this 👍 |
Closes #148
Closes #134
Closes #102
To try this out, run
Closing #148 because the path to nix/sources.json is now configurable both on the CLI and from nix/sources.nix.
Closing #134 because technically sources.nix is now configurable, we'll need to create more specific tickets for particular configurations.
Closing #102 as well, although I suspect that
niv init
will create some funky sources.nix referencing a sources.json that's not the one provided by the user. @masaeedu can you confirm?