feat: add aur package support to system.yaml

This commit is contained in:
Veggie Tanuki 2023-12-30 16:14:59 +00:00 committed by Rudra Saraswat
parent 87f2e9198a
commit e8f1378348

23
akshara
View file

@ -187,6 +187,8 @@ def update_system():
'blend' 'blend'
] ]
aur_packages = []
services = [ services = [
'akshara' 'akshara'
] ]
@ -209,6 +211,10 @@ def update_system():
if type(blend_release.get('packages')) == list: if type(blend_release.get('packages')) == list:
packages += blend_release.get('packages') packages += blend_release.get('packages')
if type(blend_release.get('aur-packages')) == list:
packages += ['fakeroot', 'paru']
aur_packages += blend_release.get('aur-packages')
if type(blend_release.get('services')) == list: if type(blend_release.get('services')) == list:
services += blend_release.get('services') services += blend_release.get('services')
@ -284,6 +290,23 @@ Server = {package_repo["repo-url"]}
exit(50) exit(50)
if return_val == 0: if return_val == 0:
break break
counter = 0
while True:
exec_chroot('useradd', '-m', '-G', 'wheel', '-s', '/bin/bash', 'aur')
exec_chroot('bash', '-c', 'echo "aur ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/aur')
return_val = exec_chroot(
'runuser', '-u', 'aur', '--', 'paru', '-Sy', '--noconfirm', '--needed',
'--noprogressbar', '--skipreview', '--removemake', '--cleanafter', '--ask=4',
*blend_release.get('aur-packages'))
exec_chroot('userdel', '-r', 'aur')
exec_chroot('rm', '-f', '/etc/sudoers.d/aur')
counter += 1
if counter > 30:
error('failed to download AUR packages')
exit(50)
if return_val == 0:
break
for service in services: for service in services:
if type(service) is str: if type(service) is str: