mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-19 09:49:48 +01:00
feat(lib): lua namespace for conversion helpers
This commit is contained in:
parent
58f7d8b62e
commit
8658ea13a2
4 changed files with 14 additions and 9 deletions
|
@ -1,9 +0,0 @@
|
|||
# From home-manager: https://github.com/nix-community/home-manager/blob/master/modules/lib/booleans.nix
|
||||
{lib}: {
|
||||
# Converts a boolean to a yes/no string. This is used in lots of
|
||||
# configuration formats.
|
||||
yesNo = value:
|
||||
if value
|
||||
then "yes"
|
||||
else "no";
|
||||
}
|
|
@ -4,4 +4,5 @@
|
|||
types = import ./types {inherit lib;};
|
||||
languages = import ./languages.nix {inherit lib;};
|
||||
nmd = import ./nmd.nix;
|
||||
lua = import ./lua.nix {inherit lib;};
|
||||
}
|
||||
|
|
12
lib/lua.nix
Normal file
12
lib/lua.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Helpers for converting values to lua
|
||||
{lib}: {
|
||||
yesNo = value:
|
||||
if value
|
||||
then "yes"
|
||||
else "no";
|
||||
|
||||
nullString = value:
|
||||
if value == null
|
||||
then "nil"
|
||||
else "'${value}'";
|
||||
}
|
|
@ -41,6 +41,7 @@ with lib; let
|
|||
"rust-tools"
|
||||
"onedark"
|
||||
"catppuccin"
|
||||
"dracula"
|
||||
"minimap-vim"
|
||||
"dashboard-nvim"
|
||||
"alpha-nvim"
|
||||
|
|
Loading…
Reference in a new issue