From 72ef396c60318d08ab6c30f4b198941f1cc37e6f Mon Sep 17 00:00:00 2001 From: seth Date: Thu, 4 Jul 2024 15:58:16 -0400 Subject: nix: move package expression to default.nix --- default.nix | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) (limited to 'default.nix') 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 ]; + }; + } + ) { }; } -- cgit v1.2.3