Skip to content

Commit 9a65aac

Browse files
Added template files (#28)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 4970c67 commit 9a65aac

358 files changed

Lines changed: 42543 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.copier-answers.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2+
_commit: b04a8bd
3+
_src_path: ./
4+
accountname: quickplates
5+
appname: next-example
6+
description: Next.js app example ⚫
7+
docs: true
8+
docsurl: https://quickplates.github.io/next-example
9+
envprefix: NEXT_EXAMPLE
10+
imagename: apps/next-example
11+
keyprefix: next-example
12+
port: 3000
13+
registry: true
14+
releases: true
15+
reponame: next-example
16+
repourl: https://github.com/quickplates/next-example

.devcontainer/devcontainer.json

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"build": {
3+
"context": "image/",
4+
"dockerfile": "image/Dockerfile",
5+
"options": ["--network=host"]
6+
},
7+
"customizations": {
8+
"vscode": {
9+
"extensions": [
10+
"jnoortheen.nix-ide",
11+
"mkhl.direnv",
12+
"task.vscode-task",
13+
"Trunk.io",
14+
"vunguyentuan.vscode-css-variables",
15+
"vunguyentuan.vscode-postcss"
16+
],
17+
"settings": {
18+
"[nix]": {
19+
"editor.defaultFormatter": "jnoortheen.nix-ide"
20+
},
21+
"cssVariables.languages": ["css", "scss", "postcss"],
22+
"cssVariables.lookupFiles": [
23+
"**/*.css",
24+
"**/*.sass",
25+
"**/*.scss",
26+
"node_modules/@mantine/core/styles.css"
27+
],
28+
"editor.defaultFormatter": "trunk.io",
29+
"nix.enableLanguageServer": true,
30+
"nix.serverPath": "nil",
31+
"nix.serverSettings": {
32+
"nil": {
33+
"formatting": {
34+
"command": ["nix", "fmt", "--", "-"]
35+
}
36+
}
37+
},
38+
"remote.autoForwardPorts": false
39+
}
40+
}
41+
},
42+
"features": {
43+
"ghcr.io/devcontainers-extra/features/direnv:1.0.3": {
44+
"version": "2.37.1"
45+
},
46+
"ghcr.io/devcontainers-extra/features/starship:1.0.10": {
47+
"version": "1.24.0"
48+
},
49+
"ghcr.io/devcontainers/features/docker-in-docker:2.12.4": {
50+
"version": "28.5.1"
51+
},
52+
"ghcr.io/devcontainers/features/nix:1.2.0": {
53+
"extraNixConfig": "experimental-features = nix-command flakes",
54+
"version": "2.28.5"
55+
}
56+
},
57+
"mounts": [
58+
"source=devcontainer-shared-secrets,target=/secrets/,type=volume",
59+
"source=devcontainer-${devcontainerId}-nix,target=/nix/,type=volume",
60+
"source=devcontainer-${devcontainerId}-shellhistory-persist,target=/persist/shellhistory/,type=volume",
61+
"source=devcontainer-shared-trunk-cache,target=/cache/trunk/,type=volume",
62+
"source=devcontainer-shared-npm-cache,target=/cache/npm/,type=volume"
63+
],
64+
"onCreateCommand": "/hooks/create.sh",
65+
"remoteEnv": {
66+
"WORKSPACE": "${containerWorkspaceFolder}"
67+
},
68+
"runArgs": [
69+
"--uts=host",
70+
"--ipc=host",
71+
"--network=host",
72+
"--userns=host",
73+
"--cgroupns=host",
74+
"--privileged"
75+
]
76+
}

.devcontainer/image/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Using one of the offical dev container images as base
2+
# Going with Ubuntu, because it has glibc, which some tools might need
3+
# It also has git, zsh and a bunch of other stuff preinstalled
4+
# Also, it includes a non-root 'vscode' user with sudo access
5+
# The version is pinned to ensure reproducibility
6+
FROM mcr.microsoft.com/devcontainers/base:1.2.6-ubuntu-24.04
7+
8+
ENV REMOTE_USER=vscode
9+
10+
# Setup script
11+
COPY setup.sh /tmp/setup.sh
12+
13+
RUN /tmp/setup.sh && \
14+
rm /tmp/setup.sh
15+
16+
# Lifecycle hooks
17+
COPY hooks/ /hooks/
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
# Create shell history cache files if they don't exist for some reason
4+
touch /persist/shellhistory/.bash_history
5+
touch /persist/shellhistory/.zsh_history
6+
7+
# Use GitHub token secret if it exists
8+
if [[ -s /secrets/.ghtoken && -r /secrets/.ghtoken ]]; then
9+
token="$(cat /secrets/.ghtoken)"
10+
confighome="${XDG_CONFIG_HOME:-${HOME}/.config/}"
11+
12+
# Add GitHub token to Nix config
13+
configfile="${confighome}/nix/nix.conf"
14+
tmpfile="$(mktemp)"
15+
16+
mkdir --parents "$(dirname "${configfile}")"
17+
touch "${configfile}"
18+
19+
if grep --quiet extra-access-tokens "${configfile}"; then
20+
sed "s|extra-access-tokens.*|extra-access-tokens = github.com=${token}|" "${configfile}" >"${tmpfile}"
21+
cat "${tmpfile}" >"${configfile}"
22+
rm "${tmpfile}"
23+
else
24+
echo "extra-access-tokens = github.com=${token}" >>"${configfile}"
25+
fi
26+
fi

