website/flake.nix

33 lines
853 B
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;};
2023-12-04 20:41:47 +00:00
papermod = pkgs.fetchFromGitHub {
owner = "adityatelange";
repo = "hugo-PaperMod";
rev = "v7.0";
hash = "sha256-33EnCEvTxZYn31fxZkYJlQXvJsczXMVufSj6QJJHrLk=";
};
2023-09-19 22:27:17 +00:00
website = pkgs.stdenv.mkDerivation {
name = "website";
src = ./.;
2023-12-04 20:41:47 +00:00
postPatch = "mkdir themes && cp -r ${papermod} themes/papermod";
nativeBuildInputs = [pkgs.hugo];
buildPhase = "hugo";
installPhase = "cp -r public $out";
2023-09-19 22:27:17 +00:00
};
in {
packages.default = website;
2023-12-04 20:41:47 +00:00
devShells.default = pkgs.mkShell {packages = [pkgs.hugo];};
2023-09-19 22:27:17 +00:00
});
2023-09-16 09:16:56 +00:00
}