Not a direct answer to your question, but this made me think of this post:
Back to topic:
Would something like this help you?
This is a simple nvim config built using nixvim (which I actually never used ^^ but it’s good for minimal setups)
Put the following in somefile.nix:
let
# The following get's a nixpkgs & nixvim version, included as is to make this example simple & self-contained.
# In reality you should use a pinning helper like npins (https://github.com/andir/npins).
nixpkgs = import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/nixos-24.11.tar.gz";
sha256 = "sha256:1cvxfj03xhakyrrz8bh4499vz5d35ay92575irrbmydcxixsrf3w";
}) {};
nixvim = nixpkgs.fetchFromGitHub {
owner = "nix-community";
repo = "nixvim";
rev = "nixos-24.11"; # must be compatible with nixpkgs
hash = "sha256-MpLljx/1dGnBIQlUswaUz/ZeOp44R3ngc1iBf4tyzyc=";
};
makeNixvim = (import nixvim).outputs.legacyPackages.${builtins.currentSystem}.makeNixvim;
nvim = makeNixvim {
colorschemes.gruvbox.enable = true;
};
in {
inherit nvim;
}
And run it with nix run -f somefile.nix nvim
Note that in this case the parameter named nvim is important for nix run .. to use the correct nvim binary from the built derivation in nvim attribute.
Alternatively you can put that nvim ‘variable’ in your NixOS’s environment.systemPackages (it’s a full nvim packages with a nvim bin)
Don’t do that. If you’re not setting a hash, nix will fetch this file every time the download cache expires, by default every 2 hours. This kills all the guarantees nix normally gives you. Use pkgs.fetchFromGitHub if you must manually manage your inputs, since it refuses to work without a hash.
Alternatively, use npins - it literally uses the same mechanism for importing an external project, but gives you a reasonable way to update and prevents rookie mistakes like the one you just made.
Ah yes sorry about that, I never do that myself but this is in one of the first example in NixVim repo…
(I never remember how to properly get a specific version of somethings… )
@TLATER How would you suggest to explain / get a nixpkgs/other thing like this in a short way when making small self-contained examples for others?
I’d explain the gist of npins with a link to the repo like I just did. I appreciate that this can make answers look more daunting; I should sit down and write up a simple set of example commands at some point, plus the context on how to hook your pins into specialArgs or _module.args.
I would simply not even suggest flakes, and actively steer new users away from them if they ask about them. Not because I dislike the concept, but because of the glaring, unresolved, super impactful issues that still show no sign of progress after 5 years.
I believe this to be the bare-minimum. Trying to shorten the explanation to just a fetchurl variant or something along those lines seems irresponsible to me, since that will in practice mean that the software never gets updated; You’re not giving the people reading your docs everything they need to maintain a safe system, and are handing them an easily misused footgun on a silver tablet.
Input handling is simply more complex than “here, grab this random zip”, and should not be treated as if it could be that simple, especially when explaining it to new users.
note: I updated the example to be a bit better using fetchFromGitHub at least and mention npins.
I 100% agree with what you said.
Would you consider making a nix.dev page maybe? (to help discovery)
So, this is my first real foray into Github lol… It’s installed, and I have the desktop app as well(Gnome). Growing up using DOS and Win 3.x (and doing horrible things to my computers) got me thru the initial learning curve, with some incredible help from this community, NixOS going with hardwareconfig upgrades and swap stuff & then getting Python functional (still want to do the python library/package wrap at some point).
Sometimes I won’t even be connected to the internet when practicing or editing. I know constantly grabbing repos and being online all the time is the usual for lots of people, that’s not my situation right now though.
I’m still learning what information I can ignore, and what information I need to translate to make things work just using NixOS as a single user without any other managers.
If there’s a good basic install/setup process out there that just needs a few extra notes to guide me… I’m getting really familiar with the “I’m soooooo close to understanding this” feeling, and I love getting on the other side lol
Thanks to everyone who’s responded, all good stuff and interesting, I’ll be rereading it tomorrow to see if it finally clicks for me.
NixVim is a separate project that provides a module system similar to NixOS’ to configure Neovim, you can just add (neo)vim to systemPackages and use it as-is.
Configurations like AstroNvim should work with the only caveat that things like language servers installed via Mason won’t run because the binaries will expect their library dependencies to be in their FHS locations.
I went thru the readme, made sure I was on the 24.11 fork as well but haven’t downloaded anything. I came across this little gem https://github.com/fred-drake/neovim that looks like a good starting point.
Dropped Neovim in my Packages a bit ago, but then I started reading too much and thought I might have done something wrong lol.
My needs are pretty straight forward right now, using python to extract and layer XML’s with corresponding JSON’s for research studies to be used as a dataset for app/llm utilization.
Time for the rabbit hole, but if you have any suggestions I am all ears!
My woowoo senses got all tingly when I came across this and it looks interesting (yes, I do spiritual/energetic healing and coaching stuff) I’ll report back after I play around but if anyone has experience I’d love to hear about it!
I’m using its home-manager module for a few months now and I’m really happy.
You can use the nixos module (non-home-manager).
You can also try with nix run github:JMartJonesy/kickstart.nixvim/standalone.