75 lines
1.7 KiB
Nix
75 lines
1.7 KiB
Nix
{
|
|
description = "c8h4.io website";
|
|
|
|
inputs = {
|
|
nixpkgs.url =
|
|
"github:NixOS/nixpkgs/21ad1050bf67f6a31acc38d41b7999e1a0bd0ca0"; # 31-07-2023
|
|
flake-utils.url =
|
|
"github:numtide/flake-utils/919d646de7be200f3bf08cb76ae1f09402b6f9b4"; # 11-07-2023
|
|
};
|
|
|
|
outputs = { nixpkgs, flake-utils, ... }:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = import nixpkgs { inherit system; };
|
|
|
|
src = ./.;
|
|
c8h4-io = pkgs.stdenv.mkDerivation {
|
|
name = "c8h4-io-hugo";
|
|
inherit src;
|
|
buildInputs = with pkgs; [ hugo ];
|
|
|
|
buildPhase = ''
|
|
hugo --minify
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
cp -vr public/* $out/
|
|
'';
|
|
};
|
|
in {
|
|
checks = rec {
|
|
inherit c8h4-io;
|
|
default = c8h4-io;
|
|
c8h4-io-prettier = pkgs.stdenv.mkDerivation {
|
|
name = "c8h4-io-prettier";
|
|
inherit src;
|
|
buildInputs = with pkgs; [ nodePackages.prettier ];
|
|
|
|
buildPhase = ''
|
|
prettier --check .
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
'';
|
|
};
|
|
};
|
|
|
|
packages = rec {
|
|
inherit c8h4-io;
|
|
default = c8h4-io;
|
|
};
|
|
|
|
apps.devserver = let
|
|
drv = pkgs.writeShellScript "c8h4-io-hugo-devserver" ''
|
|
${pkgs.hugo}/bin/hugo server
|
|
'';
|
|
in {
|
|
type = "app";
|
|
program = "${drv}";
|
|
};
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
nativeBuildInputs = with pkgs; [
|
|
deadnix
|
|
hugo
|
|
nixfmt
|
|
nodePackages.prettier
|
|
statix
|
|
];
|
|
};
|
|
});
|
|
}
|