mat.services/flake.nix

44 lines
1.4 KiB
Nix

{
description = "personal site";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs.follows = "nixpkgs";
gitignore.url = "github:hercules-ci/gitignore.nix";
gitignore.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, flake-parts, gitignore, ... }@inputs:
flake-parts.lib.mkFlake { inherit self; } {
imports = [ ];
systems = inputs.nixpkgs.lib.systems.flakeExposed;
perSystem = { config, self', inputs', pkgs, system, ... }:
let
inherit (gitignore.lib) gitignoreSource;
inherit (pkgs.callPackage ./nix { }) fonts optimize-images;
inherit (fonts) copyFonts linkFonts;
in
{
packages.default = with pkgs; stdenv.mkDerivation {
pname = "personal-site";
version = "2022-10-10";
src = gitignoreSource ./.;
nativeBuildInputs = [ optimize-images zola ];
configurePhase = copyFonts;
buildPhase = ''
optimize-images
zola build --drafts
'';
installPhase = ''
cp -r public $out
'';
};
devShells.default = with pkgs; mkShell {
packages = [ optimize-images zola ];
shellHook = linkFonts;
};
};
};
}