2024-04-26 10:59:32 +02:00
|
|
|
{
|
|
|
|
description = "A very basic flake";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
2024-04-26 11:48:32 +02:00
|
|
|
flutils.url = "github:numtide/flake-utils";
|
2024-04-26 10:59:32 +02:00
|
|
|
};
|
|
|
|
|
2025-01-12 13:02:40 +01:00
|
|
|
outputs = {
|
|
|
|
nixpkgs,
|
|
|
|
flutils,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
flutils.lib.eachDefaultSystem (system: let
|
2024-04-26 11:48:32 +02:00
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
2024-04-26 10:59:32 +02:00
|
|
|
|
2024-04-26 11:48:32 +02:00
|
|
|
gems = pkgs.bundlerEnv {
|
2024-12-29 22:49:54 +01:00
|
|
|
name = "blog";
|
2024-04-26 11:48:32 +02:00
|
|
|
gemdir = ./src;
|
|
|
|
};
|
2024-04-26 10:59:32 +02:00
|
|
|
|
2024-04-26 11:48:32 +02:00
|
|
|
patch-feed-date = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "path-feed-date";
|
2025-01-12 13:02:40 +01:00
|
|
|
propagatedBuildInputs = [pkgs.python3];
|
2024-04-26 11:48:32 +02:00
|
|
|
dontUnpack = true;
|
|
|
|
installPhase = "install -Dm755 ${./patch-feed-date.py} $out/bin/patch-feed-date";
|
|
|
|
};
|
2025-01-12 13:02:40 +01:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
gems
|
|
|
|
gems.wrappedRuby
|
|
|
|
patch-feed-date
|
|
|
|
];
|
|
|
|
in {
|
|
|
|
packages = rec {
|
|
|
|
default = static-website;
|
2024-04-30 23:10:28 +02:00
|
|
|
static-website = pkgs.stdenv.mkDerivation {
|
2024-12-29 22:49:54 +01:00
|
|
|
name = "blog";
|
2024-04-30 23:10:28 +02:00
|
|
|
src = ./src;
|
|
|
|
sourceRoot = "src";
|
2025-01-12 13:02:40 +01:00
|
|
|
inherit buildInputs;
|
2024-04-30 23:10:28 +02:00
|
|
|
|
|
|
|
buildPhase = ''
|
2024-05-03 20:43:37 +02:00
|
|
|
bundle exec jekyll build --future
|
2024-04-30 23:10:28 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r _site/* $out/
|
|
|
|
patch-feed-date --file _site/feed.xml > $out/feed.xml
|
|
|
|
'';
|
|
|
|
};
|
2024-04-26 11:48:32 +02:00
|
|
|
};
|
2025-01-12 13:02:40 +01:00
|
|
|
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
|
|
inherit buildInputs;
|
|
|
|
};
|
2024-04-26 11:48:32 +02:00
|
|
|
});
|
2024-04-26 10:59:32 +02:00
|
|
|
}
|