wip
Signed-off-by: Lander Van den Bulcke <landervandenbulcke@gmail.com>
This commit is contained in:
parent
ff2c59724a
commit
55860985f8
9 changed files with 252 additions and 109 deletions
12
plugins/common/default.nix
Normal file
12
plugins/common/default.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
imports =
|
||||
with builtins;
|
||||
with lib;
|
||||
map (fn: ./${fn}) (
|
||||
filter (fn: (fn != "default.nix" && hasSuffix ".nix" "${fn}")) (attrNames (readDir ./.))
|
||||
);
|
||||
|
||||
luaLoader.enable = false;
|
||||
|
||||
}
|
||||
26
plugins/common/options.nix
Normal file
26
plugins/common/options.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.nixvim = {
|
||||
leader = mkOption {
|
||||
description = "The leader key for nvim.";
|
||||
type = types.str;
|
||||
default = " ";
|
||||
};
|
||||
|
||||
border = mkOption {
|
||||
description = "The border style for nvim.";
|
||||
type = types.enum [
|
||||
"single"
|
||||
"double"
|
||||
"rounded"
|
||||
"solid"
|
||||
"shadow"
|
||||
"curved"
|
||||
"bold"
|
||||
"none"
|
||||
];
|
||||
default = "rounded";
|
||||
};
|
||||
};
|
||||
}
|
||||
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.listToAtts
|
||||
];
|
||||
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.nixvimPlugins = forAllNixFiles ./. (fn: fn);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue