Skip to content

Commit a4c42f6

Browse files
committed
Add nix configurations file for development environment
1 parent 6a55bb7 commit a4c42f6

File tree

6 files changed

+118
-19
lines changed

6 files changed

+118
-19
lines changed

.envrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
use nix
2+

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,7 @@ qgisfeedproject/static/bundles
124124
!qgisfeedproject/qgisfeedproject/settings_local.py.templ
125125

126126
# Sustaining members template
127-
qgisfeedproject/templates/layouts/sustaining_members.html
127+
qgisfeedproject/templates/layouts/sustaining_members.html
128+
129+
.vscode
130+
.vscode-extensions

.vscode/settings.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"files.associations": {
3-
"**/*.html": "html",
4-
"**/templates/*/*.html": "django-html",
5-
"**/templates/*": "django-txt",
6-
"**/requirements{/**,*}.{txt,in}": "pip-requirements"
7-
},
8-
9-
"emmet.includeLanguages": {
10-
"django-html": "html"
11-
},
12-
"beautify.language": {
13-
"html": [
14-
"htm",
15-
"html",
16-
"django-html"
17-
]
18-
}
19-
}
2+
"files.associations": {
3+
"**/*.html": "html",
4+
"**/templates/*/*.html": "django-html",
5+
"**/templates/*": "django-txt",
6+
"**/requirements{/**,*}.{txt,in}": "pip-requirements"
7+
},
8+
"emmet.includeLanguages": {
9+
"django-html": "html"
10+
},
11+
"beautify.language": {
12+
"html": [
13+
"htm",
14+
"html",
15+
"django-html"
16+
]
17+
},
18+
"git.enableCommitSigning": true
19+
}

list-vscode-extensions.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
EXT_DIR=".vscode-extensions"
4+
5+
find "$EXT_DIR" -maxdepth 1 -mindepth 1 -type d | while read -r dir; do
6+
pkg="$dir/package.json"
7+
if [[ -f "$pkg" ]]; then
8+
name=$(jq -r '.name' < "$pkg")
9+
publisher=$(jq -r '.publisher' < "$pkg")
10+
version=$(jq -r '.version' < "$pkg")
11+
echo "--install-extension ${publisher}.${name}@${version} \\"
12+
fi
13+
done
14+

shell.nix

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
#let
3+
# #
4+
# # Note that I am using a specific version from NixOS here because of
5+
# # https://github.com/NixOS/nixpkgs/issues/267916#issuecomment-1817481744
6+
# #
7+
# nixpkgs = builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-22.11.tar.gz";
8+
# #nixpkgs = builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/51f732d86fac4693840818ad2aa4781d78be2e89.tar.gz";
9+
# pkgs = import nixpkgs { config = { }; overlays = [ ]; };
10+
# pythonPackages = pkgs.python311Packages;
11+
with import <nixpkgs> {}; let
12+
# For packages pinned to a specific version
13+
#pinnedHash = "617579a787259b9a6419492eaac670a5f7663917";
14+
#pinnedPkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/${pinnedHash}.tar.gz") {};
15+
pinnedPkgs = import (builtins.fetchTarball {
16+
url = "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz";
17+
}) {};
18+
in
19+
pkgs.mkShell rec {
20+
allowUnfree = true;
21+
buildInputs = [
22+
vscode
23+
];
24+
25+
# Now we can execute any commands within the virtual environment.
26+
# This is optional and can be left out to run pip manually.
27+
shellHook = ''
28+
echo "QGIS Feed"
29+
echo "_________________________________________________________"
30+
echo "Command : Description"
31+
echo "_________________________________________________________"
32+
echo "🚀 ./vscode.sh : Open VSCode"
33+
'';
34+
}

vscode.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
#!/usr/bin/env bash
3+
echo "🪛 Installing VSCode Extensions:"
4+
echo "--------------------------------"
5+
6+
7+
# Ensure .vscode directory exists
8+
mkdir -p .vscode
9+
mkdir -p .vscode-extensions
10+
# Define the settings.json file path
11+
SETTINGS_FILE=".vscode/settings.json"
12+
13+
# Ensure settings.json exists
14+
if [[ ! -f "$SETTINGS_FILE" ]]; then
15+
echo "{}" > "$SETTINGS_FILE"
16+
fi
17+
18+
# Update settings.json non-destructively
19+
echo "Updating VSCode settings.json..."
20+
jq '.["git.enableCommitSigning"] = true' \
21+
"$SETTINGS_FILE" > "$SETTINGS_FILE.tmp" && mv "$SETTINGS_FILE.tmp" "$SETTINGS_FILE"
22+
23+
echo "✅ VSCode settings.json updated successfully!"
24+
echo "Contents of settings.json:"
25+
cat "$SETTINGS_FILE"
26+
27+
# Install required extensions
28+
code --user-data-dir='.vscode' \
29+
--profile='nix-config' \
30+
--extensions-dir='.vscode-extensions' . \
31+
--install-extension batisteo.vscode-django@1.15.0 \
32+
--install-extension zhuangtongfa.material-theme@3.19.0 \
33+
--install-extension naumovs.color-highlight@2.8.0 \
34+
--install-extension GitHub.copilot@1.250.0 \
35+
--install-extension teabyii.ayu@1.0.5 \
36+
--install-extension ms-python.debugpy@2025.8.0 \
37+
--install-extension ms-python.vscode-pylance@2025.5.1 \
38+
--install-extension ms-python.python@2025.6.1 \
39+
--install-extension syler.sass-indented@1.8.33 \
40+
--install-extension GitHub.copilot-chat@0.26.7 \
41+
--install-extension eamodio.gitlens@17.1.1 \
42+
43+
# Launch VSCode with the sandboxed environment
44+
code --user-data-dir='.vscode' \
45+
--profile='nix-config' \
46+
--extensions-dir='.vscode-extensions' .

0 commit comments

Comments
 (0)