website/flake.nix
Magic_RB e2249619a8
Move container to systems, simplify
Signed-off-by: Magic_RB <magic_rb@redalder.org>
2021-05-12 12:17:30 +02:00

52 lines
1.3 KiB
Nix

{
inputs = {
nixpkgs.url = "nixpkgs";
org-thtml = {
url = "github:juanjosegarciaripoll/org-thtml";
flake = false;
};
emacs-htmlize = {
url = "github:hniksic/emacs-htmlize";
flake = false;
};
};
outputs = { self, nixpkgs, nixng, org-thtml, emacs-htmlize, ... }@inputs:
let
supportedSystems = [ "x86_64-linux" "i686-linux" "aarch64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
in
{
website = pkgs:
pkgs.stdenv.mkDerivation {
name = "magic_rb-website";
version = "0.1";
src = ./.;
nativeBuildInputs = [ pkgs.emacs ];
buildPhase = ''
cp ${org-thtml}/ox-thtml.el ./ox-thtml.el
cp ${emacs-htmlize}/htmlize.el ./htmlize.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
'';
};
defaultPackage = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
in
self.website pkgs
);
};
}