Explorar el Código

Sync: 2026-08-01 12:14:26

Gabriel Capella hace 2 días
padre
commit
d10a9e285e
Se han modificado 3 ficheros con 201 adiciones y 3 borrados
  1. 113 0
      bootstrap
  2. 84 0
      pkglist
  3. 4 3
      start

+ 113 - 0
bootstrap

@@ -0,0 +1,113 @@
+#!/bin/bash
+
+# System-level state that dotsync cannot manage.
+#
+# dotsync deals in unprivileged $HOME symlinks; this covers the things that live
+# outside $HOME and need root: enabled units and /etc drop-ins. Kept as a plain
+# script rather than using the @host/@group markers, because those only apply to
+# files deployed into $HOME.
+#
+# Idempotent -- safe to re-run. Run after 'dotsync packages'.
+#
+#     ./bootstrap
+
+set -euo pipefail
+
+hostname_id=$(uname -n)
+
+RED='\033[0;31m'
+GREEN='\033[0;32m'
+YELLOW='\033[1;33m'
+NC='\033[0m'
+log_info() { echo -e "${GREEN}[INFO]${NC} $*"; }
+log_warn() { echo -e "${YELLOW}[WARN]${NC} $*" >&2; }
+log_error() { echo -e "${RED}[ERROR]${NC} $*" >&2; }
+
+if [[ $EUID -eq 0 ]]; then
+    log_error "Run as your normal user, not root -- user units need your session."
+    exit 1
+fi
+
+# Write a file only if its content differs, so re-runs stay quiet and we avoid
+# needlessly restarting units.
+install_file() {
+    local dest="$1" content="$2"
+    if [[ -f "$dest" ]] && [[ "$(cat "$dest")" == "$content" ]]; then
+        return 1
+    fi
+    sudo mkdir -p "$(dirname "$dest")"
+    printf '%s\n' "$content" | sudo tee "$dest" >/dev/null
+    log_info "Wrote $dest"
+    return 0
+}
+
+enable_unit() {
+    local unit="$1"
+    if systemctl is-enabled --quiet "$unit" 2>/dev/null; then
+        return 0
+    fi
+    log_info "Enabling $unit"
+    sudo systemctl enable "$unit"
+}
+
+enable_user_unit() {
+    local unit="$1"
+    if systemctl --user is-enabled --quiet "$unit" 2>/dev/null; then
+        return 0
+    fi
+    log_info "Enabling (user) $unit"
+    systemctl --user enable "$unit"
+}
+
+log_info "Bootstrapping system state for $hostname_id"
+
+reload_needed=0
+
+# ---------------------------------------------------------------------------
+# logind: do not kill user processes at session end.
+#
+# The default (KillUserProcesses=yes) tears down lingering processes when the
+# last session for a user closes. That kills etterminal, which aborts the whole
+# etserver -- it broke Eternal Terminal on tompot. Declared explicitly on every
+# host so the two machines cannot drift on it again.
+#
+# A drop-in rather than an edit to /etc/systemd/logind.conf: package upgrades
+# replace that file, drop-ins survive.
+# ---------------------------------------------------------------------------
+if install_file /etc/systemd/logind.conf.d/10-kill-user-processes.conf \
+"[Login]
+KillUserProcesses=no"; then
+    reload_needed=1
+fi
+
+# ---------------------------------------------------------------------------
+# iwd: shorten the stop timeout so shutdown isn't held up for 90s.
+# ---------------------------------------------------------------------------
+if install_file /etc/systemd/system/iwd.service.d/timeout.conf \
+"[Service]
+TimeoutStopSec=5"; then
+    reload_needed=1
+fi
+
+if [[ $reload_needed -eq 1 ]]; then
+    log_info "Reloading systemd"
+    sudo systemctl daemon-reload
+fi
+
+# ---------------------------------------------------------------------------
+# System units
+# ---------------------------------------------------------------------------
+for unit in bluetooth.service greetd.service iwd.service \
+            systemd-timesyncd.service tlp.service; do
+    enable_unit "$unit"
+done
+
+# ---------------------------------------------------------------------------
+# User units
+# ---------------------------------------------------------------------------
+for unit in wluma.service; do
+    enable_user_unit "$unit"
+done
+
+log_info "Bootstrap complete"
+log_warn "logind changes only take full effect after a reboot or full logout."

+ 84 - 0
pkglist

@@ -0,0 +1,84 @@
+adwaita-qt6
+ansible
+base
+base-devel
+bemenu
+bind
+blender
+bluez
+bluez-utils
+cliphist
+cloudflared
+docker
+docker-compose
+efibootmgr
+eternalterminal-client
+firefox
+firejail
+fish
+fuzzel
+fzf
+gamescope
+ghostty
+git
+google-chrome
+greetd
+grim
+grub
+gtklock
+htop
+hyperfine
+iwd
+jq
+kubectl
+kubeseal
+kvantum
+libcamera
+libcamera-ipa
+libcamera-tools
+light
+linux
+linux-firmware
+llvm
+mako
+man-db
+nmap
+noto-fonts-emoji
+ollama
+openssh
+otf-font-awesome
+pavucontrol
+pipewire
+plymouth
+podman
+pulseaudio
+python-pipenv
+qt6ct-kde
+qt6pas
+slurp
+sof-firmware
+spotify-player
+subsurface-git
+sudo
+sway
+swayidle
+terminus-font
+terraform
+thin-provisioning-tools
+tlp
+tlp-rdw
+tlpui
+ttf-b612
+ttf-jetbrains-mono
+vim
+vulkan-intel
+waybar
+wdisplays
+wl-clipboard
+wluma
+woff2-font-awesome
+wtype
+xdg-utils
+xf86-input-libinput
+xorg-xwayland
+yay

+ 4 - 3
start

@@ -310,9 +310,10 @@ sub_sync(){
     done
 
     git add start to_sync
-    # Stage host-specific, group-specific, and groups files
-    for f in to_sync.* groups.*; do
-        [[ -f "$f" ]] && git add "$f"
+    [[ -f bootstrap ]] && git add bootstrap
+    # Stage host-specific, group-specific, and groups files, plus package lists
+    for f in to_sync.* groups.* pkglist pkglist.*; do
+        [[ -f "$f" ]] && git add "$f" || true
     done
     for d in dots.*/; do
         [[ -d "$d" ]] && git add "$d"