summaryrefslogtreecommitdiff
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
parentefc8a642742943041a876afa705e7213d4b7c306 (diff)
nix: move package expression to default.nix
-rw-r--r--default.nix57
-rw-r--r--nix/package.nix54
2 files changed, 56 insertions, 55 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 ];
+ };
+ }
+ ) { };
}
diff --git a/nix/package.nix b/nix/package.nix
deleted file mode 100644
index a875712..0000000
--- a/nix/package.nix
+++ /dev/null
@@ -1,54 +0,0 @@
-{
- 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 ];
- };
-}