Skip to content

Commit

Permalink
add setup script testing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Phantop committed Oct 26, 2024
1 parent c83c7a5 commit bab9c30
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 10 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/setup.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions arch/devkitpro.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[dkp-libs]
Server = https://pkg.devkitpro.org/packages
[dkp-linux]
Server = https://pkg.devkitpro.org/packages/linux/$arch/
38 changes: 38 additions & 0 deletions arch/dwarfs-universal
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Maintainer: phantop <[email protected]>
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')
6 changes: 4 additions & 2 deletions archpkgs → arch/packages
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
advancecomp
android-tools
anime4k-git
apparmor
arch-install-scripts
ares-emu-avx-git
Expand Down Expand Up @@ -28,7 +30,6 @@ cpupower
csvlens
dart-sass
devkitpro-keyring
discord
doas-sudo-shim
dolphin-emu
dolphin-emu-tool
Expand Down Expand Up @@ -153,6 +154,7 @@ python-html2text
python-lxml-html-clean
python-pip
python-pipx
python-playsound
python-pylint
python-readability-lxml
qbittorrent
Expand Down Expand Up @@ -181,12 +183,12 @@ squashfs-tools
starship
steam
stow
subliminal-git
sxiv
syncplay
syncthing
system-config-printer
tig
tk
tldr
tmux
torsocks
Expand Down
6 changes: 6 additions & 0 deletions arch/pacman.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[multilib]
Include = /etc/pacman.d/mirrorlist
[chaotic-aur]
Include = /etc/pacman.d/chaotic-mirrorlist
[options]
ParallelDownloads = 20
22 changes: 14 additions & 8 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
#!/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/packages/dwarfs-universal /tmp/PKGBUILD
makepkg -sircD /tmp
s mkdir /etc/pacman.d
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
Expand All @@ -25,6 +30,7 @@ echo options lsm=landlock,lockdown,yama,integrity,apparmor,bpf | t /boot/loader/
mkdir -p ~/.parallel/will-cite ~/.config/aria2
stow --no-folding -d ~/.dotfiles -t ~/.config .
~/.dotfiles/bin/config.fish
chsh -s "$(grep -m1 bin/fish /etc/shells)"

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
Expand Down Expand Up @@ -64,5 +70,5 @@ for i in ~/.dotfiles/dconf/*; do
dconf load "$(basename "$i" | tr : /)" < "$i"
done

s usermod -aG docker "$USER"
s usermod -aG input "$USER"
s usermod -aG docker,input "$USER"
echo permit :wheel | t /etc/doas.conf

0 comments on commit bab9c30

Please sign in to comment.