summaryrefslogtreecommitdiff
path: root/nix/package.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2024-05-22 22:00:02 -0400
committerseth <[email protected]>2024-05-22 20:45:24 -0600
commit8fd8b7e53d59a034706dd7eaad6b608721ce3cdb (patch)
tree2ce7e4a8b7eafc9d8550a54aa6d4f34d678d76f5 /nix/package.nix
parent329bf8a3384474cfe45ecae142dfb7d97b699aa2 (diff)
move to zola
Diffstat (limited to 'nix/package.nix')
-rw-r--r--nix/package.nix56
1 files changed, 56 insertions, 0 deletions
diff --git a/nix/package.nix b/nix/package.nix
new file mode 100644
index 0000000..997bff3
--- /dev/null
+++ b/nix/package.nix
@@ -0,0 +1,56 @@
+{
+ 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];
+ };
+}