Repository navigation
Declarative Syntax
The declarative system that Sinix Linux is a powerful and efficient system coded in Lua and will be configured by you in Lua.
How it works is that it was coded to reserve local functions and "APIs" that run commands and structure calculations to get to the desired result.
In the source code of the declarative system, there are 2 files, absolute.lua and main.lua.
absolute.lua has these functions: run_cmd (runs a command), is_package_installed (checks if the queried package(s) is(are) installed),
is_service_enabled (checks if the queried service(s) is(are) enabled) and sys_engine.apply_packages (probably self-explanatory.)
For further investigation or whatever, the source code is here.
In your Sinix system, you should have a directory called /sinix/declare/.
It's where the source code and the configuration is; To start configuring, create or edit a file called config.lua with your favorite
text editor.
Important
If you misspell the name of the config file, it will break everything!
For this example, we will use Neovim.
nvim /sinix/declare/config.luaPress i in your keyboard to enter Insert Mode so you can code.
To not overwhelm you, i will be simple.
config.lua uses tables, similar to JSON or TOML.
A normal structure will look like this:
return {
hostname = "something",
packages = {
"hyprland",
"hyprlock"
},
dotfiles = {
}
}return is used because it returns the values to main.lua and(or) absolute.lua.
See the structure? You will use this, use your own desired packages and dotfiles (will be covered later) and rebuild.
You may use the sinix-rebuild script that enforces the changes and reconfigures your system.
sinix-rebuildIf fish can't find it:
./usr/local/bin/sinix-rebuildNote
(it uses the actual path and the lil dot (.) makes bash execute as a script)
It will spit out verbose and information, and enforces the changes you wish.
Edit the config.lua and rebuild..
nvim /sinix/declare/config.luaThen in the packages block:
packages = {
"something",
"something-else"
},And rebuild:
sinix-rebuildYou can also manage your dotfiles in ~/.config in config.lua.
dotfiles = {
{
src = "/sinix/share/config/kitty/",
dest = "~/.config/kitty/"
}
}This creates a Symbolic link between the folders, sharing their functionality between themselves.
And the best part, you can also use a completely custom folder and simply do the same!
dotfiles = {
{
src = "imissthatkindofEOFthekindwhereyouwererootforme/",
dest = "~/.config/"
}
}Services can be disabled and enabled:
services = {
NetworkManager = "enabled",
greetd = "enabled",
bluetooth = "disabled"
}Then in the background when you rebuild, it will run sudo systemctl enable --now NetworkManager.service greetd.service bluetooth.service.
You can still use the command yourself normally. Suggest if we should add an alias for this that adds to the config and does it.