initial commit

This commit is contained in:
Audrey 2025-04-20 11:32:31 -07:00
commit b43f393aff
8 changed files with 162 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/result*

21
blog.nix Normal file
View File

@ -0,0 +1,21 @@
{
baseUrl = "https://blog.rhelmot.io/";
siteTitle = "rhelmot blog";
language = "en-US";
footer.html = ''
Posts icensed <a href="https://creativecommons.org/licenses/by-nc/4.0">CC-BY-NC 4.0</a>
'';
pages = [
{
path = "index.html";
title = "Home";
head = ''
<meta http-equiv="Refresh" content="0; url='/posts'" />
'';
body.html = "";
}
];
}

51
flake-old.nix Normal file
View File

@ -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);
};
}

61
flake.lock Normal file
View File

@ -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
}

15
flake.nix Normal file
View File

@ -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; }];
};
}

4
posts.nix Normal file
View File

@ -0,0 +1,4 @@
{
posts = [
];
}

3
posts/hello/body.md Normal file
View File

@ -0,0 +1,3 @@
Hello world! This is a test post.
There will be a real post here soon.

6
posts/hello/post.nix Normal file
View File

@ -0,0 +1,6 @@
{
authors = [ "Audrey Dutcher" ];
datetime = "2025-04-20 03:20-0700";
title = "First post!!1!";
body.markdownFile = ./body.md;
}