Add reproducible dev environment

- flake.nix: rebrand description, add Go 1.25, gopls, gotools,
  staticcheck, golangci-lint, gnumake to all dev shells. Add a
  plain `dev` shell (`nix develop .#dev`) that does not wrap the
  shell in the bubblewrap sandbox so contributors can use a
  standard Go toolchain.
- Dockerfile.dev: golang:1.22-bookworm with make, git, gopls and
  staticcheck, /workspace as default cwd. CGO disabled.
- README: document both nix and Docker dev paths.

flake.lock is committed for reproducibility.

Closes #6.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-28 21:58:59 +02:00
co-authored by Claude Opus 4.7
parent a36fc1c8cc
commit b409519661
4 changed files with 116 additions and 8 deletions
+27 -6
View File
@@ -1,5 +1,5 @@
{
description = "Notesium notes environment";
description = "librenotes development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
@@ -12,8 +12,15 @@
pkgs = import nixpkgs { inherit system; config.allowUnfree = true; };
packages = with pkgs; [
# claude-code
gh
# Go toolchain
go_1_25
gopls
gotools
go-tools
golangci-lint
gnumake
# Project CLIs
tea
bubblewrap
];
@@ -43,6 +50,8 @@
--ro-bind "$HOME/.gitconfig" "$HOME/.gitconfig"
--ro-bind "$HOME/.ssh" "$HOME/.ssh"
--setenv GIT_SSH_COMMAND "ssh -F ~/.ssh/config"
--ro-bind "$HOME/.config/tea" "$HOME/.config/tea"
--ro-bind "$HOME/.config/gh" "$HOME/.config/gh"
--ro-bind "$HOME/.local/bin" "$HOME/.local/bin"
@@ -74,9 +83,9 @@
export SHELL_FUNCTIONS="${shellFunctionsScript}"
if [ ! -t 0 ] || [ -n "$NIX_DEVELOP_COMMAND" ]; then
echo "=== Notesium (sandbox: enter-sandbox) ==="
echo "=== librenotes (sandbox: enter-sandbox) ==="
else
echo "=== Notesium Sandbox ==="
echo "=== librenotes Sandbox ==="
echo "WRITE: $PWD, ~/.claude"
exec enter-sandbox ${pkgs.bash}/bin/bash --rcfile <(cat << 'SANDBOX_BASHRC'
source "$SHELL_FUNCTIONS"
@@ -91,7 +100,19 @@ SANDBOX_BASHRC
buildInputs = packages;
shellHook = ''
${shellFunctions}
echo "=== Notesium (YOLO - no sandbox) ==="
echo "=== librenotes (YOLO - no sandbox) ==="
'';
};
# Plain Go dev shell, no sandbox wrapping. For contributors who
# just want `nix develop .#dev` to get a working toolchain.
dev = pkgs.mkShell {
buildInputs = with pkgs; [
go_1_25 gopls gotools go-tools golangci-lint gnumake
];
shellHook = ''
echo "=== librenotes dev ==="
echo "go: $(go version)"
'';
};
};