diff options
| -rw-r--r-- | default.nix | 57 | ||||
| -rw-r--r-- | nix/package.nix | 54 |
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 ]; - }; -} |