.devcontainer/image/setup.sh

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!/usr/bin/env bash
2+
3+
REMOTE_USER="${REMOTE_USER:?}"
4+
REMOTE_USER_PASSWD="$(getent passwd "${REMOTE_USER}")"
5+
REMOTE_USER_HOME="$(echo "${REMOTE_USER_PASSWD}" | cut --delimiter ':' --fields 6)"
6+
7+
# Setup default shell
8+
chsh --shell /usr/bin/zsh "${REMOTE_USER}"
9+
10+
# Setup direnv
11+
cat <<EOF >>"${REMOTE_USER_HOME}/.bashrc"
12+
eval "\$(direnv hook bash)"
13+
EOF
14+
15+
cat <<EOF >>"${REMOTE_USER_HOME}/.zshrc"
16+
eval "\$(direnv hook zsh)"
17+
EOF
18+
19+
# Setup starship
20+
cat <<EOF >>"${REMOTE_USER_HOME}/.bashrc"
21+
eval "\$(starship init bash)"
22+
EOF
23+
24+
cat <<EOF >>"${REMOTE_USER_HOME}/.zshrc"
25+
eval "\$(starship init zsh)"
26+
EOF
27+
28+
# Setup secrets directory
29+
mkdir --parents /secrets/
30+
31+
chown --recursive "${REMOTE_USER}:" /secrets/
32+
33+
# Setup shell history cache
34+
mkdir --parents /persist/shellhistory/
35+
36+
touch /persist/shellhistory/.bash_history
37+
touch /persist/shellhistory/.zsh_history
38+
39+
chown --recursive "${REMOTE_USER}:" /persist/shellhistory/
40+
41+
cat <<EOF >>"${REMOTE_USER_HOME}/.bashrc"
42+
export HISTFILE=/persist/shellhistory/.bash_history
43+
EOF
44+
45+
cat <<EOF >>"${REMOTE_USER_HOME}/.zshrc"
46+
export HISTFILE=/persist/shellhistory/.zsh_history
47+
EOF
48+
49+
# Setup trunk cache
50+
mkdir --parents /cache/trunk/
51+
52+
chown --recursive "${REMOTE_USER}:" /cache/trunk/
53+
54+
cat <<EOF >>"${REMOTE_USER_HOME}/.bashrc"
55+
export TRUNK_CACHE=/cache/trunk/
56+
EOF
57+
58+
cat <<EOF >>"${REMOTE_USER_HOME}/.zshrc"
59+
export TRUNK_CACHE=/cache/trunk/
60+
EOF
61+
62+
# Setup npm cache
63+
mkdir --parents /cache/npm/
64+
65+
chown --recursive "${REMOTE_USER}:" /cache/npm/
66+
67+
cat <<EOF >>"${REMOTE_USER_HOME}/.bashrc"
68+
export NPM_CONFIG_CACHE=/cache/npm/
69+
EOF
70+
71+
cat <<EOF >>"${REMOTE_USER_HOME}/.zshrc"
72+
export NPM_CONFIG_CACHE=/cache/npm/
73+
EOF

.dockerignore

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#Task
2+
/.task/
3+
/Taskfile.yaml
4+
/Taskfile.yml
5+
6+
# Misc
7+
.DS_Store
8+
.todo
9+
10+
# Dependencies
11+
/node_modules/
12+
13+
# Build
14+
/build/
15+
16+
# Debug
17+
*.log
18+
19+
# Typescript
20+
*.tsbuildinfo
21+
22+
# Next.js
23+
next-env.d.ts
24+
25+
# Tracked, but not needed
26+
/.devcontainer/
27+
/.github/
28+
/.trunk/
29+
/.vscode/
30+
/docs/
31+
/openapi/
32+
/.copier-answers.yaml
33+
/.dockerignore
34+
/.envrc
35+
/.gitattributes
36+
/.gitignore
37+
/CONTRIBUTING.md
38+
/docker-compose.yaml
39+
/Dockerfile
40+
/eslint.config.mjs
41+
/LICENSE
42+
/openapi-ts.config.mts
43+
/README.md
44+
/stylelint.config.mjs
45+
/Taskfile.dist.yaml

.envrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
# reload when these files change
4+
watch_file flake.lock ./*.nix
5+
6+
# activate the default development shell in the current shell
7+
# --accept-flake-config will accept the nix configuration from the flake without prompting
8+
eval "$(nix print-dev-env path:./ --accept-flake-config)" || true

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Mark everything as vendored
2+
* linguist-vendored
3+
# Treat docs as documentation
4+
/docs/** -linguist-vendored linguist-documentation
5+
# Unmark files in src, so that they are included in language stats
6+
/src/** -linguist-vendored

.github/release.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
changelog:
2+
exclude:
3+
# Exclude PRs with the following labels from the changelog
4+
labels:
5+
- skip-changelog
6+
# Categories are used make sections in the changelog based on PR labels
7+
categories:
8+
- title: 🚀 Features
9+
labels:
10+
- feature
11+
- title: 🐛 Bug Fixes
12+
labels:
13+
- bug
14+
- title: 🧽 Cleanup
15+
labels:
16+
- cleanup

0 commit comments

Comments
 (0)