Skip to content

Commit 158e31b

Browse files
committed
feat: add support for Ubuntu
1 parent e590a42 commit 158e31b

File tree

5 files changed

+81
-3
lines changed

5 files changed

+81
-3
lines changed

.chezmoidata/packages.yaml

+17-2
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,29 @@ packages:
5353
- lm-sensors
5454
- marksman
5555
- neovim
56-
- pre-commit
5756
- ripgrep
58-
- tree-sitter
5957
- yamlfmt
6058
- yamllint
6159
- yq
6260
- zellij
6361

62+
ubuntu:
63+
packages:
64+
- btop
65+
- direnv
66+
- eza
67+
- fzf
68+
- git-delta
69+
- libsensors-dev
70+
- lm-sensors
71+
- neovim
72+
- pre-commit
73+
- python3
74+
- python3-pip
75+
- ripgrep
76+
- yamllint
77+
- zoxide
78+
6479
fedora_workstation:
6580
copr:
6681
- atim/bottom

.chezmoiexternal.toml.tmpl

+27
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,33 @@
2929

3030
# Bluefin CLI
3131

32+
{{ $bat_version := (gitHubLatestRelease "sharkdp/bat").TagName -}}
33+
[".local/bin/bat"]
34+
type = "archive-file"
35+
url = "https://github.com/sharkdp/bat/releases/download/{{ $bat_version }}/bat-{{ $bat_version }}-{{ $arch }}-unknown-{{ .chezmoi.os }}-gnu.tar.gz"
36+
executable = true
37+
refreshPeriod = "168h"
38+
path = "bat-{{ $bat_version }}-{{ $arch }}-unknown-{{ .chezmoi.os }}-gnu/bat"
39+
40+
{{ $yamlfmt_version := (gitHubLatestRelease "google/yamlfmt").TagName | replace "v" "" -}}
41+
[".local/bin/yamlfmt"]
42+
type = "archive-file"
43+
url = "https://github.com/google/yamlfmt/releases/download/v{{ $yamlfmt_version }}/yamlfmt_{{ $yamlfmt_version }}_{{ .chezmoi.os | title }}_{{ $arch }}.tar.gz"
44+
executable = true
45+
refreshPeriod = "168h"
46+
path = "yamlfmt"
47+
48+
{{ else if eq .osid "linux-ubuntu" -}}
49+
50+
# Ubuntu
51+
52+
[".local/bin/zellij"]
53+
type = "archive-file"
54+
url = "https://github.com/zellij-org/zellij/releases/latest/download/zellij-x86_64-unknown-linux-musl.tar.gz"
55+
executable = true
56+
refreshPeriod = "168h"
57+
path = "zellij"
58+
3259
{{ $bat_version := (gitHubLatestRelease "sharkdp/bat").TagName -}}
3360
[".local/bin/bat"]
3461
type = "archive-file"

.hook-scripts/pre-source-state/10-password-manager.sh

+18-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,23 @@ case "$(osid)" in
2525
sudo sh -c 'echo -e "[1password]\nname=1Password Stable Channel\nbaseurl=https://downloads.1password.com/linux/rpm/stable/\$basearch\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=\"https://downloads.1password.com/linux/keys/1password.asc\"" > /etc/yum.repos.d/1password.repo'
2626
sudo dnf install -y -q 1password 1password-cli
2727
;;
28+
"ubuntu")
29+
if command -v distrobox-host-exec &>/dev/null; then
30+
if [ ! -f "/usr/local/bin/op" ]; then
31+
sudo ln -s "$(which distrobox-host-exec)" "/usr/local/bin/op"
32+
fi
33+
else
34+
# shellcheck disable=SC2154
35+
echo "${green}Installing 1Password${reset}"
36+
curl -sS https://downloads.1password.com/linux/keys/1password.asc | sudo gpg --dearmor --output /usr/share/keyrings/1password-archive-keyring.gpg
37+
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/amd64 stable main' | sudo tee /etc/apt/sources.list.d/1password.list
38+
sudo mkdir -p /etc/debsig/policies/AC2D62742012EA22/
39+
curl -sS https://downloads.1password.com/linux/debian/debsig/1password.pol | sudo tee /etc/debsig/policies/AC2D62742012EA22/1password.pol
40+
sudo mkdir -p /usr/share/debsig/keyrings/AC2D62742012EA22
41+
curl -sS https://downloads.1password.com/linux/keys/1password.asc | sudo gpg --dearmor --output /usr/share/debsig/keyrings/AC2D62742012EA22/debsig.gpg
42+
sudo apt update && sudo apt install -y -q 1password-cli
43+
fi
44+
;;
2845
"wolfi")
2946
if command -v distrobox-host-exec &>/dev/null; then
3047
if [ ! -f "/usr/local/bin/op" ]; then
@@ -34,7 +51,7 @@ case "$(osid)" in
3451
;;
3552
*)
3653
# shellcheck disable=SC2154
37-
echo "${red}Unsupported OS${reset}"
54+
echo "${red}Unsupported OS $(osid)${reset}"
3855
exit 0
3956
;;
4057
esac

exact_private_dot_bashrc.d/40-pnpm.bash

+5
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ case ":$PATH:" in
66
*":$PNPM_HOME:"*) ;;
77
*) export PATH="$PNPM_HOME:$PATH" ;;
88
esac
9+
10+
if command -v pnpm &>/dev/null; then
11+
# shellcheck disable=SC1090
12+
source <(pnpm completion bash)
13+
fi

run_onchange_install-packages.sh.tmpl

+14
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,20 @@ sudo dnf --quiet install -y {{ .packages | join " " }}
7373
{{ end -}}
7474
{{ end -}}
7575
{{ end -}}
76+
77+
78+
{{ else if eq $osid "linux-ubuntu" -}}
79+
80+
# Fedora Workstation installation of packages
81+
{{ if hasKey . "ubuntu" -}}
82+
{{ with .ubuntu -}}
83+
{{ if hasKey . "packages" -}}
84+
echo "${green}Installing Ubuntu packages${reset}"
85+
sudo apt -qqq install -y {{ .packages | join " " }}
86+
{{ end -}}
87+
{{ end -}}
88+
{{ end -}}
89+
7690
{{ end -}}
7791
{{ end -}}
7892

0 commit comments

Comments
 (0)