pages/flake.nix

36 lines
990 B
Nix
Raw Normal View History

2024-12-14 19:15:14 -05:00
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11-small";
2024-12-14 19:15:14 -05:00
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
2024-12-15 15:13:13 -05:00
let
pkgs = import nixpkgs { inherit system; };
buildInputs = with pkgs; [ hugo nodejs ];
2024-12-14 19:15:14 -05:00
in with pkgs; {
2024-12-15 15:13:13 -05:00
devShells.default = mkShell { inherit buildInputs; };
packages.default = stdenvNoCC.mkDerivation {
name = "millironx-pages";
src = self;
inherit buildInputs;
phases = [ "unpackPhase" "buildPhase" "installPhase" ];
buildPhase = ''
runHook preBuild
HUGO_ENV=production HUGO_ENVIRONMENT=production hugo --minify
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r public/* $out/
runHook postInstall
'';
};
2024-12-14 19:15:14 -05:00
});
}