Add samples

Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
2025-07-26 00:07:09 +03:00
parent a35a476654
commit 90a6e58dca
6 changed files with 104 additions and 0 deletions

21
samples/build_system.dcfg Normal file
View File

@@ -0,0 +1,21 @@
fn lib = {
targets = [
{
name = 'kernel'
source = 'src/kernel'
output = 'bin/kernel.elf'
options = {
optimization = 'O2'
debug = false
}
}
{
name = 'initrd'
source = 'src/initrd'
output = 'bin/initrd.img'
}
]
parallel_jobs = 8
cache.enable = true
}

13
samples/disks.dcfg Normal file
View File

@@ -0,0 +1,13 @@
fn lib = {
partitions.aliases = {
root = "hd0p2"
boot = "hd0p1"
swap = "hd0p3"
}
partitions = {
automount = [ 'boot' 'root' ]
swap.enable = true
swap.size = 2g
}
}

23
samples/network.dcfg Normal file
View File

@@ -0,0 +1,23 @@
fn lib = {
enable = true
interfaces = {
eth0.ip = '192.168.0.10'
eth0.gateway = '192.168.0.1'
eth0.dns = [ '8.8.8.8' '1.1.1.1' ]
wlan0 = {
ssid = "HomeWiFi"
password = "super_secret"
dhcp = on
}
}
firewall = {
tcp = (lib.join
[ 22 80 443 ]
(lib.list_from_range 3000 3010)
)
udp = [ 53 123 ]
}
}

20
samples/services.dcfg Normal file
View File

@@ -0,0 +1,20 @@
fn lib = (lib.join
[
{
stage = 'boot'
every = 7d
action.command = 'logrotate("/var/log/*.log")'
}
{
stage = 'network'
after = 'boot'
action.binary = root:/System/Programs/NetworkManager
}
{
stage = 'gui'
after = 'network'
action.binary = root:/System/Programs/DisplayManager
}
]
(import root:/System/Services/ssh.conf lib)
)

18
samples/web_server.dcfg Normal file
View File

@@ -0,0 +1,18 @@
fn lib = {
enable = true
host = '0.0.0.0'
port = 8080
document_root = /www
ssl = {
enable = on
cert = /etc/ssl/server.crt
key = /etc/ssl/server.key
}
logging = {
level = 'info'
access_log = /var/log/httpd/access.log
error_log = /var/log/httpd/error.log
}
}

View File

@@ -0,0 +1,9 @@
fn lib = {
keybindings = [
{ key = 'Main-Shift-Escape' action = lib.quit_wm }
{ key = 'Main-Shift-Q' action = lib.kill_application }
{ key = 'Main-Shift-C' action = lib.close_application }
{ key = 'Main-Space' action = (lib.execute 'alacritty') }
]
}