From a22e4bef4f77ca9f9fccafeb55440d8728668823 Mon Sep 17 00:00:00 2001 From: anonymix007 <48598263+anonymix007@users.noreply.github.com> Date: Mon, 19 Aug 2024 23:14:40 +0300 Subject: [PATCH 1/9] configs: shell: add bash --- configs/shell/bash.yaml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 configs/shell/bash.yaml diff --git a/configs/shell/bash.yaml b/configs/shell/bash.yaml new file mode 100644 index 0000000..87ec5b6 --- /dev/null +++ b/configs/shell/bash.yaml @@ -0,0 +1,3 @@ +pacman: + install: + - bash From 12afebaf46ef0be66e1927c0e17ba830606eacfe Mon Sep 17 00:00:00 2001 From: anonymix007 <48598263+anonymix007@users.noreply.github.com> Date: Wed, 21 Aug 2024 17:44:48 +0300 Subject: [PATCH 2/9] configs: packages: add Firefox --- configs/packages/firefox.yaml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 configs/packages/firefox.yaml diff --git a/configs/packages/firefox.yaml b/configs/packages/firefox.yaml new file mode 100644 index 0000000..570aa9b --- /dev/null +++ b/configs/packages/firefox.yaml @@ -0,0 +1,4 @@ +# Firefox +pacman: + install: + - firefox From 8dcfde246c62769f023bcfe9c383743d43b79b3e Mon Sep 17 00:00:00 2001 From: anonymix007 <48598263+anonymix007@users.noreply.github.com> Date: Wed, 21 Aug 2024 17:45:50 +0300 Subject: [PATCH 3/9] configs: desktop: plasma: install Firefox, Konsole and Dolphin --- configs/desktop/plasma.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configs/desktop/plasma.yaml b/configs/desktop/plasma.yaml index c5a518d..7294565 100644 --- a/configs/desktop/plasma.yaml +++ b/configs/desktop/plasma.yaml @@ -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 From a7fabccdeea264b004dd62193d690e748830a86b Mon Sep 17 00:00:00 2001 From: anonymix007 <48598263+anonymix007@users.noreply.github.com> Date: Wed, 21 Aug 2024 17:47:40 +0300 Subject: [PATCH 4/9] configs: locale: More locales --- configs/locale/en-US.yaml | 29 +++++++++++++++++++++++++++++ configs/locale/ru-RU.yaml | 29 +++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 configs/locale/en-US.yaml create mode 100644 configs/locale/ru-RU.yaml diff --git a/configs/locale/en-US.yaml b/configs/locale/en-US.yaml new file mode 100644 index 0000000..23b403e --- /dev/null +++ b/configs/locale/en-US.yaml @@ -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 diff --git a/configs/locale/ru-RU.yaml b/configs/locale/ru-RU.yaml new file mode 100644 index 0000000..a25c5c9 --- /dev/null +++ b/configs/locale/ru-RU.yaml @@ -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 From 6bf17468b1e42e74476785d6b067e30164d7da36 Mon Sep 17 00:00:00 2001 From: Jos Dehaes Date: Wed, 21 Aug 2024 17:57:12 +0300 Subject: [PATCH 5/9] builder: build: filesystem.py: ignore errors for existing directories --- builder/build/filesystem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/build/filesystem.py b/builder/build/filesystem.py index a0145ba..a86b492 100644 --- a/builder/build/filesystem.py +++ b/builder/build/filesystem.py @@ -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: From ec208efbfb4fcc14e993791252fd7d6b8593db51 Mon Sep 17 00:00:00 2001 From: Jos Dehaes Date: Wed, 21 Aug 2024 17:57:42 +0300 Subject: [PATCH 6/9] configs: shell: add fish --- configs/shell/fish.yaml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 configs/shell/fish.yaml diff --git a/configs/shell/fish.yaml b/configs/shell/fish.yaml new file mode 100644 index 0000000..b1c1aa6 --- /dev/null +++ b/configs/shell/fish.yaml @@ -0,0 +1,4 @@ +pacman: + install: + - fish + - fisher From b2cf0aa266a3510d5d40ba022e3f421d425112a1 Mon Sep 17 00:00:00 2001 From: Jos Dehaes Date: Wed, 21 Aug 2024 17:58:01 +0300 Subject: [PATCH 7/9] configs: packages: add nvim --- configs/packages/nvim.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 configs/packages/nvim.yaml diff --git a/configs/packages/nvim.yaml b/configs/packages/nvim.yaml new file mode 100644 index 0000000..2e4798c --- /dev/null +++ b/configs/packages/nvim.yaml @@ -0,0 +1,10 @@ +pacman: + install: + - neovim + - neovide + - less +sysconf: + environments: + EDITOR: nvim + VISUAL: neovide + PAGER: less From b1ec0e395c1394b0eb16767caa447ef180f7b85f Mon Sep 17 00:00:00 2001 From: anonymix007 <48598263+anonymix007@users.noreply.github.com> Date: Wed, 21 Aug 2024 17:06:38 +0300 Subject: [PATCH 8/9] builder: component: pacman.py: Add publickey and keyid repo properties --- builder/component/pacman.py | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/builder/component/pacman.py b/builder/component/pacman.py index 5108277..c4d0120 100644 --- a/builder/component/pacman.py +++ b/builder/component/pacman.py @@ -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,19 @@ 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) + elif repo.keyid is not None: + self.recv_keys(repo.keyid) + self.lsign_key(repo.keyid) + def init_config(self): """ Create host pacman.conf @@ -282,6 +301,16 @@ 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 "publickey" in repo: + pacman_repo.publickey = repo["publickey"] + + if "keyid" in repo: + pacman_repo.keyid = repo["keyid"] + originals: list[str] = [] servers: list[str] = [] From ae6bf55e2befa46fb5a23b4f77a19867b2eeddc1 Mon Sep 17 00:00:00 2001 From: anonymix007 <48598263+anonymix007@users.noreply.github.com> Date: Thu, 22 Aug 2024 12:08:03 +0300 Subject: [PATCH 9/9] configs: common: add pacman-init for initialising keyrings Based on https://gitlab.archlinux.org/archlinux/archiso/-/blob/master/configs/releng/airootfs/etc/systemd/system/pacman-init.service --- configs/common/pacman-init.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 configs/common/pacman-init.yaml diff --git a/configs/common/pacman-init.yaml b/configs/common/pacman-init.yaml new file mode 100644 index 0000000..b820e30 --- /dev/null +++ b/configs/common/pacman-init.yaml @@ -0,0 +1,17 @@ +filesystem: + files: + - path: /etc/systemd/system/wait-addresses@.service + content: | + [Unit] + Description=Initializes Pacman keyring + Requires=etc-pacman.d-gnupg.mount + After=etc-pacman.d-gnupg.mount time-sync.target + BindsTo=etc-pacman.d-gnupg.mount + Before=archlinux-keyring-wkd-sync.service + [Service] + Type=oneshot + RemainAfterExit=yes + ExecStart=/usr/bin/pacman-key --init + ExecStart=/usr/bin/pacman-key --populate + [Install] + WantedBy=multi-user.target