summaryrefslogtreecommitdiff
path: root/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix57
1 files changed, 56 insertions, 1 deletions
diff --git a/default.nix b/default.nix
index fed42e8..b96f89e 100644
--- a/default.nix
+++ b/default.nix
@@ -8,5 +8,60 @@
system ? builtins.currentSystem,
}:
{
- website = pkgs.callPackage ./nix/package.nix { };
+ website = pkgs.callPackage (
+ {
+ lib,
+ stdenvNoCC,
+ writeShellApplication,
+ zola,
+ }:
+ stdenvNoCC.mkDerivation {
+ name = "getchoo-website";
+
+ src = lib.fileset.toSource {
+ root = ./.;
+ fileset = lib.fileset.unions [
+ ./config.toml
+ ./content
+ ./highlight_themes
+ ./static
+ ./templates
+ ];
+ };
+
+ nativeBuildInputs = [ zola ];
+
+ dontConfigure = true;
+ doCheck = false;
+
+ buildPhase = ''
+ runHook preBuild
+ zola build
+ runHook postBuild
+ '';
+
+ installPhase = ''
+ runHook preInstall
+ mv public $out
+ runHook postInstall
+ '';
+
+ passthru = {
+ serve = writeShellApplication {
+ name = "serve";
+ runtimeInputs = [ zola ];
+
+ text = ''
+ zola serve
+ '';
+ };
+ };
+
+ meta = {
+ homepage = "https://github.com/getchoo/website";
+ license = lib.licenses.mit;
+ maintainers = with lib.maintainers; [ getchoo ];
+ };
+ }
+ ) { };
}