tonybtw.com

tonybtw.com

https://git.tonybtw.com/tonybtw.com.git git://git.tonybtw.com/tonybtw.com.git
3,271 bytes raw
1
#+TITLE: tonybtw.com
2
3
* About
4
This is the source for [[https://tonybtw.com][tonybtw.com]], a Hugo-based static site.  
5
The repository includes a =flake.nix= so you can get a reproducible Hugo environment with Nix.
6
* Contributing
7
There is a =/community/= section where people can share Linux tutorials, tips, or rices.
8
9
1. Copy =example.md= from =content/community/= and rename it to your own article, e.g. =my-guide.md=.
10
2. Edit the front matter and body to fit your content. Keep the same structure for consistency.
11
   - Minimal front matter example:
12
     #+BEGIN_SRC yaml
13
     ---
14
     title: "My Cool Setup"
15
     author: "Your Name"
16
     date: 2025-09-15
17
     description: "A short blurb about your contribution."
18
     image: "/img/community/your-name/screenshot.png"
19
     ---
20
     #+END_SRC
21
3. Place any screenshots in your own folder under =static/img/community/<your-name>=.
22
   - Example: =static/img/community/alice/my-screenshot.png=
23
   - In your Markdown, reference them as =/img/community/alice/my-screenshot.png=.
24
4. Submit a pull request with your Markdown file and images.
25
26
This way, everyone’s contributions stay organized and easy to render.
27
28
* Requirements
29
- [[https://nixos.org/download.html][Nix]] installed  
30
- Flakes enabled (=nix-command flakes=)
31
32
* Usage
33
Clone the repo and enter the development shell:
34
35
#+BEGIN_SRC sh
36
git clone https://github.com/tonybanters/tonybtw.com
37
cd tonybtw.com
38
nix develop
39
#+END_SRC
40
41
Inside the shell, run Hugo:
42
43
#+BEGIN_SRC sh
44
hugo serve
45
#+END_SRC
46
47
This starts the development server at http://localhost:1313.
48
49
* Alternate dev shell
50
If you prefer =nix= to start the server automatically:
51
52
#+BEGIN_SRC sh
53
nix develop .#serve
54
#+END_SRC
55
56
This launches =hugo serve= right away.
57
58
* Building for production
59
To generate the static site in =public/=:
60
61
#+BEGIN_SRC sh
62
nix develop --command hugo
63
#+END_SRC
64
65
* Installing Nix and enabling flakes
66
** NixOS
67
1. On NixOS, Nix is already installed.  
68
2. Enable flakes system-wide by adding to =/etc/nixos/configuration.nix= (or wherever your configuarion.nix is defined):  
69
   #+BEGIN_EXAMPLE
70
   experimental-features = nix-command flakes
71
   #+END_EXAMPLE
72
3. Rebuild your system if you use flakes for your config, or just restart shells for it to take effect.
73
74
** Arch Linux
75
1. Install Nix from the official repos:
76
   #+BEGIN_SRC sh
77
   sudo pacman -S nix
78
   #+END_SRC
79
2. Enable the Nix daemon:
80
   #+BEGIN_SRC sh
81
   sudo systemctl enable --now nix-daemon.service
82
   #+END_SRC
83
3. Add flake support to =~/.config/nix/nix.conf=:
84
   #+BEGIN_EXAMPLE
85
   experimental-features = nix-command flakes
86
   #+END_EXAMPLE
87
88
** Gentoo
89
1. Enable the overlay and emerge Nix:
90
   #+BEGIN_SRC sh
91
   sudo emerge --ask app-misc/nix
92
   #+END_SRC
93
2. Enable the Nix daemon:
94
   #+BEGIN_SRC sh
95
   sudo rc-update add nix-daemon default
96
   sudo rc-service nix-daemon start
97
   #+END_SRC
98
3. Add flake support to =~/.config/nix/nix.conf=:
99
   #+BEGIN_EXAMPLE
100
   experimental-features = nix-command flakes
101
   #+END_EXAMPLE
102
103
** macOS
104
1. Install Nix using the official script (don’t use Homebrew):
105
   #+BEGIN_SRC sh
106
   curl -L https://nixos.org/nix/install | sh
107
   #+END_SRC
108
2. Enable flakes by editing =~/.config/nix/nix.conf= and adding:
109
   #+BEGIN_EXAMPLE
110
   experimental-features = nix-command flakes
111
   #+END_EXAMPLE