Switch to Hugo-based build
This commit is contained in:
parent
21feddaf52
commit
10b809eebd
18 changed files with 257 additions and 0 deletions
50
flake.nix
Normal file
50
flake.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
futils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
futils,
|
||||
} @ inputs: let
|
||||
inherit (nixpkgs) lib;
|
||||
inherit (futils.lib) eachDefaultSystem defaultSystems;
|
||||
in (eachDefaultSystem (
|
||||
system: let
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
in {
|
||||
packages = {
|
||||
default = self.packages.${system}.website;
|
||||
website = pkgs.stdenvNoCC.mkDerivation {
|
||||
name = "antoinemartin.fr-website";
|
||||
|
||||
src = self;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
hugo
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
hugo --minify
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
cp -r public $out
|
||||
'';
|
||||
|
||||
meta = with pkgs.lib; {
|
||||
platforms = platforms.all;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
devShell = pkgs.mkShellNoCC {
|
||||
buildInputs = with pkgs; [
|
||||
hugo
|
||||
];
|
||||
};
|
||||
}
|
||||
));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue