aboutsummaryrefslogtreecommitdiffstats
path: root/nvim/lua/profiles.lua
diff options
context:
space:
mode:
Diffstat (limited to 'nvim/lua/profiles.lua')
-rw-r--r--nvim/lua/profiles.lua28
1 files changed, 28 insertions, 0 deletions
diff --git a/nvim/lua/profiles.lua b/nvim/lua/profiles.lua
new file mode 100644
index 0000000..f797a3a
--- /dev/null
+++ b/nvim/lua/profiles.lua
@@ -0,0 +1,28 @@
+-- Tools for conditionally loading plugins via lazy
+M = {}
+
+M.machines = { 'nest', 'Goose.local' }
+
+local getDefaultmetatable = {
+ __index = function(tbl, key)
+ if rawget(tbl, key) then
+ return tbl[key]
+ else
+ return tbl["default"]
+ end
+ end
+}
+
+-- Create a table for each machine with a default value
+-- current machines: nest, Goose.local
+M.createProfiles = function(default)
+ local profiles = {}
+ profiles.default = default
+ for _, machine in ipairs(M.machines) do
+ profiles[machine] = default
+ end
+ setmetatable(profiles, getDefaultmetatable)
+ return profiles
+end
+
+return M