Now Use flake part and integrate a build system using nix package building and treefmt-nix as a flake-part module
34 lines
747 B
Nix
34 lines
747 B
Nix
{ inputs, ... }:
|
|
let
|
|
inherit (inputs.flake-parts.lib) mkPerSystemOption;
|
|
in
|
|
{
|
|
options.perSystem = mkPerSystemOption (
|
|
{
|
|
pkgs,
|
|
config,
|
|
...
|
|
}:
|
|
{
|
|
packages.default = pkgs.stdenvNoCC.mkDerivation {
|
|
name = "xiemeart";
|
|
src = ../.;
|
|
nativeBuildInputs = config.buildPackages;
|
|
configurePhase = ''
|
|
ln -snf ${config.pelicantheme} theme
|
|
ln -snf ${config.pelicanplugins} plugins
|
|
'';
|
|
buildPhase = ''
|
|
ls -la
|
|
mkdir -p output
|
|
pelican --verbose -o output/ 2>& 1>build.log
|
|
'';
|
|
installPhase = ''
|
|
mkdir -p $out/
|
|
cp build.log $out/
|
|
cp -r output/* $out/
|
|
'';
|
|
};
|
|
}
|
|
);
|
|
}
|