summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMinijackson <minijackson@riseup.net>2024-12-10 21:34:32 +0100
committerMinijackson <minijackson@riseup.net>2024-12-10 21:34:32 +0100
commit5cc889d066862ed881361a9cec3a593ffab53842 (patch)
tree61f617cc696d558da3996f4bcffb64b76c5f2b15 /lib
parente4f6f4f20c164f7a0576113d94c677fcb86ebc6b (diff)
downloadnixos-config-reborn-5cc889d066862ed881361a9cec3a593ffab53842.tar.gz
nixos-config-reborn-5cc889d066862ed881361a9cec3a593ffab53842.zip
treewide: remove old vim optionsHEADnixos-24.05
they aren't used since the addition of nixvim
Diffstat (limited to 'lib')
-rw-r--r--lib/default.nix1
-rw-r--r--lib/generators.nix41
2 files changed, 0 insertions, 42 deletions
diff --git a/lib/default.nix b/lib/default.nix
index 4bdd20d..918c7f0 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -1,6 +1,5 @@
1attrs: 1attrs:
2 2
3{ 3{
4 generators = import ./generators.nix attrs;
5 theme = import ./theme.nix attrs; 4 theme = import ./theme.nix attrs;
6} 5}
diff --git a/lib/generators.nix b/lib/generators.nix
deleted file mode 100644
index e93d4b0..0000000
--- a/lib/generators.nix
+++ /dev/null
@@ -1,41 +0,0 @@
1{ lib, ... }:
2
3with lib;
4
5{
6 lua = {}: rec {
7 type = with types; let
8 valueType = nullOr
9 (oneOf [
10 bool
11 int
12 float
13 str
14 (attrsOf valueType)
15 (listOf valueType)
16 ]) // {
17 description = "Lua value";
18 }; in
19 valueType;
20
21 lib = {
22 mkRaw = value: { inherit value; _type = "raw"; };
23 };
24
25 generate = value:
26 let
27 list = l: "{ ${concatMapStringsSep ", " generate l} }";
28 attrs = a: "{ ${concatStringsSep ", " (mapAttrsToList (name: value: "[${generate name}] = ${generate value}") a)} }";
29 in
30 if value ? _type && value._type == "raw" then value.value
31 else if isInt value then toString value
32 else if isFloat value then toString value
33 else if isString value then "'${escape [ "'" ] value }'"
34 else if true == value then "true"
35 else if false == value then "false"
36 else if null == value then "nil"
37 else if isList value then list value
38 else if isAttrs value then attrs value
39 else abort "Lua value not supported: ${toPretty value}";
40 };
41}