From ab8abc1979ec2ea093190ed081346a61ed6bd404 Mon Sep 17 00:00:00 2001 From: Phantop Date: Fri, 25 Oct 2024 12:18:45 -0400 Subject: [PATCH] add setup script testing workflow --- .github/workflows/setup.yml | 33 ++++++++++++++++++++++++++++++++ arch/devkitpro.conf | 4 ++++ arch/dwarfs-universal | 38 +++++++++++++++++++++++++++++++++++++ archpkgs => arch/packages | 6 ++++-- arch/pacman.conf | 6 ++++++ bin/setup | 37 +++++++++++++++++++++--------------- 6 files changed, 107 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/setup.yml create mode 100644 arch/devkitpro.conf create mode 100644 arch/dwarfs-universal rename archpkgs => arch/packages (98%) create mode 100644 arch/pacman.conf diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml new file mode 100644 index 0000000..143b5df --- /dev/null +++ b/.github/workflows/setup.yml @@ -0,0 +1,33 @@ +name: Test dotfiles run + +on: + workflow_dispatch: # allow manual trigger + push: + branches: + - main + + +jobs: + setup: # try setting up user with setup script + runs-on: ubuntu-latest + container: archlinux:latest + + steps: + - name: Install git on container and add user + run: | + pacman -Sy --noconfirm git opendoas + pacman-key --init + useradd -m glados -G wheel + echo permit nopass :wheel > /etc/doas.conf + - name: Checkout repo + uses: actions/checkout@v4 + - name: Run setup + run: | + cp -r /__w/dotfiles/dotfiles /home/glados/.dotfiles + su glados -c /home/glados/.dotfiles/bin/setup + mkdwarfs -i /home/glados -o /home.dwarfs + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: home.dwarfs + path: /home.dwarfs diff --git a/arch/devkitpro.conf b/arch/devkitpro.conf new file mode 100644 index 0000000..ab3fa36 --- /dev/null +++ b/arch/devkitpro.conf @@ -0,0 +1,4 @@ +[dkp-libs] +Server = https://pkg.devkitpro.org/packages +[dkp-linux] +Server = https://pkg.devkitpro.org/packages/linux/$arch/ diff --git a/arch/dwarfs-universal b/arch/dwarfs-universal new file mode 100644 index 0000000..e168c59 --- /dev/null +++ b/arch/dwarfs-universal @@ -0,0 +1,38 @@ +# Maintainer: phantop +pkgname=dwarfs-universal +pkgver=0.10.1 +pkgrel=1 +pkgdesc='A fast high compression read-only file system (pre-compiled binaries)' +url='https://github.com/mhx/dwarfs' +source=("https://github.com/mhx/dwarfs/releases/download/v${pkgver}/dwarfs-${pkgver}-Linux-${CARCH}-clang.tar.xz" + "https://github.com/mhx/dwarfs/releases/download/v${pkgver}/dwarfs-universal-${pkgver}-Linux-${CARCH}-clang" + "https://github.com/mhx/dwarfs/raw/main/scripts/extract_blocks.py") +arch=('x86_64' 'aarch64') +license=('GPL3') +depends=( 'fuse3' ) +conflicts=('dwarfs') +provides=('dwarfs') + +package() { + install -Dm755 "${srcdir}/dwarfs-universal-${pkgver}-Linux-${CARCH}-clang" "${pkgdir}/usr/bin/dwarfsuniversal" + install -Dm755 "${srcdir}/extract_blocks.py" "${pkgdir}/usr/bin/dwarfsblocks" + ln -s dwarfsuniversal "${pkgdir}/usr/bin/dwarfsck" + ln -s dwarfsuniversal "${pkgdir}/usr/bin/dwarfsextract" + ln -s dwarfsuniversal "${pkgdir}/usr/bin/mkdwarfs" + ln -s dwarfsuniversal "${pkgdir}/usr/bin/dwarfs" + + # mount will just run dwarfsuniversal otherwise + printf '#!/bin/sh\ndwarfs "$@"' > "${pkgdir}/usr/bin/mount.dwarfs" + chmod 755 "${pkgdir}/usr/bin/mount.dwarfs" + + cd "${srcdir}/dwarfs-${pkgver}-Linux-${CARCH}-clang" + install -Dm644 share/man/man1/dwarfs.1 "$pkgdir/usr/share/man/man1/dwarfs.1" + install -Dm644 share/man/man1/dwarfsck.1 "$pkgdir/usr/share/man/man1/dwarfsck.1" + install -Dm644 share/man/man1/dwarfsextract.1 "$pkgdir/usr/share/man/man1/dwarfsextract.1" + install -Dm644 share/man/man1/mkdwarfs.1 "$pkgdir/usr/share/man/man1/mkdwarfs.1" + install -Dm644 share/man/man5/dwarfs-format.5 "$pkgdir/usr/share/man/man5/dwarfs-format.5" +} +# update by removing and running `makepkg -g >> PKGBUILD` +sha256sums=('SKIP' + 'SKIP' + 'SKIP') diff --git a/archpkgs b/arch/packages similarity index 98% rename from archpkgs rename to arch/packages index 5fdadc2..d06079f 100644 --- a/archpkgs +++ b/arch/packages @@ -1,4 +1,6 @@ advancecomp +android-tools +anime4k-git apparmor arch-install-scripts ares-emu-avx-git @@ -28,7 +30,6 @@ cpupower csvlens dart-sass devkitpro-keyring -discord doas-sudo-shim dolphin-emu dolphin-emu-tool @@ -153,6 +154,7 @@ python-html2text python-lxml-html-clean python-pip python-pipx +python-playsound python-pylint python-readability-lxml qbittorrent @@ -181,12 +183,12 @@ squashfs-tools starship steam stow -subliminal-git sxiv syncplay syncthing system-config-printer tig +tk tldr tmux torsocks diff --git a/arch/pacman.conf b/arch/pacman.conf new file mode 100644 index 0000000..4e43ed6 --- /dev/null +++ b/arch/pacman.conf @@ -0,0 +1,6 @@ +[multilib] +Include = /etc/pacman.d/mirrorlist +[chaotic-aur] +Include = /etc/pacman.d/chaotic-mirrorlist +[options] +ParallelDownloads = 20 diff --git a/bin/setup b/bin/setup index cdd333d..20c1f58 100755 --- a/bin/setup +++ b/bin/setup @@ -1,30 +1,38 @@ #!/bin/sh set -e alias g=git l='ln -s' p='s pacman --noconfirm' s=sudo t='s tee -a' w=wget +if command -v doas; then + alias s='doas' +fi s pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com s pacman-key --lsign-key 3056513887B78AEB p -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' -printf '[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist\n' | t /etc/pacman.conf s pacman-key --recv BC26F752D25B92CE272E0F44F7FD5492264BB9D0 --keyserver keyserver.ubuntu.com s pacman-key --lsign BC26F752D25B92CE272E0F44F7FD5492264BB9D0 p -U 'https://pkg.devkitpro.org/devkitpro-keyring.pkg.tar.xz' -printf '[dkp-libs]\nServer = https://pkg.devkitpro.org/packages\n' | t /etc/pacman.conf -printf "[dkp-linux]\nServer = https://pkg.devkitpro.org/packages/linux/\$arch/\n" | t /etc/pacman.conf +t /etc/pacman.conf < ~/.dotfiles/arch/pacman.conf -echo permit :wheel | t /etc/doas.conf +echo permit nopass :wheel | t /etc/doas.conf p -Syu -xargs sudo pacman --noconfirm -S --needed < ~/.dotfiles/archpkgs +#shellcheck disable=SC2046 +p -S --needed $(grep -v devkit ~/.dotfiles/arch/packages) yay -S pandoc-bin shellcheck-bin --noconfirm -chsh -s "$(grep -m1 bin/fish /etc/shells)" +cp ~/.dotfiles/arch/dwarfs-universal /tmp/PKGBUILD +makepkg -srD /tmp +p -U /tmp/*.tar.zst +t /etc/pacman.conf < ~/.dotfiles/arch/devkitpro.conf echo kernel.core_pattern=/dev/null | t /etc/sysctl.d/50-coredump.conf echo options i915 enable_rc6=1 enable_fbc=1 lvds_downclock=1 enable__psr=1 | t /etc/modprobe.d/i915.conf -echo options lsm=landlock,lockdown,yama,integrity,apparmor,bpf | t /boot/loader/entries/*.conf +if bootctl status | grep systemd-boot; then + echo options lsm=landlock,lockdown,yama,integrity,apparmor,bpf | t /boot/loader/entries/*.conf +fi mkdir -p ~/.parallel/will-cite ~/.config/aria2 stow --no-folding -d ~/.dotfiles -t ~/.config . ~/.dotfiles/bin/config.fish +s chsh -s "$(grep -m1 bin/fish /etc/shells)" "$USER" w https://github.com/dracula/kitty/raw/master/dracula.conf -P ~/.config/kitty w https://github.com/dracula/musikcube/raw/main/dracula.json -P ~/.config/musikcube/themes @@ -58,11 +66,10 @@ curl -L https://github.com/ngosang/trackerslist/raw/master/trackers_best.txt | t g g p:appdwarf ~/.local/appdwarf g g p:haiku-icons ~/.local/share/icons/Haiku -for i in ~/.dotfiles/dconf/*; do - dconf reset -f "$(basename "$i" | tr : /)" - #shellcheck disable=SC2094 - dconf load "$(basename "$i" | tr : /)" < "$i" -done - -s usermod -aG docker "$USER" -s usermod -aG input "$USER" +if test "$DBUS_SESSION_BUS_ADDRESS"; then + for i in ~/.dotfiles/dconf/*; do + dconf reset -f "$(basename "$i" | tr : /)" + #shellcheck disable=SC2094 + dconf load "$(basename "$i" | tr : /)" < "$i" + done +fi