![](/static/253f0d9b/assets/icons/icon-96x96.png)
![](https://programming.dev/pictrs/image/890e2662-72ba-4735-b443-91b49048766a.png)
I do have a function that I cribbed from somewhere, unfortunately I didn’t note down the source at the time so can’t give them due credit here.
filterNixFiles = k: v: v == "regular" && lib.hasSuffix ".nix" k;
importNixFiles = path: (lib.lists.forEach (lib.mapAttrsToList (name: _: path + ("/" + name)) (lib.filterAttrs filterNixFiles (builtins.readDir path)))) import;
Then used as normal
modules = [ home-manager.nixosModules.home-manager vscode-server.nixosModule ] ++ (importNixFiles ./hosts/required) ++ (importNixFiles ./hosts/machines/${hostname})
Edit
Apologies for formatting on mobile
I’m currently using nixvim, or at least attempting to, I was previously just using lazygit outside my nix config, but now I’m trying to very slowly create a config I like, but its very slow, and I’ve got some weird padding issues with neovim and alacritty that I’m trying to solve first.
I hadn’t heard of nixneovim, I think once I’m in a settled state I’ll take a look at it, I just don’t want to be pilling more change on top of an unstable base at the moment.
P.s. I probably should have stated I’m fairy new to neovim in general, so still learning which plugins I like.