commit 08aa537d9e8c6ecc54ca5354cc0947b63c03d5e0 Author: freya <freya@xiii.invalid> Date: Sat, 5 Dec 2026 14:41:56 +0400 guix config for xiii Diffstat:
| A | .gitignore | | | 2 | ++ |
| A | channels.scm | | | 9 | +++++++++ |
| A | dots/.config/fontconfig/conf.d/10-accept-terminus.conf | | | 10 | ++++++++++ |
| A | dots/.config/gtk-3.0/settings.ini | | | 2 | ++ |
| A | dots/.config/gtk-4.0/settings.ini | | | 2 | ++ |
| A | dots/.config/niri/config.kdl | | | 121 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | dots/.config/wallust/templates/env.sh | | | 7 | +++++++ |
| A | dots/.config/wallust/templates/foot.ini | | | 22 | ++++++++++++++++++++++ |
| A | dots/.config/wallust/templates/mako.conf | | | 12 | ++++++++++++ |
| A | dots/.config/wallust/templates/niri.kdl | | | 7 | +++++++ |
| A | dots/.config/wallust/templates/wob.ini | | | 14 | ++++++++++++++ |
| A | dots/.config/wallust/wallust.toml | | | 13 | +++++++++++++ |
| A | dots/.local/bin/xiii-clip | | | 4 | ++++ |
| A | dots/.local/bin/xiii-hud | | | 226 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | dots/.local/bin/xiii-lock | | | 6 | ++++++ |
| A | dots/.local/bin/xiii-menu | | | 4 | ++++ |
| A | dots/.local/bin/xiii-osd | | | 56 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | dots/.local/bin/xiii-wall | | | 63 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | dots/bin/linkwatch.sh | | | 15 | +++++++++++++++ |
| A | home.scm | | | 40 | ++++++++++++++++++++++++++++++++++++++++ |
| A | system.scm | | | 339 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | theme.scm | | | 131 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | trusted-channels.scm | | | 20 | ++++++++++++++++++++ |
23 files changed, 1125 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore @@ -0,0 +1,2 @@ +private.scm +current diff --git a/channels.scm b/channels.scm @@ -0,0 +1,9 @@ +(cons* (channel + (name 'nonguix) + (url "https://gitlab.com/nonguix/nonguix") + (introduction + (make-channel-introduction + "897c1a470da759236cc11798f4e0a5f7d4d59fbc" + (openpgp-fingerprint + "2A39 3FFF 68F4 EF7A 3D29 12AF 6F51 20A0 22FB B2D5")))) + %default-channels) diff --git a/dots/.config/fontconfig/conf.d/10-accept-terminus.conf b/dots/.config/fontconfig/conf.d/10-accept-terminus.conf @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> +<fontconfig> + <selectfont> + <acceptfont> + <pattern><patelt name="family"><string>Spleen</string></patelt></pattern> + <pattern><patelt name="family"><string>Terminus</string></patelt></pattern> + </acceptfont> + </selectfont> +</fontconfig> diff --git a/dots/.config/gtk-3.0/settings.ini b/dots/.config/gtk-3.0/settings.ini @@ -0,0 +1,2 @@ +[Settings] +gtk-application-prefer-dark-theme=1 diff --git a/dots/.config/gtk-4.0/settings.ini b/dots/.config/gtk-4.0/settings.ini @@ -0,0 +1,2 @@ +[Settings] +gtk-application-prefer-dark-theme=1 diff --git a/dots/.config/niri/config.kdl b/dots/.config/niri/config.kdl @@ -0,0 +1,121 @@ +input { + mod-key "Alt" + keyboard { + xkb { + layout "us,ru" + variant "colemak," + options "grp:win_space_toggle" + } + } + touchpad { + tap + natural-scroll + } +} + +output "eDP-1" { + scale 1.375 +} + +layout { + gaps 8 + center-focused-column "never" + preset-column-widths { + proportion 0.33333 + proportion 0.5 + proportion 0.66667 + } + default-column-width { proportion 0.5; } + focus-ring { + off + } + border { + width 1 + } + shadow { + off + } +} + +include "/home/freya/.config/niri/baseline.kdl" +include "/home/freya/.cache/wallust/niri.kdl" + +spawn-sh-at-startup "exec ~/.local/bin/xiii-wall --restore" +spawn-at-startup "poweralertd" +spawn-sh-at-startup "exec ~/.local/bin/xiii-osd start" +spawn-sh-at-startup "wl-paste --watch cliphist store" +spawn-at-startup "wlsunset" "-l" "53" "-L" "50" + +prefer-no-csd +screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png" + +window-rule { + match app-id=r#"firefox$"# title="^Picture-in-Picture$" + open-floating true +} + +window-rule { + match app-id="^xiii-hud$" + open-floating true + default-column-width { fixed 380; } + default-window-height { fixed 769; } + default-floating-position x=8 y=8 relative-to="top-right" +} + +binds { + Mod+Shift+Slash { show-hotkey-overlay; } + Mod+P hotkey-overlay-title="launcher (wmenu)" { spawn-sh "exec ~/.local/bin/xiii-menu"; } + Mod+B hotkey-overlay-title="system HUD" { spawn-sh "exec ~/.local/bin/xiii-hud"; } + Mod+H { focus-column-left; } + Mod+I { focus-column-right; } + Mod+N { focus-window-or-workspace-down; } + Mod+E { focus-window-or-workspace-up; } + Mod+Shift+H { move-column-left; } + Mod+Shift+I { move-column-right; } + Mod+Shift+N { move-window-down-or-to-workspace-down; } + Mod+Shift+E { move-window-up-or-to-workspace-up; } + Mod+Minus { set-column-width "-5%"; } + Mod+Equal { set-column-width "+5%"; } + Mod+Comma { consume-or-expel-window-left; } + Mod+Period { consume-or-expel-window-right; } + Mod+Alt+L hotkey-overlay-title="lock" { spawn-sh "exec ~/.local/bin/xiii-lock"; } + Mod+Return hotkey-overlay-title="terminal (foot)" { spawn "foot"; } + Mod+Shift+Return { move-column-to-first; } + Mod+Tab { focus-workspace-previous; } + Mod+Shift+C { close-window; } + Mod+T { reset-window-height; } + Mod+F { maximize-column; } + Mod+Shift+F { fullscreen-window; } + Mod+Shift+Space { toggle-window-floating; } + Mod+1 { focus-workspace 1; } + Mod+2 { focus-workspace 2; } + Mod+3 { focus-workspace 3; } + Mod+4 { focus-workspace 4; } + Mod+5 { focus-workspace 5; } + Mod+6 { focus-workspace 6; } + Mod+7 { focus-workspace 7; } + Mod+8 { focus-workspace 8; } + Mod+9 { focus-workspace 9; } + Mod+Shift+1 { move-column-to-workspace 1; } + Mod+Shift+2 { move-column-to-workspace 2; } + Mod+Shift+3 { move-column-to-workspace 3; } + Mod+Shift+4 { move-column-to-workspace 4; } + Mod+Shift+5 { move-column-to-workspace 5; } + Mod+Shift+6 { move-column-to-workspace 6; } + Mod+Shift+7 { move-column-to-workspace 7; } + Mod+Shift+8 { move-column-to-workspace 8; } + Mod+Shift+9 { move-column-to-workspace 9; } + Mod+Shift+Q { quit; } + Super+C { spawn-sh "exec ~/.local/bin/xiii-clip"; } + Super+Print { screenshot; } + Print { screenshot; } + XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "exec ~/.local/bin/xiii-osd volume-up"; } + XF86AudioLowerVolume allow-when-locked=true { spawn-sh "exec ~/.local/bin/xiii-osd volume-down"; } + XF86AudioMute allow-when-locked=true { spawn-sh "exec ~/.local/bin/xiii-osd volume-mute"; } + XF86MonBrightnessUp allow-when-locked=true { spawn-sh "exec ~/.local/bin/xiii-osd brightness-up"; } + XF86MonBrightnessDown allow-when-locked=true { spawn-sh "exec ~/.local/bin/xiii-osd brightness-down"; } + Shift+XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "exec ~/.local/bin/xiii-osd volume-up-fine"; } + Shift+XF86AudioLowerVolume allow-when-locked=true { spawn-sh "exec ~/.local/bin/xiii-osd volume-down-fine"; } + Shift+XF86MonBrightnessUp allow-when-locked=true { spawn-sh "exec ~/.local/bin/xiii-osd brightness-up-fine"; } + Shift+XF86MonBrightnessDown allow-when-locked=true { spawn-sh "exec ~/.local/bin/xiii-osd brightness-down-fine"; } +} diff --git a/dots/.config/wallust/templates/env.sh b/dots/.config/wallust/templates/env.sh @@ -0,0 +1,7 @@ +WMENU_BG={{background | strip}} +WMENU_FG={{foreground | strip}} +WMENU_SEL_BG={{color9 | strip}} +WMENU_SEL_FG={{background | strip}} +LOCK_INIT=0x{{background | strip}} +LOCK_INPUT=0x{{color4 | strip}} +LOCK_FAIL=0x{{color9 | strip}} diff --git a/dots/.config/wallust/templates/foot.ini b/dots/.config/wallust/templates/foot.ini @@ -0,0 +1,22 @@ +[colors-dark] +cursor={{background | strip}} {{foreground | strip}} +background={{background | strip}} +foreground={{foreground | strip}} +regular0={{color0 | strip}} +regular1={{color1 | strip}} +regular2={{color2 | strip}} +regular3={{color3 | strip}} +regular4={{color4 | strip}} +regular5={{color5 | strip}} +regular6={{color6 | strip}} +regular7={{color7 | strip}} +bright0={{color8 | strip}} +bright1={{color9 | strip}} +bright2={{color10 | strip}} +bright3={{color11 | strip}} +bright4={{color12 | strip}} +bright5={{color13 | strip}} +bright6={{color14 | strip}} +bright7={{color15 | strip}} +selection-foreground={{foreground | strip}} +selection-background={{color8 | strip}} diff --git a/dots/.config/wallust/templates/mako.conf b/dots/.config/wallust/templates/mako.conf @@ -0,0 +1,12 @@ +font=MonoLisa Freezed 10.5 +background-color={{background}}f0 +text-color={{foreground}}ff +border-color={{color9}}ff +border-size=1 +border-radius=0 +padding=10,14 +default-timeout=4000 + +[urgency=high] +border-color={{color11}}ff +default-timeout=0 diff --git a/dots/.config/wallust/templates/niri.kdl b/dots/.config/wallust/templates/niri.kdl @@ -0,0 +1,7 @@ +layout { + border { + active-color "{{color9}}" + inactive-color "{{color0}}" + urgent-color "{{color11}}" + } +} diff --git a/dots/.config/wallust/templates/wob.ini b/dots/.config/wallust/templates/wob.ini @@ -0,0 +1,14 @@ +timeout = 900 +height = 24 +width = 280 +border_offset = 0 +border_size = 1 +bar_padding = 3 +anchor = top right +margin = 20 +background_color = {{background | strip}}f0 +border_color = {{color9 | strip}}ff +bar_color = {{foreground | strip}}ff +overflow_background_color = {{background | strip}}f0 +overflow_border_color = {{color11 | strip}}ff +overflow_bar_color = {{color1 | strip}}ff diff --git a/dots/.config/wallust/wallust.toml b/dots/.config/wallust/wallust.toml @@ -0,0 +1,13 @@ +backend = "resized" +color_space = "lchansi" +palette = "ansidark16" +fallback_generator = "complementary" +check_contrast = true +alpha = 94 + +[templates] +foot = { template = "foot.ini", target = "~/.cache/wallust/foot.ini" } +niri = { template = "niri.kdl", target = "~/.cache/wallust/niri.kdl" } +mako = { template = "mako.conf", target = "~/.cache/wallust/mako.conf" } +wob = { template = "wob.ini", target = "~/.cache/wallust/wob.ini" } +env = { template = "env.sh", target = "~/.cache/wallust/env.sh" } diff --git a/dots/.local/bin/xiii-clip b/dots/.local/bin/xiii-clip @@ -0,0 +1,4 @@ +#!/bin/sh +[ -r "$HOME/.config/xiii/baseline.env" ] && . "$HOME/.config/xiii/baseline.env" +[ -r "$HOME/.cache/wallust/env.sh" ] && . "$HOME/.cache/wallust/env.sh" +exec sh -c "cliphist list | wmenu -l 10 -f \"$MENU_FONT\" -N \"$WMENU_BG\" -n \"$WMENU_FG\" -S \"$WMENU_SEL_BG\" -s \"$WMENU_SEL_FG\" | cliphist decode | wl-copy" diff --git a/dots/.local/bin/xiii-hud b/dots/.local/bin/xiii-hud @@ -0,0 +1,226 @@ +#!/bin/sh +set -eu +export LC_ALL=C +PATH=/run/current-system/profile/bin:/run/current-system/profile/sbin:$HOME/.guix-home/profile/bin:$PATH + +if [ "${1:-}" != "--render" ]; then + if pkill -f "foot --app-id=xiii-hud" 2>/dev/null; then + exit 0 + fi + exec foot --app-id=xiii-hud --title="xiii" -w 380x769 -o pad=18x16 -o font="MonoLisa Freezed:size=11" "$0" --render +fi + +old_stty="" +if [ -t 0 ]; then + old_stty=$(stty -g 2>/dev/null || true) + stty -icanon -echo min 0 time 20 2>/dev/null || true +fi +cleanup() { + [ -n "$old_stty" ] && stty "$old_stty" 2>/dev/null || true + printf '\033[?25h' +} +trap 'cleanup; exit 0' INT TERM +trap 'cleanup' EXIT +printf '\033[?25l\033[2J' + +priv=0 + +fit() { + s=$1 max=$2 + [ "$max" -gt 4 ] || max=4 + if [ "${#s}" -gt "$max" ]; then + cut=$((max - 2)) + printf '%.*s..' "$cut" "$s" + else + printf '%s' "$s" + fi +} + +while :; do + sz=$(stty size 2>/dev/null || true) + rows=$(printf '%s' "$sz" | awk '{print $1}') + cols=$(printf '%s' "$sz" | awk '{print $2}') + [ -n "${rows:-}" ] && [ "$rows" -gt 0 ] || rows=38 + [ -n "${cols:-}" ] && [ "$cols" -gt 0 ] || cols=36 + maxv=$((cols - 10)) + + now=$(date '+%H:%M:%S · %a %d %b') + up=$(awk '{d=int($1/86400); h=int(($1%86400)/3600); m=int(($1%3600)/60); if(d>0) printf "%dd %dh %02dm",d,h,m; else printf "%dh %02dm",h,m}' /proc/uptime) + load=$(awk '{print $1, $2, $3}' /proc/loadavg) + + bat=/sys/class/power_supply/BAT1 + [ -d "$bat" ] || bat=/sys/class/power_supply/BAT0 + cap=? st=unknown ac=0 pwr_uw=0 enow=0 efull=0 edes=0 cyc=? volt=0 + [ ! -r "$bat/capacity" ] || read -r cap <"$bat/capacity" + [ ! -r "$bat/status" ] || read -r st <"$bat/status" + [ ! -r /sys/class/power_supply/AC/online ] || read -r ac </sys/class/power_supply/AC/online + [ ! -r "$bat/power_now" ] || read -r pwr_uw <"$bat/power_now" + [ ! -r "$bat/energy_now" ] || read -r enow <"$bat/energy_now" + [ ! -r "$bat/energy_full" ] || read -r efull <"$bat/energy_full" + [ ! -r "$bat/energy_full_design" ] || read -r edes <"$bat/energy_full_design" + [ ! -r "$bat/cycle_count" ] || read -r cyc <"$bat/cycle_count" + [ ! -r "$bat/voltage_now" ] || read -r volt <"$bat/voltage_now" + + case $st in + Charging) st_s="chg" ;; + Discharging) st_s="bat" ;; + Full) st_s="full" ;; + *) st_s=$([ "$ac" = 1 ] && echo "ac" || echo "bat") ;; + esac + watts=$(awk -v p="$pwr_uw" 'BEGIN{printf "%.1fW", p/1000000}') + wh=$(awk -v n="$enow" -v f="$efull" 'BEGIN{printf "%.1f / %.1f Wh", n/1000000, f/1000000}') + health=$(awk -v f="$efull" -v d="$edes" 'BEGIN{if(d>0) printf "%d%%", (f*100)/d; else print "?"}') + vstr=$(awk -v v="$volt" 'BEGIN{if(v>0) printf "%.2fV", v/1000000; else print "?"}') + eta="" + if [ "$pwr_uw" -gt 100000 ] 2>/dev/null; then + case $st in + Discharging) eta=$(awk -v n="$enow" -v p="$pwr_uw" 'BEGIN{m=int((n/p)*60); printf " · %dh%02dm left", m/60, m%60}') ;; + Charging) eta=$(awk -v n="$enow" -v f="$efull" -v p="$pwr_uw" 'BEGIN{if(f>n){m=int(((f-n)/p)*60); printf " · %dh%02dm full", m/60, m%60}}') ;; + esac + fi + + t_cpu=? t_pch=? t_nvme=? + for h in /sys/class/hwmon/hwmon*; do + [ -r "$h/name" ] && [ -r "$h/temp1_input" ] || continue + read -r hname <"$h/name" + read -r hval <"$h/temp1_input" + c=$((hval / 1000)) + case $hname in + coretemp) t_cpu="${c}" ;; + pch_skylake) t_pch="${c}" ;; + nvme) t_nvme="${c}" ;; + esac + done + gov=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null || echo "?") + ghz=$(awk '/^cpu MHz/{s+=$4; n++} END{if(n>0) printf "%.2f GHz", (s/n)/1000; else print "?"}' /proc/cpuinfo) + + mem=$(awk '/^MemTotal:/{t=$2} /^MemAvailable:/{a=$2} /^Cached:/{c=$2} + END{printf "%.1f / %.1fG (buf %.1fG)", (t-a)/1048576, t/1048576, c/1048576}' /proc/meminfo) + swp=$(awk '/^SwapTotal:/{t=$2} /^SwapFree:/{f=$2} + END{printf "%.0f / %.0fM", (t-f)/1024, t/1024}' /proc/meminfo) + disk=$(df -h / | awk 'NR==2{printf "%s / %s (%s free)", $3, $2, $4}') + + vol=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ 2>/dev/null | awk '{printf "%d%%%s", $2*100+0.5, ($3=="[MUTED]"?" mute":"")}') + bri=$(brightnessctl --class=backlight --machine-readable info 2>/dev/null | awk -F, '{print $4; exit}') + + ssid=$(iw dev wlp1s0 link 2>/dev/null | awk '/SSID:/{sub(/.*SSID: /,""); print; exit}') + sig=$(iw dev wlp1s0 link 2>/dev/null | awk '/signal:/{print $2 "dBm"; exit}') + rate=$(iw dev wlp1s0 link 2>/dev/null | awk '/rx bitrate:/{printf "%sM", int($3+0.5); exit}') + ip4=$(ip -4 -o addr show dev wlp1s0 2>/dev/null | awk '{sub(/\/.*/,"",$4); print $4; exit}') + ygg=$(ip -6 -o addr show dev ygg0 scope global 2>/dev/null | awk '{sub(/\/.*/,"",$4); split($4,a,":"); print a[1]":"a[2]":..:"a[length(a)]; exit}') + + if [ "$priv" -eq 1 ]; then + [ -z "$ssid" ] || ssid="hidden" + [ -z "$ip4" ] || ip4=$(printf '%s' "$ip4" | awk -F. '{printf "%s.%s.%s.xxx", $1,$2,$3}') + [ -z "$ygg" ] || ygg="200:xxxx:..:xxxx" + fi + + mihomo_json=$(curl -qs --max-time 1 "http://127.0.0.1:9090/proxies" 2>/dev/null || true) + vpn_exit=$(printf '%s' "$mihomo_json" | tr '{}' '\n' | awk -F'"' ' + /"name":"(pray2god|p2g|pool)"/{ + n=""; w=""; + for(i=1;i<=NF;i++) if($i=="name") n=$(i+2); else if($i=="now") w=$(i+2); + if(n&&w) a[n]=w + } + END{ + top=a["pray2god"]; + if(top=="") print "offline"; + else if(top=="p2g" && a["p2g"]!="") print "p2g -> " a["p2g"]; + else if(top=="pool" && a["pool"]!="") print "pool -> " a["pool"]; + else print top; + }') + pool_info=$(curl -qs --max-time 1 "http://127.0.0.1:9090/providers/proxies/pool" 2>/dev/null | + awk '{ + tot=gsub(/"provider-name":"pool"/,"&"); + ok=gsub(/"alive":true/,"&"); + if(tot>0) printf "%d/%d alive", ok/2, tot; else print "0" + }') + feed_last=$(awk '/nodes published|unchanged|only [0-9]+ nodes/{t=substr($1,6)" "substr($2,1,5)} END{if(t) printf "%s", t; else print "none"}' /home/freya/.local/share/free-feed/log 2>/dev/null || echo "none") + + procs=$(ps -eo comm,%cpu,%mem --sort=-%mem --no-headers | head -n 4 | + awk '{c=$1; sub(/^\./,"",c); sub(/-real$/,"",c); printf "%-13s %4s%% c %4s%% m\n", substr(c,1,13), $2, $3}') + p1=$(printf '%s\n' "$procs" | sed -n '1p') + p2=$(printf '%s\n' "$procs" | sed -n '2p') + p3=$(printf '%s\n' "$procs" | sed -n '3p') + p4=$(printf '%s\n' "$procs" | sed -n '4p') + + content_lines=33 + top_pad=$(( (rows - content_lines) / 2 )) + [ "$top_pad" -gt 0 ] || top_pad=0 + vpad="" + i=0 + while [ "$i" -lt "$top_pad" ]; do + vpad="${vpad}"$'\033[K\n' + i=$((i + 1)) + done + + priv_tag="" + [ "$priv" -eq 0 ] || priv_tag=" [priv]" + + printf '\033[?2026h\033[H%s'\ +' \033[1mxiii\033[0m %s\033[K\n'\ +'\033[K\n'\ +' \033[31mpower\033[0m\033[K\n'\ +' \033[2mstate \033[0m %s\033[K\n'\ +' \033[2mdraw \033[0m %s\033[K\n'\ +' \033[2mcell \033[0m %s\033[K\n'\ +' \033[2mwear \033[0m %s\033[K\n'\ +'\033[K\n'\ +' \033[31msystem\033[0m\033[K\n'\ +' \033[2mcpu \033[0m %s\033[K\n'\ +' \033[2mload \033[0m %s\033[K\n'\ +' \033[2mtemp \033[0m %s\033[K\n'\ +' \033[2mram \033[0m %s\033[K\n'\ +' \033[2mswap \033[0m %s\033[K\n'\ +' \033[2mdisk \033[0m %s\033[K\n'\ +' \033[2mio \033[0m %s\033[K\n'\ +' \033[2mup \033[0m %s\033[K\n'\ +'\033[K\n'\ +' \033[31mnetwork\033[0m\033[K\n'\ +' \033[2mwifi \033[0m %s\033[K\n'\ +' \033[2mlink \033[0m %s\033[K\n'\ +' \033[2mygg \033[0m %s\033[K\n'\ +' \033[2mexit \033[0m %s\033[K\n'\ +' \033[2mpool \033[0m %s\033[K\n'\ +' \033[2mfeed \033[0m %s\033[K\n'\ +'\033[K\n'\ +' \033[31mtop\033[0m\033[K\n'\ +' %s\033[K\n'\ +' %s\033[K\n'\ +' %s\033[K\n'\ +' %s\033[K\n'\ +'\033[K\n'\ +' \033[2m[p] privacy%s [q] close\033[0m\033[K\n'\ +'\033[J\033[?2026l' \ + "$vpad" \ + "$(fit "$now" $((cols - 8)))" \ + "$(fit "${cap}% ${st_s}${eta}" "$maxv")" \ + "$(fit "${watts} · ${vstr}" "$maxv")" \ + "$(fit "${wh}" "$maxv")" \ + "$(fit "${health} · ${cyc} cyc" "$maxv")" \ + "$(fit "${ghz} · ${gov}" "$maxv")" \ + "$(fit "${load}" "$maxv")" \ + "$(fit "${t_cpu}C · pch ${t_pch}C · ssd ${t_nvme}C" "$maxv")" \ + "$(fit "${mem}" "$maxv")" \ + "$(fit "${swp}" "$maxv")" \ + "$(fit "${disk}" "$maxv")" \ + "$(fit "vol ${vol:-?} · bri ${bri:-?}" "$maxv")" \ + "$(fit "${up}" "$maxv")" \ + "$(fit "${ssid:-offline} ${sig:+($sig)}" "$maxv")" \ + "$(fit "${ip4:-none} ${rate:+· $rate}" "$maxv")" \ + "$(fit "${ygg:-down}" "$maxv")" \ + "$(fit "${vpn_exit}" "$maxv")" \ + "$(fit "${pool_info:-?}" "$maxv")" \ + "$(fit "${feed_last}" "$maxv")" \ + "$(fit "${p1:-}" $((cols - 4)))" \ + "$(fit "${p2:-}" $((cols - 4)))" \ + "$(fit "${p3:-}" $((cols - 4)))" \ + "$(fit "${p4:-}" $((cols - 4)))" \ + "$priv_tag" + + key=$(dd bs=1 count=1 2>/dev/null | tr '\n\r' ' ' || true) + case $key in + q|Q|$'\e'|' ') exit 0 ;; + p|P) priv=$((1 - priv)) ;; + esac +done diff --git a/dots/.local/bin/xiii-lock b/dots/.local/bin/xiii-lock @@ -0,0 +1,6 @@ +#!/bin/sh +[ -r "$HOME/.config/xiii/baseline.env" ] && . "$HOME/.config/xiii/baseline.env" +[ -r "$HOME/.cache/wallust/env.sh" ] && . "$HOME/.cache/wallust/env.sh" +command -v waylock >/dev/null 2>&1 || exit 0 +niri msg action switch-layout 0 >/dev/null 2>&1 || true +exec waylock -init-color "$LOCK_INIT" -input-color "$LOCK_INPUT" -fail-color "$LOCK_FAIL" diff --git a/dots/.local/bin/xiii-menu b/dots/.local/bin/xiii-menu @@ -0,0 +1,4 @@ +#!/bin/sh +[ -r "$HOME/.config/xiii/baseline.env" ] && . "$HOME/.config/xiii/baseline.env" +[ -r "$HOME/.cache/wallust/env.sh" ] && . "$HOME/.cache/wallust/env.sh" +exec wmenu-run -f "$MENU_FONT" -N "$WMENU_BG" -n "$WMENU_FG" -S "$WMENU_SEL_BG" -s "$WMENU_SEL_FG" diff --git a/dots/.local/bin/xiii-osd b/dots/.local/bin/xiii-osd @@ -0,0 +1,56 @@ +#!/bin/sh +set -eu +runtime=${XDG_RUNTIME_DIR:-} +display=${WAYLAND_DISPLAY:-wayland-0} +dir=$runtime/xiii-wob-${display##*/} +fifo=$dir/input +cfg=$HOME/.cache/wallust/wob.ini +[ -r "$cfg" ] || cfg=${XDG_CONFIG_HOME:-$HOME/.config}/wob/wob.ini +sink=@DEFAULT_AUDIO_SINK@ +export LC_ALL=C + +start_wob() { + [ -n "$runtime" ] && [ -d "$runtime" ] || exit 0 + mkdir -p "$dir" + exec 9>"$dir/lock" + flock -n 9 || exit 0 + [ -p "$fifo" ] || mkfifo "$fifo" + if [ -r "$cfg" ]; then + exec wob -c "$cfg" 0<>"$fifo" + fi + exec wob 0<>"$fifo" +} + +case ${1:-} in + start) start_wob ;; + restart) + pkill -x wob 2>/dev/null || true + sleep 0.1 + nohup "$0" start >/dev/null 2>&1 & + exit 0 + ;; + volume-up) wpctl set-volume "$sink" 5%+ -l 1.0 ;; + volume-down) wpctl set-volume "$sink" 5%- ;; + volume-up-fine) wpctl set-volume "$sink" 1%+ -l 1.0 ;; + volume-down-fine) wpctl set-volume "$sink" 1%- ;; + volume-mute) wpctl set-mute "$sink" toggle ;; + brightness-up) brightnessctl --class=backlight set +5% ;; + brightness-down) brightnessctl --class=backlight set 5%- ;; + brightness-up-fine) brightnessctl --class=backlight set +1% ;; + brightness-down-fine) brightnessctl --class=backlight set 1%- ;; + *) printf 'usage: %s {start|restart|volume-*|brightness-*}\n' "$0" >&2; exit 2 ;; +esac + +[ -n "$runtime" ] && [ -p "$fifo" ] || exit 0 +case $1 in + volume-*) + val=$(wpctl get-volume "$sink" 2>/dev/null) || exit 0 + out=$(printf '%s\n' "$val" | awk '{pct=int($2*100+0.5); if(pct>100)pct=100; if(index($0,"[MUTED]"))printf "%d muted",pct; else printf "%d",pct}') + ;; + brightness-*) + info=$(brightnessctl --class=backlight --machine-readable info 2>/dev/null) || exit 0 + out=$(printf '%s\n' "$info" | awk -F, 'NR==1{pct=$4; sub(/%/,"",pct); if(pct~/^[0-9]+$/)print pct}') + ;; +esac +[ -n "$out" ] || exit 0 +{ printf '%s\n' "$out" >"$fifo"; } 2>/dev/null || true diff --git a/dots/.local/bin/xiii-wall b/dots/.local/bin/xiii-wall @@ -0,0 +1,63 @@ +#!/bin/sh +set -eu +CACHE=$HOME/.cache/wallust +DEFAULT_WALL=$HOME/Pictures/wallpapers/saya.png +mkdir -p "$CACHE" + +write_baseline() { + cp -f "$HOME/.config/wob/wob.ini" "$CACHE/wob.ini" + cp -f "$HOME/.config/mako/config" "$CACHE/mako.conf" + cp -f "$HOME/.config/niri/baseline.kdl" "$CACHE/niri.kdl" + cp -f "$HOME/.config/foot/baseline.ini" "$CACHE/foot.ini" + cp -f "$HOME/.config/xiii/baseline.env" "$CACHE/env.sh" +} + +reload_desktop() { + if command -v niri >/dev/null 2>&1 && [ -n "${WAYLAND_DISPLAY:-}" ]; then + niri msg action load-config-file >/dev/null 2>&1 || true + fi + if [ -n "${WAYLAND_DISPLAY:-}" ]; then + pkill -x mako 2>/dev/null || true + if [ -r "$CACHE/mako.conf" ]; then + nohup mako -c "$CACHE/mako.conf" >/dev/null 2>&1 & + else + nohup mako >/dev/null 2>&1 & + fi + "$HOME/.local/bin/xiii-osd" restart >/dev/null 2>&1 || true + fi +} + +case ${1:-} in + --reset) + write_baseline + reload_desktop + printf 'Reverted theme to baseline defaults\n' + exit 0 + ;; + --restore) + [ -r "$CACHE/niri.kdl" ] && [ -r "$CACHE/foot.ini" ] || write_baseline + wall=$(cat "$CACHE/wallpaper" 2>/dev/null || true) + [ -r "$wall" ] || wall=$DEFAULT_WALL + pkill -x wbg 2>/dev/null || true + [ -r "$wall" ] && nohup wbg "$wall" >/dev/null 2>&1 & + pkill -x mako 2>/dev/null || true + if [ -r "$CACHE/mako.conf" ]; then + exec mako -c "$CACHE/mako.conf" + fi + exec mako + ;; + ""|-h|--help) + printf 'usage: xiii-wall <image> | --reset | --restore\n' >&2 + exit 2 + ;; +esac + +img=$(readlink -f "$1") +[ -r "$img" ] || { printf 'xiii-wall: not readable: %s\n' "$1" >&2; exit 1; } +printf '%s\n' "$img" > "$CACHE/wallpaper" +if [ -n "${WAYLAND_DISPLAY:-}" ]; then + pkill -x wbg 2>/dev/null || true + nohup wbg "$img" >/dev/null 2>&1 & +fi +wallust run -q "$img" +reload_desktop diff --git a/dots/bin/linkwatch.sh b/dots/bin/linkwatch.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# linkwatch: wait until the VPS answers, refresh mihomo's rule lists (their +# pulls fail at boot because mihomo starts before wifi has an address), then +# log ping loss to the VPS once a minute so stalls can be matched to the line. +VPS=${1:?usage: linkwatch.sh VPS-IP} +until ping -c 1 -w 3 $VPS >/dev/null 2>&1; do sleep 5; done +S=$(sed -n 's/^secret: *//p' /etc/mihomo/config.yaml | tr -d "\"'") +for p in games-direct geosite-ru geoip-ru ru-inline-banned; do + c=$(curl -s -o /dev/null -w '%{http_code}' -m 30 -X PUT -H "Authorization: Bearer $S" http://127.0.0.1:9090/providers/rules/$p) + echo "$(date '+%F %T') provider $p -> $c" +done +while :; do + out=$(ping -c 60 -i 1 $VPS 2>/dev/null | tail -2 | tr '\n' ' ') + echo "$(date '+%F %T') $out" +done diff --git a/home.scm b/home.scm @@ -0,0 +1,40 @@ +;; freya's home. apply: guix home reconfigure -L ~/.config/guix ~/.config/guix/home.scm + +(add-to-load-path (dirname (current-filename))) + +(use-modules (gnu home) + (gnu home services) + (gnu home services dotfiles) + (gnu home services shells) + (gnu home services desktop) + (gnu home services sound) + (gnu home services mcron) + (gnu packages) + (gnu services) + (guix gexp) + (theme)) + +(home-environment + (packages (specifications->packages '("witr" "mosh" "curl" "waylock" "wallust"))) + (services + (list + (service home-bash-service-type) + (service home-dbus-service-type) + (service home-pipewire-service-type) + (simple-service 'xiii-desktop-tools home-profile-service-type + (specifications->packages '("mako" "poweralertd" "wob"))) + ;; More frequent during Europe/Samara daytime (07..19), once overnight (03:20). + (service home-mcron-service-type + (home-mcron-configuration + (jobs (list #~(job "20 3,7-19 * * *" "/home/freya/.local/bin/free-feed"))))) + (simple-service 'xiii-theme-configs home-xdg-configuration-files-service-type + `(("foot/baseline.ini" ,(foot-baseline-ini)) + ("foot/foot.ini" ,(foot-ini)) + ("mako/config" ,(mako-conf)) + ("wob/wob.ini" ,(wob-ini)) + ("niri/baseline.kdl" ,(niri-baseline-kdl)) + ("xiii/baseline.env" ,(xiii-baseline-env)))) + (service home-dotfiles-service-type + (home-dotfiles-configuration + (directories '("dots")) + (excluded '(".*~" ".*\\.swp" "/\\.git/.*" "\\.gitignore" "/dots/bin/.*"))))))) diff --git a/system.scm b/system.scm @@ -0,0 +1,339 @@ +;; T480, coreboot (libreboot-style 26.10). nvme0n1p1 esp, p2 luks2 argon2id +;; -> ext4 labelled "xiii-root" (must match e2label). grub 2.14 unlocks luks2 argon2id; +;; if it can't, convert the keyslot: cryptsetup luksConvertKey --pbkdf argon2id --pbkdf-memory 131072 +;; grub prompt is uk qwerty. + +(use-modules (gnu) + (gnu services networking) + (gnu services desktop) + (gnu services dbus) + (gnu services sysctl) + (gnu services shepherd) + (gnu services ssh) + (gnu system privilege) + (gnu system setuid) + (guix packages) + (guix utils)) + +(load "private.scm") + +(use-package-modules admin base bash curl fonts linux pciutils ssh version-control) + +;; userns stay on, the unprivileged daemon needs them +(define %sysctl-hardening + '(("kernel.dmesg_restrict" . "1") + ("kernel.kptr_restrict" . "2") + ("kernel.yama.ptrace_scope" . "1") + ("kernel.kexec_load_disabled" . "1") + ("kernel.unprivileged_bpf_disabled" . "1") + ("net.core.bpf_jit_harden" . "2") + ("kernel.perf_event_paranoid" . "3") + ("kernel.io_uring_disabled" . "2") + ("kernel.sysrq" . "0") + ("dev.tty.ldisc_autoload" . "0") + ("fs.protected_fifos" . "2") + ("fs.protected_regular" . "2") + ("fs.protected_symlinks" . "1") + ("fs.protected_hardlinks" . "1") + ("fs.suid_dumpable" . "0") + ("net.core.rmem_max" . "16777216") + ("net.core.wmem_max" . "16777216") + ("net.core.rmem_default" . "1048576") + ("net.core.wmem_default" . "1048576") + ("net.ipv4.tcp_rmem" . "4096 131072 16777216") + ("net.ipv4.tcp_wmem" . "4096 65536 16777216") + ("net.ipv4.conf.all.rp_filter" . "2") ; loose, for mihomo tun + ("net.ipv4.conf.default.rp_filter" . "2") + ("net.ipv4.conf.all.accept_redirects" . "0") + ("net.ipv4.conf.default.accept_redirects" . "0") + ("net.ipv6.conf.all.accept_redirects" . "0") + ("net.ipv6.conf.default.accept_redirects" . "0") + ("net.ipv4.conf.all.send_redirects" . "0") + ("net.ipv4.conf.default.send_redirects" . "0") + ("net.ipv4.conf.all.accept_source_route" . "0") + ("net.ipv4.conf.default.accept_source_route" . "0") + ("net.ipv6.conf.all.accept_source_route" . "0") + ("net.ipv6.conf.default.accept_source_route" . "0") + ("net.ipv4.tcp_syncookies" . "1") + ("net.ipv4.icmp_echo_ignore_broadcasts" . "1"))) + +(define %nftables-ruleset + (plain-file "nftables.conf" (string-append "\ +table inet filter { + chain input { + type filter hook input priority 0; policy drop; + ct state invalid drop + ct state { established, related } accept + iif lo accept + # Meta is mihomo's tun interface; its system stack hands connections back in here + iifname Meta accept + # yggdrasil: only the hark vps may reach sshd + iifname ygg0 ip6 saddr " %vps-ygg " tcp dport 2022 accept + iif != lo ip daddr 127.0.0.0/8 drop + iif != lo ip6 daddr ::1/128 drop + ip protocol icmp icmp type { destination-unreachable, time-exceeded, parameter-problem } accept + meta l4proto ipv6-icmp icmpv6 type { destination-unreachable, packet-too-big, time-exceeded, parameter-problem, mld-listener-query, nd-router-advert, nd-neighbor-solicit, nd-neighbor-advert } accept + } + chain forward { + type filter hook forward priority 0; policy drop; + } + chain output { + type filter hook output priority 0; policy accept; + } +} +"))) + +(define %privileged-programs + (cons* (privileged-program + (program (file-append inetutils "/bin/ping")) + (capabilities "cap_net_raw=ep")) + (privileged-program + (program (file-append inetutils "/bin/ping6")) + (capabilities "cap_net_raw=ep")) + (map file-like->setuid-program + (list (file-append shadow "/bin/passwd") + (file-append shadow "/bin/newuidmap") + (file-append shadow "/bin/newgidmap") + (file-append (specification->package "opendoas") "/bin/doas") + (file-append fuse "/bin/fusermount3"))))) + +;; whonix machine-id, shared on purpose +(define %whonix-machine-id + (simple-service 'shared-machine-id activation-service-type + #~(call-with-output-file "/etc/machine-id" + (lambda (port) (display "b08dfa6083e7567a1921a715000001fb\n" port))))) + +;; mask correctable pcie rxerr spam from the ath9k +(define %ath9k-aer-quiet + (simple-service 'ath9k-aer-quiet shepherd-root-service-type + (list (shepherd-service + (provision '(ath9k-aer-quiet)) + (requirement '(udev)) + (one-shot? #t) + (documentation + "Turn off ASPM L0s on the wifi card (it makes the link throw +RxErr/BadDLLP errors) and mask RxErr AER reports from it.") + (start #~(lambda _ + (false-if-exception + (call-with-output-file + "/sys/bus/pci/devices/0000:01:00.0/link/l0s_aspm" + (lambda (port) (display "0" port)))) + (zero? (system* #$(file-append pciutils "/sbin/setpci") + "-s" "01:00.0" + "ECAP_AER+14.l=00000001:00000001")))))))) + +;; zstd is a module, so set it after boot +(define %zswap-zstd + (simple-service 'zswap-zstd shepherd-root-service-type + (list (shepherd-service + (provision '(zswap-zstd)) + (requirement '(file-systems)) + (one-shot? #t) + (documentation "Use zstd for zswap.") + (start #~(lambda _ + (call-with-output-file + "/sys/module/zswap/parameters/compressor" + (lambda (port) (display "zstd" port))) + #t)))))) + +(define %mihomo + (simple-service 'mihomo shepherd-root-service-type + (list (shepherd-service + (provision '(mihomo)) + (requirement '(networking)) + (documentation "mihomo proxy, config in /etc/mihomo.") + (start #~(make-forkexec-constructor + (list #$(file-append + (local-file "/etc/mihomo/mihomo" "mihomo-bin" + #:recursive? #t)) + "-d" "/etc/mihomo") + #:log-file "/var/log/mihomo.log")) + (stop #~(make-kill-destructor)) + (respawn? #t))))) + +(define %linkwatch + (simple-service 'linkwatch shepherd-root-service-type + (list (shepherd-service + (provision '(linkwatch)) + (requirement '(mihomo)) + (documentation "Refresh mihomo rules, log VPS ping loss.") + (start #~(make-forkexec-constructor + (list #$(file-append bash-minimal "/bin/sh") + #$(local-file "dots/bin/linkwatch.sh") + %vps-ip) + #:environment-variables + (list (string-append "PATH=" #$inetutils "/bin:" #$curl "/bin:" + #$coreutils "/bin:" #$sed "/bin")) + #:log-file "/var/log/linkwatch.log")) + (stop #~(make-kill-destructor)) + (respawn? #t))))) + +(define %hark-pub + (plain-file "hark-into-xiii.pub" (string-append + "from=\"127.0.0.1,::1," %vps-ygg "\" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKAeU3T+bmy5xBXDZGXn2YZuRlSo+uuygcaLTwP3JKdS hark-into-xiii\n"))) + +;; off by default: doas herd start/stop hark-tunnel +(define %hark-tunnel + (simple-service 'hark-tunnel shepherd-root-service-type + (list (shepherd-service + (provision '(hark-tunnel)) + (requirement '(networking ssh-daemon)) + (documentation "Reverse ssh tunnel for hark (VPS :2222 -> :2022).") + (start #~(make-forkexec-constructor + (list #$(file-append openssh "/bin/ssh") + "-i" "/etc/xiii-tun/id_ed25519" "-N" "-T" + "-o" "BatchMode=yes" + "-o" "ExitOnForwardFailure=yes" + "-o" "ServerAliveInterval=15" + "-o" "ServerAliveCountMax=3" + "-o" "UserKnownHostsFile=/etc/xiii-tun/known_hosts" + "-o" "StrictHostKeyChecking=yes" + "-R" "2222:127.0.0.1:2022" + (string-append "utopia@" %vps-ip)) + #:log-file "/var/log/hark-tunnel.log")) + (stop #~(make-kill-destructor)) + (auto-start? #f) + (respawn? #t) + (respawn-delay 20))))) + +(operating-system + (host-name "XIII") + (timezone "Europe/Samara") + + (kernel-arguments + (cons* "slab_nomerge" + "modprobe.blacklist=pcspkr" + "video.brightness_switch_enabled=0" + "randomize_kstack_offset=on" + "page_alloc.shuffle=1" + "init_on_alloc=1" + "proc_mem.force_override=never" + "zswap.enabled=1" + "zswap.shrinker_enabled=1" + %default-kernel-arguments)) + (locale "en_US.utf8") + + (keyboard-layout (keyboard-layout "us" "colemak")) + + (bootloader + (bootloader-configuration + (bootloader grub-efi-removable-bootloader) + (targets '("/boot/efi")))) + + (mapped-devices + (list (mapped-device + (source (uuid "c91d48ca-fd71-4b0d-a714-257be36343ac")) + (target "cryptroot") + (type luks-device-mapping)))) + + (file-systems + (append + (list (file-system + (mount-point "/") + (device (file-system-label "xiii-root")) + (type "ext4") + (dependencies mapped-devices)) + (file-system + (mount-point "/boot/efi") + (device (uuid "AFED-ED88" 'fat32)) + (type "vfat"))) + %base-file-systems)) + + (swap-devices + (list (swap-space + (target "/swapfile") + (dependencies (filter (file-system-mount-point-predicate "/") + file-systems))))) + + (users + (cons (user-account + (name "freya") + (group "users") + (supplementary-groups '("wheel" "audio" "video" "input" "netdev"))) + %base-user-accounts)) + + (privileged-programs %privileged-programs) + + (packages + (append + (specifications->packages + '("niri" + "wlsunset" "nvi" + "foot" "wmenu" "wbg" + "iwd" "cryptsetup" "git" "mpv" + "brightnessctl" "alsa-utils" + "wl-clipboard" "cliphist" + "font-spleen" "font-ipa-ex")) + %base-packages)) + + (services + (append + (list (service yggdrasil-service-type + (yggdrasil-configuration + (autoconf? #f) + (json-config '((peers . #("tls://server.i113d.ru:12632" "ws://mskaeza.i113d.ru:12634")) + (IfName . "ygg0"))))) + (service iwd-service-type + (iwd-configuration + (shepherd-provision '(iwd wireless-daemon networking)) + (config + (iwd-settings + (general (iwd-general-settings + (enable-network-configuration? #t) + (extra-options '(("AddressRandomization" . "network"))))) + (network (iwd-network-settings + (name-resolving-service 'resolvconf))))))) + (service elogind-service-type + (elogind-configuration + (handle-lid-switch 'ignore) + (handle-lid-switch-external-power 'ignore))) + (service dbus-root-service-type) + (service polkit-service-type) + (service upower-service-type + (upower-configuration + (ignore-lid? #t) + (use-percentage-for-policy? #t) + (percentage-low 20) + (percentage-critical 10) + (percentage-action 5) + (critical-power-action 'power-off))) + (service ntp-service-type) + (service nftables-service-type + (nftables-configuration (ruleset %nftables-ruleset))) + (simple-service 'doas-conf activation-service-type + #~(let ((tmp "/etc/doas.conf.new")) + (copy-file #$(plain-file "doas.conf" "permit persist setenv { TERMINFO_DIRS PATH } :wheel\n") tmp) + (chown tmp 0 0) + (rename-file tmp "/etc/doas.conf"))) + %whonix-machine-id + %ath9k-aer-quiet + %zswap-zstd + %mihomo + %linkwatch + (service openssh-service-type + (openssh-configuration + (port-number 2022) + (permit-root-login 'prohibit-password) + (password-authentication? #f) + (authorized-keys `(("root" ,%hark-pub))))) + %hark-tunnel + (udev-rules-service 'brightnessctl (specification->package "brightnessctl"))) + (modify-services %base-services + (console-font-service-type config => + (map (lambda (tty) (cons (car tty) #~(string-append #$font-spleen:psf "/share/consolefonts/spleen-12x24.psfu"))) config)) + (sysctl-service-type config => + (sysctl-configuration + (inherit config) + (settings (append (sysctl-configuration-settings config) + %sysctl-hardening)))) + (guix-service-type config => + (guix-configuration + (inherit config) + (privileged? #f) + (http-proxy "http://127.0.0.1:1080") + (substitute-urls (cons* "https://mirror.yandex.ru/mirrors/guix" "https://cache-fi.guix.moe" + (append %default-substitute-urls + (list "https://substitutes.nonguix.org")))) + (authorized-keys + (cons (plain-file "nonguix.pub" "(public-key (ecc (curve Ed25519) (q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#)))") + %default-authorized-guix-keys)))))))) diff --git a/theme.scm b/theme.scm @@ -0,0 +1,131 @@ +(define-module (theme) + #:use-module (guix gexp) + #:export (%palette + pal + hex + foot-ini + foot-baseline-ini + mako-conf + wob-ini + niri-baseline-kdl + xiii-baseline-env)) + +(define %palette + '((font . "MonoLisa Freezed") + (font-size . "11.5") + (hud-font . "MonoLisa Freezed 10.5") + (alpha . "0.93") + (bg . "0e0f10") + (surface . "161819") + (border-dim . "26282a") + (fg . "d6d8d4") + (fg-bright . "e4e6e2") + (muted . "44484a") + (dim-fg . "a8aca8") + (accent . "b82436") + (accent-hi . "d43548") + (green . "6e8f66") + (green-hi . "86a87d") + (yellow . "a89962") + (yellow-hi . "c2b278") + (blue . "5e7b99") + (blue-hi . "7897b5") + (purple . "8c7aa3") + (purple-hi . "a694bd") + (cyan . "5c8582") + (cyan-hi . "75a19d"))) + +(define (pal key) + (cdr (assoc key %palette))) + +(define (hex key) + (string-append "#" (pal key))) + +(define (foot-baseline-ini) + (mixed-text-file "foot-baseline.ini" + "[colors-dark]\n" + "alpha=" (pal 'alpha) "\n" + "cursor=" (pal 'bg) " " (pal 'fg) "\n" + "background=" (pal 'bg) "\n" + "foreground=" (pal 'fg) "\n" + "regular0=" (pal 'surface) "\n" + "regular1=" (pal 'accent) "\n" + "regular2=" (pal 'green) "\n" + "regular3=" (pal 'yellow) "\n" + "regular4=" (pal 'blue) "\n" + "regular5=" (pal 'purple) "\n" + "regular6=" (pal 'cyan) "\n" + "regular7=" (pal 'dim-fg) "\n" + "bright0=" (pal 'muted) "\n" + "bright1=" (pal 'accent-hi) "\n" + "bright2=" (pal 'green-hi) "\n" + "bright3=" (pal 'yellow-hi) "\n" + "bright4=" (pal 'blue-hi) "\n" + "bright5=" (pal 'purple-hi) "\n" + "bright6=" (pal 'cyan-hi) "\n" + "bright7=" (pal 'fg-bright) "\n" + "selection-foreground=" (pal 'fg-bright) "\n" + "selection-background=" (pal 'border-dim) "\n")) + +(define (foot-ini) + (mixed-text-file "foot.ini" + "font=" (pal 'font) ":size=" (pal 'font-size) "," + "MonoLisaFreezed Nerd Font:size=" (pal 'font-size) "\n" + "pad=8x8\n\n" + "[scrollback]\nlines=10000\n\n" + "[cursor]\nstyle=block\nblink=no\n\n" + "[mouse]\nhide-when-typing=yes\n\n" + "[main]\n" "include=/home/freya/.config/foot/baseline.ini\n" + "include=/home/freya/.cache/wallust/foot.ini\n")) + +(define (mako-conf) + (mixed-text-file "mako.conf" + "font=" (pal 'hud-font) "\n" + "background-color=" (hex 'bg) "f2\n" + "text-color=" (hex 'fg) "ff\n" + "border-color=" (hex 'accent) "ff\n" + "border-size=1\n" + "border-radius=0\n" + "padding=10,14\n" + "default-timeout=4000\n\n" + "[urgency=high]\n" + "border-color=" (hex 'accent-hi) "ff\n" + "default-timeout=0\n")) + +(define (wob-ini) + (mixed-text-file "wob.ini" + "timeout = 900\n" + "height = 24\n" + "width = 280\n" + "border_offset = 0\n" + "border_size = 1\n" + "bar_padding = 3\n" + "anchor = top right\n" + "margin = 20\n" + "background_color = " (pal 'bg) "f2\n" + "border_color = " (pal 'accent) "ff\n" + "bar_color = " (pal 'fg) "ff\n" + "overflow_background_color = " (pal 'bg) "f2\n" + "overflow_border_color = " (pal 'accent-hi) "ff\n" + "overflow_bar_color = " (pal 'accent) "ff\n")) + +(define (niri-baseline-kdl) + (mixed-text-file "niri-baseline.kdl" + "layout {\n" + " border {\n" + " active-color \"" (hex 'accent) "\"\n" + " inactive-color \"" (hex 'border-dim) "\"\n" + " urgent-color \"" (hex 'accent-hi) "\"\n" + " }\n" + "}\n")) + +(define (xiii-baseline-env) + (mixed-text-file "baseline.env" + "MENU_FONT=\"" (pal 'font) " " (pal 'font-size) "\"\n" + "WMENU_BG=" (pal 'bg) "\n" + "WMENU_FG=" (pal 'fg) "\n" + "WMENU_SEL_BG=" (pal 'accent) "\n" + "WMENU_SEL_FG=" (pal 'bg) "\n" + "LOCK_INIT=0x" (pal 'bg) "\n" + "LOCK_INPUT=0x" (pal 'blue) "\n" + "LOCK_FAIL=0x" (pal 'accent) "\n")) diff --git a/trusted-channels.scm b/trusted-channels.scm @@ -0,0 +1,20 @@ +(list (channel + (name 'guix) + (url "https://git.guix.gnu.org/guix.git") + (branch "master") + (commit "5cce519530fca225922824a4a61df04136284442") + (introduction + (make-channel-introduction + "9edb3f66fd807b096b48283debdcddccfea34bad" + (openpgp-fingerprint + "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA")))) + (channel + (name 'nonguix) + (url "https://gitlab.com/nonguix/nonguix") + (branch "master") + (commit "25226c35c150f03d469b0c855d10b2402a094bc1") + (introduction + (make-channel-introduction + "897c1a470da759236cc11798f4e0a5f7d4d59fbc" + (openpgp-fingerprint + "2A39 3FFF 68F4 EF7A 3D29 12AF 6F51 20A0 22FB B2D5")))))