detached 3095135

fix(post-boot,shell): address CodeRabbit review — marker-based bashrc, passwd-based USER_HOME, pacman -Sy, remove unused Configurator fields, document danklinux trust

commit
309513574ed07bb44fecc0606db247f870508aea
author
bnema · · 2026-02-26 21:25 UTC
parent
fc43554
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +18 -36
M install/mandatory/post-boot/cli-tools.sh +12 -8
@@ -3,8 +3,8 @@
33 set -euo pipefail
44
55 LOG_FILE="/var/log/archup-first-boot.log"
6-USERNAME=$(getent passwd | awk -F: '$3 >= 1000 && $3 < 65534 {print $1; exit}')
7-USER_HOME="/home/$USERNAME"
6+USERNAME=$(getent passwd | awk -F: '$3 >= 1000 && $3 < 65534 && $1 != "nobody" {print $1; exit}')
7+USER_HOME=$(getent passwd "$USERNAME" | cut -d: -f6)
88
99 log() { echo "[cli-tools] $*" | tee -a "$LOG_FILE"; }
1010
@@ -15,21 +15,24 @@ fi
1515
1616 log "Installing modern CLI toolkit for $USERNAME..."
1717
18+log "Refreshing package databases..."
19+pacman -Sy --noconfirm
20+
1821 pacman -S --needed --noconfirm \
1922 eza bat fd ripgrep fzf zoxide starship \
2023 btop yazi git-delta gdu procs tealdeer \
2124 lazygit atuin man-db neovim wget curl git
2225
23-log "Writing ~/.bashrc for $USERNAME..."
26+log "Configuring shell environment for $USERNAME..."
2427
25-# Back up existing .bashrc if present
28+# Remove any previous archup block (idempotent re-run)
2629 if [ -f "$USER_HOME/.bashrc" ]; then
27- cp "$USER_HOME/.bashrc" "$USER_HOME/.bashrc.bak"
28- log "Backed up existing .bashrc to .bashrc.bak"
30+ sed -i '/# BEGIN archup cli tools/,/# END archup cli tools/d' "$USER_HOME/.bashrc"
2931 fi
3032
31-cat > "$USER_HOME/.bashrc" << 'BASHRC'
32-# ArchUp barebone bash — modern CLI tools
33+# Append archup block
34+cat >> "$USER_HOME/.bashrc" << 'BASHRC'
35+# BEGIN archup cli tools
3336 # Aliases
3437 alias ls='eza --icons'
3538 alias ll='eza -la --icons --git'
@@ -63,6 +66,7 @@ eval "$(starship init bash)"
6366
6467 # ble.sh (Bash Line Editor) — must be sourced last
6568 [[ $- == *i* ]] && source -- ~/.local/share/blesh/ble.sh 2>/dev/null || true
69+# END archup cli tools
6670 BASHRC
6771
6872 chown "$USERNAME:$USERNAME" "$USER_HOME/.bashrc"
@@ -3,8 +3,8 @@
3 set -euo pipefail3 set -euo pipefail
4 4
5 LOG_FILE="/var/log/archup-first-boot.log"5 LOG_FILE="/var/log/archup-first-boot.log"
6-USERNAME=$(getent passwd | awk -F: '$3 >= 1000 && $3 < 65534 {print $1; exit}')6+USERNAME=$(getent passwd | awk -F: '$3 >= 1000 && $3 < 65534 && $1 != "nobody" {print $1; exit}')
7-USER_HOME="/home/$USERNAME"7+USER_HOME=$(getent passwd "$USERNAME" | cut -d: -f6)
8 8
9 log() { echo "[cli-tools] $*" | tee -a "$LOG_FILE"; }9 log() { echo "[cli-tools] $*" | tee -a "$LOG_FILE"; }
10 10
@@ -15,21 +15,24 @@ fi
15 15
16 log "Installing modern CLI toolkit for $USERNAME..."16 log "Installing modern CLI toolkit for $USERNAME..."
17 17
18+log "Refreshing package databases..."
19+pacman -Sy --noconfirm
20+
18 pacman -S --needed --noconfirm \21 pacman -S --needed --noconfirm \
19 eza bat fd ripgrep fzf zoxide starship \22 eza bat fd ripgrep fzf zoxide starship \
20 btop yazi git-delta gdu procs tealdeer \23 btop yazi git-delta gdu procs tealdeer \
21 lazygit atuin man-db neovim wget curl git24 lazygit atuin man-db neovim wget curl git
22 25
23-log "Writing ~/.bashrc for $USERNAME..."26+log "Configuring shell environment for $USERNAME..."
24 27
25-# Back up existing .bashrc if present28+# Remove any previous archup block (idempotent re-run)
26 if [ -f "$USER_HOME/.bashrc" ]; then29 if [ -f "$USER_HOME/.bashrc" ]; then
27- cp "$USER_HOME/.bashrc" "$USER_HOME/.bashrc.bak"30+ sed -i '/# BEGIN archup cli tools/,/# END archup cli tools/d' "$USER_HOME/.bashrc"
28- log "Backed up existing .bashrc to .bashrc.bak"
29 fi31 fi
30 32
31-cat > "$USER_HOME/.bashrc" << 'BASHRC'33+# Append archup block
32-# ArchUp barebone bash — modern CLI tools34+cat >> "$USER_HOME/.bashrc" << 'BASHRC'
35+# BEGIN archup cli tools
33 # Aliases36 # Aliases
34 alias ls='eza --icons'37 alias ls='eza --icons'
35 alias ll='eza -la --icons --git'38 alias ll='eza -la --icons --git'
@@ -63,6 +66,7 @@ eval "$(starship init bash)"
63 66
64 # ble.sh (Bash Line Editor) — must be sourced last67 # ble.sh (Bash Line Editor) — must be sourced last
65 [[ $- == *i* ]] && source -- ~/.local/share/blesh/ble.sh 2>/dev/null || true68 [[ $- == *i* ]] && source -- ~/.local/share/blesh/ble.sh 2>/dev/null || true
69+# END archup cli tools
66 BASHRC70 BASHRC
67 71
68 chown "$USERNAME:$USERNAME" "$USER_HOME/.bashrc"72 chown "$USERNAME:$USERNAME" "$USER_HOME/.bashrc"
M install/mandatory/post-boot/dms-opt-in.sh +3 -1
@@ -27,7 +27,9 @@ echo " - Auto-theming, notifications, app launcher,"
2727 echo " lock screen, system tray, search — all"
2828 echo " integrated. One install. Everything works."
2929 echo ""
30-echo " Install: curl -fsSL https://install.danklinux.com | sh"
30+ echo " Install: curl -fsSL https://install.danklinux.com | sh"
31+echo " Note: This runs the official Dank Linux installer. Review at:"
32+echo " https://github.com/AvengeMedia/DankMaterialShell"
3133 echo ""
3234
3335 read -r -p " Do you want to run the Dank Linux installer? [y/N] " REPLY || true
@@ -27,7 +27,9 @@ echo " - Auto-theming, notifications, app launcher,"
27 echo " lock screen, system tray, search — all"27 echo " lock screen, system tray, search — all"
28 echo " integrated. One install. Everything works."28 echo " integrated. One install. Everything works."
29 echo ""29 echo ""
30-echo " Install: curl -fsSL https://install.danklinux.com | sh"30+ echo " Install: curl -fsSL https://install.danklinux.com | sh"
31+echo " Note: This runs the official Dank Linux installer. Review at:"
32+echo " https://github.com/AvengeMedia/DankMaterialShell"
31 echo ""33 echo ""
32 34
33 read -r -p " Do you want to run the Dank Linux installer? [y/N] " REPLY || true35 read -r -p " Do you want to run the Dank Linux installer? [y/N] " REPLY || true
M internal/shell/configurator.go +3 -27
@@ -1,11 +1,5 @@
11 package shell
22
3-import (
4- "github.com/bnema/archup/internal/config"
5- "github.com/bnema/archup/internal/interfaces"
6- "github.com/bnema/archup/internal/logger"
7-)
8-
93 // ConfigResult holds the result of shell configuration
104 type ConfigResult struct {
115 ThemesApplied int
@@ -14,29 +8,11 @@ type ConfigResult struct {
148 }
159
1610 // Configurator handles shell and bash configuration setup
17-type Configurator struct {
18- fs interfaces.FileSystem
19- http interfaces.HTTPClient
20- chrExec interfaces.ChrootExecutor
21- config *config.Config
22- logger *logger.Logger
23-}
11+type Configurator struct{}
2412
2513 // NewConfigurator creates a new shell configurator
26-func NewConfigurator(
27- fs interfaces.FileSystem,
28- http interfaces.HTTPClient,
29- chrExec interfaces.ChrootExecutor,
30- cfg *config.Config,
31- log *logger.Logger,
32-) *Configurator {
33- return &Configurator{
34- fs: fs,
35- http: http,
36- chrExec: chrExec,
37- config: cfg,
38- logger: log,
39- }
14+func NewConfigurator() *Configurator {
15+ return &Configurator{}
4016 }
4117
4218 // Configure is a no-op. Shell configuration is handled by cli-tools.sh at first boot.
@@ -1,11 +1,5 @@
1 package shell1 package shell
2 2
3-import (
4- "github.com/bnema/archup/internal/config"
5- "github.com/bnema/archup/internal/interfaces"
6- "github.com/bnema/archup/internal/logger"
7-)
8-
9 // ConfigResult holds the result of shell configuration3 // ConfigResult holds the result of shell configuration
10 type ConfigResult struct {4 type ConfigResult struct {
11 ThemesApplied int5 ThemesApplied int
@@ -14,29 +8,11 @@ type ConfigResult struct {
14 }8 }
15 9
16 // Configurator handles shell and bash configuration setup10 // Configurator handles shell and bash configuration setup
17-type Configurator struct {11+type Configurator struct{}
18- fs interfaces.FileSystem
19- http interfaces.HTTPClient
20- chrExec interfaces.ChrootExecutor
21- config *config.Config
22- logger *logger.Logger
23-}
24 12
25 // NewConfigurator creates a new shell configurator13 // NewConfigurator creates a new shell configurator
26-func NewConfigurator(14+func NewConfigurator() *Configurator {
27- fs interfaces.FileSystem,15+ return &Configurator{}
28- http interfaces.HTTPClient,
29- chrExec interfaces.ChrootExecutor,
30- cfg *config.Config,
31- log *logger.Logger,
32-) *Configurator {
33- return &Configurator{
34- fs: fs,
35- http: http,
36- chrExec: chrExec,
37- config: cfg,
38- logger: log,
39- }
40 }16 }
41 17
42 // Configure is a no-op. Shell configuration is handled by cli-tools.sh at first boot.18 // Configure is a no-op. Shell configuration is handled by cli-tools.sh at first boot.

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 0

    ↑↓ moveenter openesc close