refactor: complete overhaul
Complete overhaul of repo structure based on nvix. See https://github.com/niksingh710/nvix Signed-off-by: Lander Van den Bulcke <landervandenbulcke@gmail.com>
This commit is contained in:
parent
ff2c59724a
commit
61feed4086
75 changed files with 2916 additions and 2314 deletions
33
plugins/default.nix
Normal file
33
plugins/default.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
mapAttrsMaybe =
|
||||
f: attrs:
|
||||
lib.pipe attrs [
|
||||
(lib.mapAttrsToList f)
|
||||
(builtins.filter (x: x != null))
|
||||
builtins.listToAttrs
|
||||
];
|
||||
forAllNixFiles =
|
||||
dir: f:
|
||||
if builtins.pathExists dir then
|
||||
lib.pipe dir [
|
||||
builtins.readDir
|
||||
(mapAttrsMaybe (
|
||||
fn: type:
|
||||
if type == "regular" then
|
||||
let
|
||||
name = lib.removeSuffix ".nix" fn;
|
||||
in
|
||||
lib.nameValuePair name (f "${dir}/${fn}")
|
||||
else if type == "directory" && builtins.pathExists "${dir}/${fn}/default.nix" then
|
||||
lib.nameValuePair fn (f "${dir}/${fn}")
|
||||
else
|
||||
null
|
||||
))
|
||||
]
|
||||
else
|
||||
{ };
|
||||
in
|
||||
{
|
||||
flake.myvimPlugins = forAllNixFiles ./. (fn: fn);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue