Compare commits
3 Commits
1772b80ab3
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 922efcac5e | |||
| a0d3a5fca2 | |||
| cacde649a2 |
49
README.md
49
README.md
@@ -1,6 +1,10 @@
|
||||
# Cute Seal Fanpage
|
||||
|
||||
> An experiment using [Nix](https://nixos.org/), [Hakyll](https://jaspervdj.be/hakyll/), [Haskell](https://www.haskell.org/), and [shell scripts](https://en.wikipedia.org/wiki/Bourne_shell) to automate a simple website deployment pipeline.
|
||||
> An experiment using [Nix](https://nixos.org/),
|
||||
> [Hakyll](https://jaspervdj.be/hakyll/),
|
||||
> [Haskell](https://www.haskell.org/),
|
||||
> and [shell scripts](https://en.wikipedia.org/wiki/Bourne_shell)
|
||||
> to automate a simple website deployment pipeline.
|
||||
|
||||
## Why Seals?
|
||||
|
||||
@@ -10,30 +14,19 @@ It's an in-joke.
|
||||
|
||||
seal-blog/
|
||||
|
||||
- devops/
|
||||
- build.sh
|
||||
- Uses a [nix-shell](https://nixos.wiki/wiki/Development_environment_with_nix-shell) expression to build the Hakyll executable
|
||||
|
||||
- configuration.nix
|
||||
- The [configuration file for the NixOS](https://nixos.org/manual/nixos/stable/index.html#ch-configuration) production server. This takes care of installing all the necessary software, setup [Nginx](https://www.nginx.com/), and get [ACME certs](https://en.wikipedia.org/wiki/Automated_Certificate_Management_Environment) for verification.
|
||||
|
||||
- newSealPost.sh
|
||||
- Script to be called daily by a cron job on the server. Generates the post for the day, builds and commits.
|
||||
|
||||
- website/
|
||||
- A basic Hakyll site, slightly modified to serve seals. Most of the site is generated from the `site.hs` file. Check the [Hakyll](https://jaspervdj.be/hakyll/) documentation for more info.
|
||||
|
||||
## Work to be done
|
||||
|
||||
- The blog post generation and the hosting of the website are currently intertwined when they should be separated
|
||||
- Seal post generator just makes posts
|
||||
- Hakyll blog imports or calls the post generator
|
||||
- The deployed server/nix config file has a cron job for adding a new blog and committing every day
|
||||
- Need to move the blog and post generation inside nixos-apps on my beefier server
|
||||
- The configuration file here is for it's own Linode, the current small one running, but I have a better setup for that now
|
||||
- Pull out the useful parts for my deployed server, remove anything not necessary for a small config file
|
||||
- Also switch to using caddy if not already
|
||||
- Experiment with `*` A records
|
||||
- For the seal blog
|
||||
- Instead of having `www` and `git` and `...` subdomains spelled out in Namecheap
|
||||
- Just have a `*` record and have caddy do the filtering
|
||||
- `flake.nix`
|
||||
- The specification for everything is repo can do.
|
||||
- Defines the hakyll site build instructions, as well as sets it as an app to be run with `nix run .#hakyll-site`.
|
||||
- Defines the blog generation command as an app to be run with `nix run .#generateSealPosts`.
|
||||
- Creates a shell with the same ghc installed, as well as other haskell tools.
|
||||
- For use with `nix develop .` or [direnv](https://direnv.net)
|
||||
- `site.hs`
|
||||
- The hakyll blog is defined here.
|
||||
- Pulls in the rest of the files in this repo and creates a static site at `_site`.
|
||||
- `config.dhall`
|
||||
- The config file for the blog generation, run with `nix run .#generateSealPosts`.
|
||||
- Uses a pseudo random number generator, change the seed to see different outputs in the `postsOutputPath` (default `./posts/`).
|
||||
- The rest of the code is related to the static hakyll site itself.
|
||||
- I've tried putting it in it's own `src` or `website` folder but
|
||||
- it feels like needless refactoring
|
||||
- I can't get the flake operations to work :(
|
||||
|
||||
20
flake.lock
generated
20
flake.lock
generated
@@ -2,11 +2,11 @@
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1691421349,
|
||||
"narHash": "sha256-RRJyX0CUrs4uW4gMhd/X4rcDG8PTgaaCQM5rXEJOx6g=",
|
||||
"lastModified": 1695559356,
|
||||
"narHash": "sha256-kXZ1pUoImD9OEbPCwpTz4tHsNTr4CIyIfXb3ocuR8sI=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "011567f35433879aae5024fc6ec53f2a0568a6c4",
|
||||
"rev": "261abe8a44a7e8392598d038d2e01f7b33cf26d0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -33,11 +33,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1691530010,
|
||||
"narHash": "sha256-4xtMxEstoQ0iM/BOgGhla08xL/DFjS0+Q8nLOl9Gmls=",
|
||||
"lastModified": 1695735961,
|
||||
"narHash": "sha256-QdP/+To3ZPbicOEuFmCDAU0PNOiJbfstMVjk+mGP8OY=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "f25dd9c99382fd4e945e4d0d034254fc552d9aca",
|
||||
"revCount": 14,
|
||||
"rev": "f4abf812ada6adf9d6371e424bcacfcda20e8f26",
|
||||
"revCount": 15,
|
||||
"type": "git",
|
||||
"url": "https://git.ewanick.com/bill/sealPostGenerator.git"
|
||||
},
|
||||
@@ -66,11 +66,11 @@
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1689068808,
|
||||
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
|
||||
"lastModified": 1694529238,
|
||||
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
|
||||
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
name: website
|
||||
version: 0.1.0.0
|
||||
build-type: Simple
|
||||
cabal-version: >= 1.10
|
||||
|
||||
executable site
|
||||
main-is: site.hs
|
||||
build-depends: base == 4.*
|
||||
, hakyll == 4.13.*
|
||||
ghc-options: -threaded
|
||||
default-language: Haskell2010
|
||||
Reference in New Issue
Block a user