Skip to content

Commit

Permalink
Fetched template changes (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
spietras authored Mar 26, 2024
1 parent 1f9fb4c commit dd1f5db
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .copier-answers.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: 0.5.0
_commit: 0.6.0
_src_path: gh:quickplates/generic
accountname: spietras
description: Flux manifests for my k8s clusters ☸️
Expand Down
7 changes: 6 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
// Docker context to use, relative to this file
"context": "image/",
// Dockerfile to use, relative to this file
"dockerfile": "image/Dockerfile"
"dockerfile": "image/Dockerfile",
// Build options
"options": [
// Use host network
"--network=host"
]
},
// Tool-specific settings
"customizations": {
Expand Down
8 changes: 4 additions & 4 deletions .devcontainer/image/hooks/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ if [[ -s /secrets/.ghtoken && -r /secrets/.ghtoken ]]; then
configfile="${confighome}/nix/nix.conf"
tmpfile="$(mktemp)"

mkdir -p "$(dirname "${configfile}")"
mkdir --parents "$(dirname "${configfile}")"
touch "${configfile}"

if grep -q extra-access-tokens "${configfile}"; then
if grep --quiet extra-access-tokens "${configfile}"; then
sed "s|extra-access-tokens.*|extra-access-tokens = github.com=${token}|" "${configfile}" >"${tmpfile}"
cat "${tmpfile}" >"${configfile}"
rm "${tmpfile}"
Expand All @@ -31,6 +31,6 @@ if [[ -s /secrets/.agekeys && -r /secrets/.agekeys ]]; then

# Copy age keys to SOPS config
targetfile="${confighome}/sops/age/keys.txt"
mkdir -p "$(dirname "${targetfile}")"
cp -f /secrets/.agekeys "${targetfile}"
mkdir --parents "$(dirname "${targetfile}")"
cp --force /secrets/.agekeys "${targetfile}"
fi
20 changes: 10 additions & 10 deletions .devcontainer/image/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

REMOTE_USER="${REMOTE_USER:?}"
REMOTE_USER_PASSWD="$(getent passwd "${REMOTE_USER}")"
REMOTE_USER_HOME="$(echo "${REMOTE_USER_PASSWD}" | cut -d: -f6)"
REMOTE_USER_HOME="$(echo "${REMOTE_USER_PASSWD}" | cut --delimiter ':' --fields 6)"

# Setup default shell
chsh -s /usr/bin/zsh "${REMOTE_USER}"
chsh --shell /usr/bin/zsh "${REMOTE_USER}"

# Setup direnv
cat <<EOF >>"${REMOTE_USER_HOME}/.bashrc"
Expand All @@ -26,17 +26,17 @@ eval "\$(starship init zsh)"
EOF

# Setup secrets directory
mkdir -p /secrets/
mkdir --parents /secrets/

chown -R "${REMOTE_USER}:" /secrets/
chown --recursive "${REMOTE_USER}:" /secrets/

# Setup shell history cache
mkdir -p /persist/shellhistory/
mkdir --parents /persist/shellhistory/

touch /persist/shellhistory/.bash_history
touch /persist/shellhistory/.zsh_history

chown -R "${REMOTE_USER}:" /persist/shellhistory/
chown --recursive "${REMOTE_USER}:" /persist/shellhistory/

cat <<EOF >>"${REMOTE_USER_HOME}/.bashrc"
export HISTFILE=/persist/shellhistory/.bash_history
Expand All @@ -47,9 +47,9 @@ export HISTFILE=/persist/shellhistory/.zsh_history
EOF

# Setup trunk cache
mkdir -p /cache/trunk/
mkdir --parents /cache/trunk/

chown -R "${REMOTE_USER}:" /cache/trunk/
chown --recursive "${REMOTE_USER}:" /cache/trunk/

cat <<EOF >>"${REMOTE_USER_HOME}/.bashrc"
export TRUNK_CACHE=/cache/trunk/
Expand All @@ -60,9 +60,9 @@ export TRUNK_CACHE=/cache/trunk/
EOF

# Setup npm cache
mkdir -p /cache/npm/
mkdir --parents /cache/npm/

chown -R "${REMOTE_USER}:" /cache/npm/
chown --recursive "${REMOTE_USER}:" /cache/npm/

cat <<EOF >>"${REMOTE_USER_HOME}/.bashrc"
export NPM_CONFIG_CACHE=/cache/npm/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
if: "!cancelled()"
run: >
mkdir
-p
--parents
${{ env.NIX_CACHE_DIR }}
&&
nix-store
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
if: "!cancelled()"
run: >
mkdir
-p
--parents
${{ env.NIX_CACHE_DIR }}
&&
nix-store
Expand Down
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"scripts": {
"docs": "docusaurus",
"update": "ncu --peer --doctor --upgrade && npm i --no-audit --no-fund",
"postupdate": "rm -rf .tmp/",
"postupdate": "rm --recursive --force .tmp/",
"test": "docusaurus build --out-dir .tmp/",
"posttest": "rm -rf .tmp/"
"posttest": "rm --recursive --force .tmp/"
},
"engines": {
"node": ">=18.0"
Expand Down

0 comments on commit dd1f5db

Please sign in to comment.