#+TITLE: tonybtw.com * About This is the source for [[https://tonybtw.com][tonybtw.com]], a Hugo-based static site. The repository includes a =flake.nix= so you can get a reproducible Hugo environment with Nix. * Contributing There is a =/community/= section where people can share Linux tutorials, tips, or rices. 1. Copy =example.md= from =content/community/= and rename it to your own article, e.g. =my-guide.md=. 2. Edit the front matter and body to fit your content. Keep the same structure for consistency. - Minimal front matter example: #+BEGIN_SRC yaml --- title: "My Cool Setup" author: "Your Name" date: 2025-09-15 description: "A short blurb about your contribution." image: "/img/community/your-name/screenshot.png" --- #+END_SRC 3. Place any screenshots in your own folder under =static/img/community/=. - Example: =static/img/community/alice/my-screenshot.png= - In your Markdown, reference them as =/img/community/alice/my-screenshot.png=. 4. Submit a pull request with your Markdown file and images. This way, everyone’s contributions stay organized and easy to render. * Requirements - [[https://nixos.org/download.html][Nix]] installed - Flakes enabled (=nix-command flakes=) * Usage Clone the repo and enter the development shell: #+BEGIN_SRC sh git clone https://github.com/tonybanters/tonybtw.com cd tonybtw.com nix develop #+END_SRC Inside the shell, run Hugo: #+BEGIN_SRC sh hugo serve #+END_SRC This starts the development server at http://localhost:1313. * Alternate dev shell If you prefer =nix= to start the server automatically: #+BEGIN_SRC sh nix develop .#serve #+END_SRC This launches =hugo serve= right away. * Building for production To generate the static site in =public/=: #+BEGIN_SRC sh nix develop --command hugo #+END_SRC * Installing Nix and enabling flakes ** NixOS 1. On NixOS, Nix is already installed. 2. Enable flakes system-wide by adding to =/etc/nixos/configuration.nix= (or wherever your configuarion.nix is defined): #+BEGIN_EXAMPLE experimental-features = nix-command flakes #+END_EXAMPLE 3. Rebuild your system if you use flakes for your config, or just restart shells for it to take effect. ** Arch Linux 1. Install Nix from the official repos: #+BEGIN_SRC sh sudo pacman -S nix #+END_SRC 2. Enable the Nix daemon: #+BEGIN_SRC sh sudo systemctl enable --now nix-daemon.service #+END_SRC 3. Add flake support to =~/.config/nix/nix.conf=: #+BEGIN_EXAMPLE experimental-features = nix-command flakes #+END_EXAMPLE ** Gentoo 1. Enable the overlay and emerge Nix: #+BEGIN_SRC sh sudo emerge --ask app-misc/nix #+END_SRC 2. Enable the Nix daemon: #+BEGIN_SRC sh sudo rc-update add nix-daemon default sudo rc-service nix-daemon start #+END_SRC 3. Add flake support to =~/.config/nix/nix.conf=: #+BEGIN_EXAMPLE experimental-features = nix-command flakes #+END_EXAMPLE ** macOS 1. Install Nix using the official script (don’t use Homebrew): #+BEGIN_SRC sh curl -L https://nixos.org/nix/install | sh #+END_SRC 2. Enable flakes by editing =~/.config/nix/nix.conf= and adding: #+BEGIN_EXAMPLE experimental-features = nix-command flakes #+END_EXAMPLE