Add config validation hook

main
Julius Riegel 8 months ago
parent c684812638
commit 362a51f178

@ -1,7 +1,7 @@
modal = true modal = true
default_flags = "gh" default_flags = "gh"
show_selection_mark = true show_selection_mark = true
{{#if ctx.icons}} {{#if cfg.broot.icons}}
icon_theme = "vscode" icon_theme = "vscode"
{{/if}} {{/if}}

@ -11,7 +11,7 @@ config.font = wezterm.font_with_fallback {
'Jetbrains Mono', 'Jetbrains Mono',
'Broot Icons Visual Studio Code', 'Broot Icons Visual Studio Code',
} }
config.font_size = {{ctx.font-size}} config.font_size = {{cfg.wezterm.font_size}}
config.color_scheme = 'Dracula' config.color_scheme = 'Dracula'
config.window_background_gradient = { config.window_background_gradient = {
orientation = 'Vertical', orientation = 'Vertical',

@ -0,0 +1,27 @@
local silo = require 'silo'
local function missing(name)
error("config value for `" .. name .. "` is missing")
end
local function before_apply_all()
local cfg = silo.config
if not cfg.environment then
missing('environment')
end
if not cfg.username then
missing('username')
end
if not cfg.wezterm.font_size then
missing('wezterm.font_size')
end
if not cfg.modules then
missing('modules')
end
end
return {
before_apply_all = before_apply_all
}

@ -17,6 +17,10 @@ local mod = function(packages)
} }
end end
-- default configurations for software
config.broot = { icons = false }
config.wezterm = { font_size = 12 }
-- all software modules / package groups -- all software modules / package groups
config.modules = { config.modules = {
core = default_mod { core = default_mod {
@ -35,6 +39,13 @@ config.modules = {
'neofetch', 'neofetch',
'translate-shell', 'translate-shell',
}, },
gui = mod {
'kdePackages.breeze-icons',
'breeze-gtk',
'breeze-qt5',
'vscode',
'insomnia',
},
fonts = default_mod { fonts = default_mod {
'fontconfig', 'fontconfig',
'fira-code-nerdfont', 'fira-code-nerdfont',

Loading…
Cancel
Save