mirror of
https://github.com/BigfootACA/arch-image-builder.git
synced 2024-11-11 07:57:53 +08:00
Compare commits
7 Commits
ae6bf55e2b
...
abadeb646c
Author | SHA1 | Date | |
---|---|---|---|
|
abadeb646c | ||
|
1bc5af460e | ||
|
daa0930f8e | ||
|
6e7b87f3dc | ||
|
0874ec6fdf | ||
|
94804ec8d9 | ||
|
7b1e8f7dd9 |
@ -139,7 +139,7 @@ def add_file(ctx: ArchBuilderContext, file: dict):
|
||||
src = os.path.join(ctx.dir, src)
|
||||
log.debug(f"copy {src} to {real}")
|
||||
if folder:
|
||||
shutil.copytree(src, real, symlinks=follow)
|
||||
shutil.copytree(src, real, symlinks=follow, dirs_exist_ok=True)
|
||||
else:
|
||||
shutil.copyfile(src, real, follow_symlinks=follow)
|
||||
else:
|
||||
|
@ -52,17 +52,23 @@ class PacmanRepo(SerializableDict):
|
||||
name: str = None
|
||||
priority: int = 10000
|
||||
servers: list[PacmanRepoServer] = None
|
||||
publickey: str = None
|
||||
keyid: str = None
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
name: str = None,
|
||||
priority: int = None,
|
||||
servers: list[PacmanRepoServer] = None
|
||||
servers: list[PacmanRepoServer] = None,
|
||||
publickey: str = None,
|
||||
keyid: str = None
|
||||
):
|
||||
if name is not None: self.name = name
|
||||
if priority is not None: self.priority = priority
|
||||
if servers is not None: self.servers = servers
|
||||
else: self.servers = []
|
||||
if publickey is not None: self.publickey = publickey
|
||||
if keyid is not None: self.keyid = keyid
|
||||
|
||||
def add_server(
|
||||
self,
|
||||
@ -136,6 +142,16 @@ class Pacman:
|
||||
log.info("initializing pacman keyring")
|
||||
self.pacman_key(["--init"])
|
||||
|
||||
# Download and add public keys
|
||||
for repo in self.repos:
|
||||
if repo.publickey is not None:
|
||||
keypath = os.path.join(self.ctx.work, f"{repo.name}.pub")
|
||||
cmds = ["wget", repo.publickey, "-O", keypath]
|
||||
ret = self.ctx.run_external(cmds)
|
||||
if ret != 0: raise OSError(f"wget failed with {ret}")
|
||||
self.pacman_key(["--add", keypath])
|
||||
self.lsign_key(repo.keyid)
|
||||
|
||||
def init_config(self):
|
||||
"""
|
||||
Create host pacman.conf
|
||||
@ -282,6 +298,19 @@ class Pacman:
|
||||
if "priority" in repo:
|
||||
pacman_repo.priority = repo["priority"]
|
||||
|
||||
# add public key url and id
|
||||
if "publickey" in repo and "keyid" not in repo:
|
||||
raise ArchBuilderConfigError("publickey is provided without keyid")
|
||||
|
||||
if "keyid" in repo and "publickey" not in repo:
|
||||
raise ArchBuilderConfigError("keyid is provided without publickey")
|
||||
|
||||
if "publickey" in repo:
|
||||
pacman_repo.publickey = repo["publickey"]
|
||||
|
||||
if "keyid" in repo:
|
||||
pacman_repo.keyid = repo["keyid"]
|
||||
|
||||
originals: list[str] = []
|
||||
servers: list[str] = []
|
||||
|
||||
|
@ -2,6 +2,8 @@
|
||||
pacman:
|
||||
install:
|
||||
- plasma
|
||||
- konsole
|
||||
- dolphin
|
||||
- sddm
|
||||
- packagekit-qt6
|
||||
systemd:
|
||||
@ -17,3 +19,4 @@ filesystem:
|
||||
+also:
|
||||
# Ensure NetworkManager is enabled
|
||||
- packages/network-manager
|
||||
- packages/firefox
|
||||
|
29
configs/locale/en-US.yaml
Normal file
29
configs/locale/en-US.yaml
Normal file
@ -0,0 +1,29 @@
|
||||
# I18N for English (US)
|
||||
locale:
|
||||
enable:
|
||||
- "en_US.UTF-8 UTF-8"
|
||||
default: en_US.UTF-8
|
||||
|
||||
filesystem:
|
||||
files:
|
||||
# Wireless regulatory
|
||||
- path: /etc/conf.d/wireless-regdom
|
||||
content: |
|
||||
WIRELESS_REGDOM="US"
|
||||
# Windows NTP Server
|
||||
- path: /etc/systemd/timesyncd.conf.d/windows-ntp.conf
|
||||
content: |
|
||||
[Time]
|
||||
NTP=time.windows.com
|
||||
|
||||
sysconf:
|
||||
environments:
|
||||
GTK_IM_MODULE: ibus
|
||||
QT_IM_MODULE: ibus
|
||||
XMODIFIERS: '@im=ibus'
|
||||
COUNTRY: US
|
||||
LANG: en_US.UTF-8
|
||||
LANGUAGE: en_US.UTF-8
|
||||
LC_ALL: en_US.UTF-8
|
||||
TZ: US/Eastern
|
||||
timezone: US/Eastern
|
29
configs/locale/ru-RU.yaml
Normal file
29
configs/locale/ru-RU.yaml
Normal file
@ -0,0 +1,29 @@
|
||||
# I18N for Russian
|
||||
locale:
|
||||
enable:
|
||||
- "ru_RU.UTF-8 UTF-8"
|
||||
- "en_US.UTF-8 UTF-8"
|
||||
default: en_US.UTF-8
|
||||
|
||||
filesystem:
|
||||
files:
|
||||
# Wireless regulatory
|
||||
- path: /etc/conf.d/wireless-regdom
|
||||
content: |
|
||||
WIRELESS_REGDOM="RU"
|
||||
- path: /etc/systemd/timesyncd.conf.d/ntp-pool-ntp.conf
|
||||
content: |
|
||||
[Time]
|
||||
NTP=0.ru.pool.ntp.org
|
||||
|
||||
sysconf:
|
||||
environments:
|
||||
GTK_IM_MODULE: ibus
|
||||
QT_IM_MODULE: ibus
|
||||
XMODIFIERS: '@im=ibus'
|
||||
COUNTRY: RU
|
||||
LANG: ru_RU.UTF-8
|
||||
LANGUAGE: ru_RU.UTF-8
|
||||
LC_ALL: ru_RU.UTF-8
|
||||
TZ: Europe/Moscow
|
||||
timezone: Europe/Moscow
|
4
configs/packages/firefox.yaml
Normal file
4
configs/packages/firefox.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
# Firefox
|
||||
pacman:
|
||||
install:
|
||||
- firefox
|
10
configs/packages/nvim.yaml
Normal file
10
configs/packages/nvim.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
pacman:
|
||||
install:
|
||||
- neovim
|
||||
- neovide
|
||||
- less
|
||||
sysconf:
|
||||
environments:
|
||||
EDITOR: nvim
|
||||
VISUAL: neovide
|
||||
PAGER: less
|
4
configs/shell/fish.yaml
Normal file
4
configs/shell/fish.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
pacman:
|
||||
install:
|
||||
- fish
|
||||
- fisher
|
Loading…
Reference in New Issue
Block a user