blog-pim/flake.nix

49 lines
1.1 KiB
Nix
Raw Normal View History

2024-04-26 08:59:32 +00:00
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
2024-04-26 09:48:32 +00:00
flutils.url = "github:numtide/flake-utils";
2024-04-26 08:59:32 +00:00
};
2024-04-26 09:48:32 +00:00
outputs = { self, nixpkgs, flutils }: flutils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
2024-04-26 08:59:32 +00:00
2024-04-26 09:48:32 +00:00
gems = pkgs.bundlerEnv {
name = "blog-pim";
gemdir = ./src;
};
2024-04-26 08:59:32 +00:00
2024-04-26 09:48:32 +00:00
patch-feed-date = pkgs.stdenv.mkDerivation {
name = "path-feed-date";
propagatedBuildInputs = [ pkgs.python3 ];
dontUnpack = true;
installPhase = "install -Dm755 ${./patch-feed-date.py} $out/bin/patch-feed-date";
};
in
{
2024-04-26 13:12:23 +00:00
packages.static-website = pkgs.stdenv.mkDerivation {
2024-04-26 09:48:32 +00:00
name = "blog-pim";
src = ./src;
sourceRoot = "src";
2024-04-26 08:59:32 +00:00
2024-04-26 09:48:32 +00:00
buildInputs = [
gems
gems.wrappedRuby
patch-feed-date
];
buildPhase = ''
bundle exec jekyll build
'';
installPhase = ''
mkdir -p $out
cp -r _site/* $out/
patch-feed-date --file _site/feed.xml > $out/feed.xml
'';
};
});
2024-04-26 08:59:32 +00:00
}