golang-style
π―Skillfrom fredrikaverpil/dotfiles
Enforces Go programming language code formatting and style guidelines across a project or codebase.
Installation
npx skills add https://github.com/fredrikaverpil/dotfiles --skill golang-styleSkill Details
Overview
# dotfiles π©

Personal dotfiles using [Nix](https://nixos.org) for reproducible system/package
management and [GNU Stow](https://www.gnu.org/software/stow/) for dotfile
symlinking.
Quick start
> [!IMPORTANT]
>
> Make sure your terminal has full disk access on macOS before installing.
```sh
# Clone repo
git clone https://github.com/fredrikaverpil/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
# Install Nix (Determinate Systems installer - enables flakes by default, better uninstall,
# survives macOS updates, consistent installation across Linux/macOS)
# Choose "Determinate Nix" when prompted (performance optimized, better error messages)
# Learn more: https://determinate.systems/nix
# IMPORTANT: choose "no" during install, so to install upstream Nix.
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
# Set hostname to match a configuration in nix/hosts/
# macOS: sudo scutil --set HostName
# Linux: sudo hostnamectl set-hostname
# Apply configuration
# Linux (NixOS):
sudo nixos-rebuild switch --flake ~/.dotfiles#$(hostname)
# macOS (first time only):
sudo nix --extra-experimental-features "nix-command flakes" run nix-darwin -- switch --flake ~/.dotfiles#$(hostname)
# After first-time setup, use the rebuild script:
./rebuild.sh
```
```sh
# Rebuild system + packages + dotfiles (reproducible, uses flake.lock)
./rebuild.sh
# Update ALL flake inputs then rebuild
./rebuild.sh --update
# Update only unstable inputs (nixpkgs-unstable, nix-darwin, home-manager-unstable, dotfiles)
./rebuild.sh --update-unstable
# Dotfiles only (no Nix rebuild)
./rebuild.sh --stow
```
Update stable vs unstable
By default, ./rebuild.sh aims to be "reproducible" and uses the locked
flake.lock. Use --update-unstable to update Darwin-related inputs, or
--update to update all inputs.
```sh
# Update only unstable/Darwin-related inputs
./rebuild.sh --update-unstable
# Or manually: nix flake update nixpkgs-unstable nix-darwin home-manager-unstable dotfiles
# Update only stable/Linux-related inputs
nix flake update nixpkgs home-manager nixos-raspberrypi disko
```
macOS permissions
If you get errors about com.apple.universalaccess or system settings during
nix-darwin activation:
- Grant Full Disk Access to your terminal:
- Open System Settings > Privacy & Security > Full Disk Access
- Click + and add your terminal app (e.g.,
/Applications/Utilities/Terminal.app)
- Enable the checkbox for your terminal
SSL certificate issues (when choosing upstream Nix)
If you get SSL certificate errors after switching from Determinate to upstream
Nix:
```sh
# Fix broken certificate symlink
sudo rm /etc/ssl/certs/ca-certificates.crt
sudo ln -s /etc/ssl/cert.pem /etc/ssl/certs/ca-certificates.crt
# Clean up leftover Determinate configuration
sudo cp /etc/nix/nix.conf /etc/nix/nix.conf.backup
sudo tee /etc/nix/nix.conf << 'EOF'
extra-experimental-features = nix-command flakes
max-jobs = auto
ssl-cert-file = /etc/ssl/cert.pem
EOF
```
General troubleshooting
```sh
# Check configuration
nix flake check ~/.dotfiles
# Verbose rebuild
sudo nixos-rebuild switch --flake ~/.dotfiles --show-trace # Linux
darwin-rebuild switch --flake ~/.dotfiles --show-trace # macOS
# Clean cache
nix-collect-garbage -d
# Rollback
sudo nixos-rebuild --rollback # Linux
darwin-rebuild --rollback # macOS
```
Nix management responsibilities
```txt
βββ nix/ # Nix configurations
β βββ hosts/ # Host-specific configurations
β β βββ $host/ # Individual host directory
β β βββ configuration.nix # System settings
β β βββ