From 6db0ac047033bcb8c11a6da495a3748e22aa7718 Mon Sep 17 00:00:00 2001 From: mtgmonkey Date: Sat, 7 Jun 2025 19:41:35 -0400 Subject: [PATCH] nixify --- flake.lock | 26 ++++++++++++++++++++++++++ flake.nix | 24 ++++++++++++++++++++++++ package.nix | 30 ++++++++++++++++++++++++++++++ public/404.html | 3 +++ public/index.html | 43 +++++++++++++++++++++++++++++++++++++++++++ public/robots.txt | 4 ++++ public/sitemap.xml | 6 ++++++ 7 files changed, 136 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 package.nix create mode 100644 public/404.html create mode 100644 public/index.html create mode 100644 public/robots.txt create mode 100644 public/sitemap.xml diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..e33e0e4 --- /dev/null +++ b/flake.lock @@ -0,0 +1,26 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1749143949, + "narHash": "sha256-QuUtALJpVrPnPeozlUG/y+oIMSLdptHxb3GK6cpSVhA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d3d2d80a2191a73d1e86456a751b83aa13085d7d", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..ed96b63 --- /dev/null +++ b/flake.nix @@ -0,0 +1,24 @@ +{ + inputs = { + nixpkgs.url = "nixpkgs/nixos-unstable"; + }; + outputs = {nixpkgs, ...}: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in { + packages.${system} = { + default = pkgs.callPackage ./package.nix {}; + }; + devShells.${system} = { + default = pkgs.mkShell { + nativeBuildInputs = [ + pkgs.zola + pkgs.tokei + ]; + shellHook = '' + ${pkgs.cowsay}/bin/cowsay Welcome to the devshell + ''; + }; + }; + }; +} diff --git a/package.nix b/package.nix new file mode 100644 index 0000000..40ac872 --- /dev/null +++ b/package.nix @@ -0,0 +1,30 @@ +{ + zola, + lib, + stdenv, + ... +}: +stdenv.mkDerivation { + pname = "elmskell-blog"; + version = "0.1.0"; + src = ./.; + nativeBuildInputs = [ + zola + ]; + configurePhase = '' + zola check + ''; + buildPhase = '' + zola build + ''; + installPhase = '' + mkdir -p $out/wwwroot + cp ./public/* $out/wwwroot/ -r + ''; + meta = { + description = "Andromeda's blog, statically served via Zola"; + longDescription = "Andromeda's blog, statically served via Zola"; + homepage = "https://mtgmonkey.net"; + license = lib.licenses.wtfpl; + }; +} diff --git a/public/404.html b/public/404.html new file mode 100644 index 0000000..f8414f0 --- /dev/null +++ b/public/404.html @@ -0,0 +1,3 @@ + +404 Not Found +

404 Not Found

diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..43f970e --- /dev/null +++ b/public/index.html @@ -0,0 +1,43 @@ + + + Zola + + +
+

Welcome to Zola!

+

+ You're seeing this page because we couldn't find a template to render. +

+

+ To modify this page, create a index.html file in the templates directory or + install a theme. +
+ You can find what variables are available in this template in the documentation. +

+
+ + + + diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..a558a24 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Disallow: +Allow: / +Sitemap: https://mtgmonkey.net/sitemap.xml diff --git a/public/sitemap.xml b/public/sitemap.xml new file mode 100644 index 0000000..15288fa --- /dev/null +++ b/public/sitemap.xml @@ -0,0 +1,6 @@ + + + + https://mtgmonkey.net/ + +