Skip to content

Commit 4f7cf4b

Browse files
committed
feat: add support for Fedora Silverblue
1 parent 61e3c76 commit 4f7cf4b

11 files changed

+92
-25
lines changed

.chezmoi.toml.tmpl

+5-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
{{- if hasKey .chezmoi.osRelease "id" -}}
2828
{{- $osid = printf "%s-%s" .chezmoi.os .chezmoi.osRelease.id -}}
2929
{{- end -}}
30+
{{- if hasKey .chezmoi.osRelease "variant" -}}
31+
{{- $osid = printf "%s-%s" .chezmoi.osRelease.id .chezmoi.osRelease.variant -}}
32+
{{- end -}}
3033

3134
format = "json"
3235
color = "on"
@@ -37,8 +40,9 @@ progress = true
3740
email = {{ $email | quote }}
3841
name = {{ $name | quote }}
3942
signingkey = {{ $signingkey | quote }}
40-
osid = {{ $osid | quote }}
43+
osid = {{ $osid | lower | quote }}
4144
colortheme = {{ $colortheme | quote }}
45+
lazygit = '{{ (gitHubLatestRelease "jesseduffield/lazygit").TagName | replace "v" "" }}'
4246

4347
[diff]
4448
exclude = ["scripts"]

.chezmoiexternal.toml.tmpl

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
# ~/.local/share/chezmoi/.chezmoiexternal.toml.tmpl
55
# =============================================================================
6+
# {{ $arch := (eq .chezmoi.arch "amd64" | ternary "x86_64" .chezmoi.arch) }}
67
# Used to download external dependencies.{{- /*
78
#
89
# This file supports Go's text/template language. */}}
@@ -17,3 +18,9 @@
1718
type = "file"
1819
url = "https://github.com/dj95/zjstatus/releases/latest/download/zjstatus.wasm"
1920
refreshPeriod = "24h"
21+
22+
[".local/bin/lazygit"]
23+
type = "archive-file"
24+
url = "https://github.com/jesseduffield/lazygit/releases/download/v{{ .lazygit }}/lazygit_{{ .lazygit }}_{{ .chezmoi.os | title }}_{{ $arch }}.tar.gz"
25+
refreshPeriod = "24h"
26+
path = "lazygit"

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ $RECYCLE.BIN/
7676

7777
# End of https://www.toptal.com/developers/gitignore/api/ansible,linux,windows,macos
7878

79+
*.swp*
7980
.cache
8081
.cache*
8182
.chezmoidata/externals.yaml

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

+11-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,17 @@ BASE_DIR=".local/share/chezmoi"
88
# shellcheck disable=SC1091
99
source "${BASE_DIR}/script_utils.sh"
1010

11-
case "$(uname -s)" in
12-
Darwin) ;;
13-
Linux)
11+
# shellcheck disable=SC2154
12+
case "$(osid)" in
13+
"fedora-silverblue")
14+
# shellcheck disable=SC2154
15+
echo "${green}Installing 1Password on Silverblue${reset}"
16+
sudo wget https://downloads.1password.com/linux/keys/1password.asc \
17+
-O /etc/pki/rpm-gpg/1password.asc &&
18+
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=\"file:///etc/pki/rpm-gpg/1password.asc\"" > /etc/yum.repos.d/1password.repo' &&
19+
sudo rpm-ostree -q install 1password 1password-cli
20+
;;
21+
"fedora-workstation")
1422
# shellcheck disable=SC2154
1523
echo "${green}Installing 1Password${reset}"
1624
sudo rpm --import https://downloads.1password.com/linux/keys/1password.asc
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
3+
# exit if pnpm is already installed
4+
command -v pnpm &>/dev/null && exit
5+
6+
BASE_DIR=".local/share/chezmoi"
7+
8+
# shellcheck disable=SC1091
9+
source "${BASE_DIR}/script_utils.sh"
10+
11+
case "$(osid)" in
12+
"fedora-silverblue")
13+
wget -qO- https://get.pnpm.io/install.sh | sh - &&
14+
pnpm env use --global iron
15+
;;
16+
esac

.hook-scripts/pre-source-state/98-astronvim.sh

+9
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ BASE_DIR=".local/share/chezmoi"
55
# shellcheck disable=SC1091
66
source "${BASE_DIR}/script_utils.sh"
77

8+
case "$(osid)" in
9+
"fedora-silverblue")
10+
if [ ! -f ~/.local/bin/nvim ]; then
11+
wget https://github.com/neovim/neovim/releases/latest/download/nvim.appimage -O ~/.local/bin/nvim &&
12+
chmod u+x ~/.local/bin/nvim
13+
fi
14+
;;
15+
esac
16+
817
if [ -f "${HOME}/.config/nvim/config.ld" ]; then
918
# shellcheck disable=SC2154
1019
echo "${green}Updating AstroNvim${reset}"

dot_gitconfig.tmpl

-5
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@
3535
helper =
3636
helper = !/usr/bin/gh auth git-credential
3737

38-
[credential "http://git.codesubmit.io"]
39-
helper =
40-
helper = cache
41-
username = leap-llc-hzmhky
42-
4338
[color]
4439
ui = true
4540

dot_justfile

-15
This file was deleted.

dot_justfile.tmpl

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# -*-mode:just-*- vim:ft=just
2+
# -*-mode:go-template-*- vim:ft=just
3+
4+
# ~/.local/share/chezmoi/dot_justfile.tmpl
5+
# =============================================================================
6+
# Default commands.{{- /*
7+
#
8+
# This file supports Go's text/template language. */}}
9+
10+
{{ if eq .osid "fedora-silverblue" -}}
11+
12+
import "/usr/share/ublue-os/justfile"
13+
14+
{{ else if eq .osid "fedora-workstation" -}}
15+
16+
# Update system packages
17+
update:
18+
sudo dnf update -y
19+
flatpak update --noninteractive
20+
21+
# Fix the GPG card service
22+
fix-gpg:
23+
sudo systemctl restart pcscd.service
24+
gpg --card-status
25+
26+
{{ end -}}
27+
28+
[private]
29+
default:
30+
@just --unstable --list
31+

run_onchange_install-packages.sh.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ brew {{ . | quote }}
1313
cask {{ . | quote }}
1414
{{ end -}}
1515
EOF
16-
{{ else if eq .osid "linux-fedora" -}}
16+
{{ else if eq .osid "fedora-workstation" -}}
1717
# Fedora installation of packages
1818
{{ if hasKey .packages "linux_fedora" -}}
1919
sudo dnf --quiet install -y dnf-plugins-core

script_utils.sh

+11
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,14 @@ verlte() {
2020
verlt() {
2121
! verlte "$2" "$1"
2222
}
23+
24+
join_by() { local IFS="$1"; shift; echo "$*"; }
25+
26+
osid() {
27+
if [ -f /etc/os-release ]; then
28+
source /etc/os-release
29+
join_by '-' "${ID}" "${VARIANT_ID}"
30+
else
31+
uname -s
32+
fi
33+
}

0 commit comments

Comments
 (0)