diff options
Diffstat (limited to 'nix/package.nix')
| -rw-r--r-- | nix/package.nix | 56 |
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]; + }; +} |
