tonybtw.com
tonybtw.com
https://git.tonybtw.com/tonybtw.com.git
git://git.tonybtw.com/tonybtw.com.git
added flake and readme.org
Diff
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..40e2620
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,27 @@
+{
+ "nodes": {
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1757745802,
+ "narHash": "sha256-hLEO2TPj55KcUFUU1vgtHE9UEIOjRcH/4QbmfHNF820=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "c23193b943c6c689d70ee98ce3128239ed9e32d1",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "nixpkgs": "nixpkgs"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..2a7c9a5
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,36 @@
+{
+ description = "Dev shell for this tonybtw.com";
+
+ inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
+
+ outputs = { nixpkgs, ... }:
+ let
+ systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
+ foreach = f: builtins.listToAttrs (map (system: { name = system; value = f system; }) systems);
+ in
+ {
+ devShells = foreach (system:
+ let
+ pkgs = import nixpkgs { inherit system; };
+ common_pkgs = [ pkgs.hugo ];
+ in
+ {
+ default = pkgs.mkShell {
+ packages = common_pkgs;
+ shellHook = ''
+ echo "Hugo dev shell ready."
+ hugo version
+ '';
+ };
+ serve = pkgs.mkShell {
+ packages = common_pkgs;
+ shellHook = ''
+ echo "Hugo dev shell ready."
+ hugo serve
+ '';
+ };
+ }
+ );
+ };
+}
+
diff --git a/readme.org b/readme.org
new file mode 100644
index 0000000..1de3cb6
--- /dev/null
+++ b/readme.org
@@ -0,0 +1,36 @@
+#+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.
+
+* Requirements
+- [[https://nixos.org/download.html][Nix]] installed
+- Flakes enabled (add =experimental-features = nix-command flakes= to =~/.config/nix/nix.conf=)
+
+* 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.
+