summaryrefslogtreecommitdiff
path: root/default.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2024-07-04 15:58:16 -0400
committerseth <[email protected]>2024-07-04 16:11:35 -0400
commit72ef396c60318d08ab6c30f4b198941f1cc37e6f (patch)
treea33af6a19f54979b3d3334a17fdff5f03f41a78e /default.nix
parentefc8a642742943041a876afa705e7213d4b7c306 (diff)
nix: move package expression to default.nix
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 ];
+ };
+ }
+ ) { };
}