website/flake.nix
Magic_RB 6b5cb3b5ab
Fix make
Signed-off-by: Magic_RB <magic_rb@redalder.org>
2021-03-07 19:31:35 +01:00

43 lines
1.1 KiB
Nix

{
inputs = {
nixpkgs.url = "nixpkgs";
org-thtml = {
url = "github:juanjosegarciaripoll/org-thtml";
flake = false;
};
};
outputs = { self, nixpkgs, org-thtml }:
let
supportedSystems = [ "x86_64-linux" "i686-linux" "aarch64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
in
{
website = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
in
pkgs.stdenv.mkDerivation {
name = "magic_rb-website";
version = "0.1";
src = ./.;
nativeBuildInputs = [ pkgs.emacs ];
buildPhase = ''
cp ${org-thtml}/ox-thtml.el ./ox-thtml.el
mkdir tmp && export HOME=$(pwd)/tmp
emacs --script ./make.el
find public_html -name 'sitemap.*' -exec rm {} \;
'';
installPhase = ''
mkdir -p $out
cp -r public_html/* $out
'';
}
);
};
}