depot/packages/websites/landing/project.nix

45 lines
1.1 KiB
Nix
Raw Normal View History

2022-07-31 17:40:33 +03:00
{ lib, pkgs, self', ... }:
let
theme = self'.packages.gohugo-theme-ananke;
themeName = "ananke";
2022-07-31 16:48:55 +03:00
2022-07-31 17:40:33 +03:00
themesDir = "${theme}/share/hugo/themes";
configFile = pkgs.writeText "hugo-config.json" (builtins.toJSON {
title = "Private Void | Zero-maintenance perfection";
baseURL = "https://www.privatevoid.net/";
languageCode = "en-us";
theme = themeName;
inherit themesDir;
});
hugoArgs = [
"--config" configFile
];
2022-07-31 17:56:08 +03:00
hugoArgsStr = lib.concatStringsSep " " hugoArgs;
2022-07-31 17:40:33 +03:00
in
2022-07-31 16:48:55 +03:00
{
projectShells.landing = {
2022-07-31 17:40:33 +03:00
commands.hugo = {
help = pkgs.hugo.meta.description;
2022-07-31 17:56:08 +03:00
command = "exec ${pkgs.hugo}/bin/hugo ${hugoArgsStr} \"$@\"";
2022-07-31 17:40:33 +03:00
};
2022-07-31 16:48:55 +03:00
};
2022-07-31 17:56:08 +03:00
packages.landing = with pkgs; let
site = stdenvNoCC.mkDerivation rec {
pname = "private-void-landing-page";
version = "0.0.0";
src = ./.;
nativeBuildInputs = [
hugo
];
buildCommand = ''
unpackPhase
mkdir -p $out/share/www
hugo ${hugoArgsStr} -s $sourceRoot -d $out/share/www/${pname}
'';
passthru.webroot = "${site}/share/www/${site.pname}";
};
in site;
2022-07-31 16:48:55 +03:00
}