diff --git a/airootfs/root/.gnupg/scdaemon.conf b/.gnupg/scdaemon.conf similarity index 100% rename from airootfs/root/.gnupg/scdaemon.conf rename to .gnupg/scdaemon.conf diff --git a/README.md b/README.md index ff7b2b7..d34027b 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ This project allows you to generate a fully customized Arch Linux installation I - Automated install scripts - Custom configs (dotfiles, system settings) - Reproducible builds +- Support for your own packages built from source --- diff --git a/airootfs/root/.config/hypr/hyprland.lua b/airootfs/root/.config/hypr/hyprland.lua index 6042cd7..5c7016f 100644 --- a/airootfs/root/.config/hypr/hyprland.lua +++ b/airootfs/root/.config/hypr/hyprland.lua @@ -276,9 +276,8 @@ for i = 1, 10 do local keycode = 9 + i -- 10=1, 11=2, 12=3 ... 18=9, 19=0 local key_str = "code:" .. keycode - -- Utilisation de exec_cmd pour éviter les erreurs d'API (workspace est une table, pas une fonction) - hl.bind(mainMod .. " + " .. key_str, hl.dsp.exec_cmd("workspace " .. i)) - hl.bind(mainMod .. " + SHIFT + " .. key_str, hl.dsp.exec_cmd("movetoworkspace " .. i)) + hl.bind(mainMod .. " + " .. key_str, hl.dsp.exec_cmd("hyprctl dispatch workspace " .. i)) + hl.bind(mainMod .. " + SHIFT + " .. key_str, hl.dsp.exec_cmd("hyprctl dispatch movetoworkspace " .. i)) end -- Example special workspace (scratchpad) diff --git a/build.sh b/build.sh index d632124..93a9ca3 100755 --- a/build.sh +++ b/build.sh @@ -11,6 +11,7 @@ set -e ISO_NAME="arch-custom-iso" # On récupère le nom de l'utilisateur normal (pas root) pour makepkg BUILD_USER="${SUDO_USER:-root}" +CUSTOM_PKGS_DIR="$PWD/custom-pkgs" # ============================================================================== # LES LISTES DE PAQUETS @@ -51,7 +52,7 @@ echo "[1/5] Cleaning previous build..." rm -rf work out offline_cache # --- TÉLÉCHARGEMENT DES PAQUETS OFFICIELS --- -echo "[2/5] Downloading Official Packages for offline cache..." +echo "[2/6] Downloading Official Packages for offline cache..." # On utilise /tmp pour éviter tout problème de permissions dans le Home TMP_CACHE="/tmp/archiso_cache_$$" mkdir -p "$TMP_CACHE" @@ -65,8 +66,25 @@ mkdir -p offline_cache cp "$TMP_CACHE"/*.pkg.tar.zst offline_cache/ 2>/dev/null || true rm -rf "$TMP_CACHE" +# --- COMPILATION DES PAQUETS PERSONNALISÉS --- +echo "[3/6] Building custom packages from custom-pkgs/..." +mkdir -p custom_pkg_build +for pkg_dir in "$CUSTOM_PKGS_DIR"/*; do + [ -d "$pkg_dir" ] || continue + [ -f "$pkg_dir/PKGBUILD" ] || continue + + pkg_name=$(basename "$pkg_dir") + echo " -> Building custom package: $pkg_name" + rm -rf "custom_pkg_build/$pkg_name" + cp -a "$pkg_dir" "custom_pkg_build/$pkg_name" + chown -R "$BUILD_USER":"$BUILD_USER" "custom_pkg_build/$pkg_name" + sudo -u "$BUILD_USER" bash -lc "cd '$PWD/custom_pkg_build/$pkg_name' && makepkg -f --noconfirm --needed" + mv "custom_pkg_build/$pkg_name"/*.pkg.tar.zst offline_cache/ 2>/dev/null || true +done +rm -rf custom_pkg_build + # --- COMPILATION DES PAQUETS AUR --- -echo "[3/5] Building AUR Packages for offline cache..." +echo "[4/6] Building AUR Packages for offline cache..." mkdir -p aur_build for pkg in "${AUR_PACKAGES[@]}"; do @@ -89,13 +107,18 @@ done rm -rf aur_build # --- INJECTION DANS L'ISO --- -echo "[4/5] Injecting offline cache into ISO skeleton..." +echo "[5/6] Injecting offline cache into ISO skeleton..." mkdir -p airootfs/root/offline_cache cp offline_cache/*.pkg.tar.zst airootfs/root/offline_cache/ rm -rf offline_cache +# Copier les scripts personnalisés dans la racine du live system si nécessaire +mkdir -p airootfs/usr/local/bin +cp custom-pkgs/hello-custom/hello-custom.sh airootfs/usr/local/bin/hello-custom 2>/dev/null || true +chmod +x airootfs/usr/local/bin/hello-custom 2>/dev/null || true + # --- CRÉATION DE L'ISO --- -echo "[5/5] Building ISO (this will take a while)..." +echo "[6/6] Building ISO (this will take a while)..." sudo mkarchiso -v . if [ -f out/*.iso ]; then diff --git a/custom-pkgs/README.md b/custom-pkgs/README.md new file mode 100644 index 0000000..4de369a --- /dev/null +++ b/custom-pkgs/README.md @@ -0,0 +1,18 @@ +# Paquets personnalisés + +Place ici les sources de tes applications personnelles. + +Structure recommandée : + +- custom-pkgs/my-app/ + - PKGBUILD + - .SRCINFO (généré automatiquement) + - src/ + +Exemple rapide : + +- une application en C/C++/Rust/Go/Python +- un script shell autonome +- un binaire déjà compilé + +Pour une application non disponible sur pacman/AUR, la méthode la plus propre est de la packager avec un PKGBUILD puis de la construire dans le build ISO. diff --git a/custom-pkgs/fastfetch/PKGBUILD b/custom-pkgs/fastfetch/PKGBUILD new file mode 100644 index 0000000..cd42917 --- /dev/null +++ b/custom-pkgs/fastfetch/PKGBUILD @@ -0,0 +1,18 @@ +# Maintainer: Ton Nom + +pkgname=optifetch +pkgver=1.0 +pkgrel=1 +pkgdesc='Version personnalisée de fastfetch intégrée dans l\'ISO' +arch=('x86_64') +url='https://example.com/ton-projet' +license=('MIT') +depends=('gcc' 'make') +source=("optifetch::git+https://github.com/arthur-pbty/optifetch.git") +sha256sums=('SKIP') + +pkg() { + cd "$srcdir/optifetch" + make + install -Dm0755 optifetch "$pkgdir/usr/bin/optifetch" +} diff --git a/custom-pkgs/hello-custom/PKGBUILD b/custom-pkgs/hello-custom/PKGBUILD new file mode 100644 index 0000000..933f026 --- /dev/null +++ b/custom-pkgs/hello-custom/PKGBUILD @@ -0,0 +1,14 @@ +# Maintainer: Ton Nom + +pkgname=hello-custom +pkgver=1.0 +pkgrel=1 +pkgdesc='Petit exemple de programme personnalisé à intégrer dans l\'ISO' +arch=('x86_64') +license=('MIT') +source=("hello-custom.sh") +sha256sums=('SKIP') + +package() { + install -Dm0755 "$srcdir/hello-custom.sh" "$pkgdir/usr/bin/hello-custom" +} diff --git a/custom-pkgs/hello-custom/hello-custom.sh b/custom-pkgs/hello-custom/hello-custom.sh new file mode 100644 index 0000000..991c86c --- /dev/null +++ b/custom-pkgs/hello-custom/hello-custom.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail + +echo "Hello from my custom app!" +echo "This binary was built from source and included in the ISO." diff --git a/packages.x86_64 b/packages.x86_64 index b519f73..1530fb3 100644 --- a/packages.x86_64 +++ b/packages.x86_64 @@ -126,3 +126,4 @@ xdg-utils xfsprogs xl2tpd zsh +hello-custom diff --git a/scripts/00-custom-setup.sh b/scripts/00-custom-setup.sh new file mode 100644 index 0000000..e1fd6a0 --- /dev/null +++ b/scripts/00-custom-setup.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Ce script est exécuté dans l'environnement du live ISO +# Il peut installer/mettre en place des éléments personnalisés. + +echo "[custom] Configuration personnalisée de l'ISO" + +# Exemple: créer un dossier pour tes applis perso +mkdir -p /usr/local/bin /usr/local/share/my-apps + +# Si tu as déjà un binaire compilé, tu peux l'ajouter ici. +# Exemple: +# install -Dm0755 /root/custom-app /usr/local/bin/custom-app + +# Si tu veux rendre un script disponible globalement: +# install -Dm0755 /root/custom-scripts/hello.sh /usr/local/bin/hello.sh