website/flake.nix

45 lines
1.3 KiB
Nix
Raw Normal View History

2023-09-16 09:16:56 +00:00
{
inputs = {
nixpkgs.url = "nixpkgs";
flake-utils.url = "flake-utils";
};
2023-09-19 22:27:17 +00:00
outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system;};
python = pkgs.python3.withPackages (ps:
with ps; [
markdown
(pelican.overrideAttrs (_: _: {patches = [./pelican.patch];}))
2023-09-21 00:30:53 +00:00
(
buildPythonPackage rec {
pname = "pelican-sitemap";
version = "1.1.0";
src = pkgs.fetchFromGitHub {
owner = "pelican-plugins";
repo = "sitemap";
rev = version;
sha256 = "sha256-GEOLM4wc25VLRZ4qpOENTV6YGfYPHeu95gGdBauJswA=";
};
format = "pyproject";
propagatedBuildInputs = [poetry-core];
}
)
2023-09-19 22:27:17 +00:00
]);
website = pkgs.stdenv.mkDerivation {
name = "website";
src = ./.;
2023-09-21 00:30:53 +00:00
nativeBuildInputs = [pkgs.libfaketime python];
buildPhase = "faketime @${builtins.toString self.lastModified} make publish";
2023-09-19 22:27:17 +00:00
installPhase = "cp -r output $out";
};
in {
packages.default = website;
devShells.default = pkgs.mkShell {packages = [python];};
});
2023-09-16 09:16:56 +00:00
}