From b43f393aff80a112787958e4ae6de20b493fc877 Mon Sep 17 00:00:00 2001 From: Audrey Dutcher Date: Sun, 20 Apr 2025 11:32:31 -0700 Subject: [PATCH] initial commit --- .gitignore | 1 + blog.nix | 21 +++++++++++++++ flake-old.nix | 51 ++++++++++++++++++++++++++++++++++++ flake.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 15 +++++++++++ posts.nix | 4 +++ posts/hello/body.md | 3 +++ posts/hello/post.nix | 6 +++++ 8 files changed, 162 insertions(+) create mode 100644 .gitignore create mode 100644 blog.nix create mode 100644 flake-old.nix create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 posts.nix create mode 100644 posts/hello/body.md create mode 100644 posts/hello/post.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d6944e3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/result* diff --git a/blog.nix b/blog.nix new file mode 100644 index 0000000..f22b0cd --- /dev/null +++ b/blog.nix @@ -0,0 +1,21 @@ +{ + baseUrl = "https://blog.rhelmot.io/"; + siteTitle = "rhelmot blog"; + language = "en-US"; + + footer.html = '' + Posts icensed CC-BY-NC 4.0 + ''; + + pages = [ + { + path = "index.html"; + title = "Home"; + + head = '' + + ''; + body.html = ""; + } + ]; +} diff --git a/flake-old.nix b/flake-old.nix new file mode 100644 index 0000000..05726bd --- /dev/null +++ b/flake-old.nix @@ -0,0 +1,51 @@ +{ + inputs.nixpkgs.url = "github:nixos/nixpkgs/release-24.11"; + outputs = { nixpkgs, ... }: let + platforms = [ "x86_64-linux" "x86_64-darwin" "x86_64-freebsd" "aarch64-linux" "aarch64-darwin" "aarch64-freebsd" ]; + eachPlatform = platform: let + pkgs = nixpkgs.legacyPackages.${platform}; + no-style-please = pkgs.buildRubyGem { + gemName = "no-style-please"; + version = "0.4.9"; + source.sha256 = "sha256-OsM7CkqnfnQviufTyWJC6ISHl0voDOp3+5RuPr2Z72Y="; + }; + jektex = pkgs.buildRubyGem { + gemName = "jektex"; + version = "0.1.1"; + source.sha256 = "sha256-qC0E9rYMrQbtGt1CbGJxivYSHVwG/uiFmse+5ug0Rw8="; + }; + htmlentities = pkgs.buildRubyGem { + gemName = "htmlentities"; + version = "4.3.4"; + source.sha256 = "sha256-Elpzxsny0bYhALfDxAHjYkRBtmN2Kvp/5ChHZDWmc9o="; + }; + rubyEnv = pkgs.ruby.withPackages (p: with p; [ + jekyll + no-style-please + jekyll-feed + jekyll-seo-tag + jektex + kramdown-parser-gfm + execjs + htmlentities + ]); + site = pkgs.runCommand "blog.rhelmot.io" { + nativeBuildInputs = [ + rubyEnv + pkgs.nodejs + ]; + } '' + mkdir -p source + cd source + cp -r ${./blog}/* . + cp -r ${no-style-please}/lib/ruby/gems/*/gems/*/{_sass,_layouts,_includes} . + jekyll build -s . -d "$out" + ''; + in { + name = platform; + value = { default = site; }; + }; + in { + packages = builtins.listToAttrs (builtins.map eachPlatform platforms); + }; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..db53841 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "coricamu": { + "inputs": { + "nixpkgs": "nixpkgs", + "utils": "utils" + }, + "locked": { + "lastModified": 1677749800, + "narHash": "sha256-xIqxDr4fkOA5R4OudbQoUMS8xvPJNCyGfqugENutSP4=", + "owner": "danth", + "repo": "coricamu", + "rev": "40db414609dc6d72319987d3e9d7b56fe405c28f", + "type": "github" + }, + "original": { + "owner": "danth", + "repo": "coricamu", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1654845941, + "narHash": "sha256-uXulXu4BQ9ch1ItV0FlL2Ns8X83m6unT5h/0X//VRLQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "7b3e907a6fef935794b5049c2c57c519853deb90", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "coricamu": "coricamu" + } + }, + "utils": { + "locked": { + "lastModified": 1642700792, + "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..2240e27 --- /dev/null +++ b/flake.nix @@ -0,0 +1,15 @@ +{ + inputs.coricamu.url = "github:danth/coricamu"; + + outputs = { coricamu, ... }: let + posts = let + listingMap = builtins.readDir ./posts; + listing = builtins.attrNames listingMap; + getPostFile = post: (import ./posts/${post}/post.nix) // { slug = post; }; + in builtins.map getPostFile listing; + in + coricamu.lib.generateFlakeOutputs { + outputName = "blog"; + modules = [ ./blog.nix { inherit posts; }]; + }; +} diff --git a/posts.nix b/posts.nix new file mode 100644 index 0000000..2bbdc9b --- /dev/null +++ b/posts.nix @@ -0,0 +1,4 @@ +{ + posts = [ + ]; +} diff --git a/posts/hello/body.md b/posts/hello/body.md new file mode 100644 index 0000000..2e157df --- /dev/null +++ b/posts/hello/body.md @@ -0,0 +1,3 @@ +Hello world! This is a test post. + +There will be a real post here soon. diff --git a/posts/hello/post.nix b/posts/hello/post.nix new file mode 100644 index 0000000..30bcc3f --- /dev/null +++ b/posts/hello/post.nix @@ -0,0 +1,6 @@ +{ + authors = [ "Audrey Dutcher" ]; + datetime = "2025-04-20 03:20-0700"; + title = "First post!!1!"; + body.markdownFile = ./body.md; +}