Add derivation for static website
This commit is contained in:
parent
f212aae139
commit
1410327b05
4 changed files with 155 additions and 4 deletions
41
flake.nix
41
flake.nix
|
@ -3,13 +3,46 @@
|
|||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
flutils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs }: {
|
||||
outputs = { self, nixpkgs, flutils }: flutils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
||||
packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;
|
||||
gems = pkgs.bundlerEnv {
|
||||
name = "blog-pim";
|
||||
gemdir = ./src;
|
||||
};
|
||||
|
||||
packages.x86_64-linux.default = self.packages.x86_64-linux.hello;
|
||||
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
|
||||
{
|
||||
packages.website = pkgs.stdenv.mkDerivation {
|
||||
name = "blog-pim";
|
||||
src = ./src;
|
||||
sourceRoot = "src";
|
||||
|
||||
};
|
||||
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
|
||||
'';
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue