kb-one-de/flake.nix
kB01 41a89ae883
Some checks failed
CI / build (push) Failing after 0s
Switched to Doks Theme (not building)
2025-04-24 18:32:17 +02:00

66 lines
1.6 KiB
Nix

{
description = "Personal website for Chris Portela";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
utils.url = "github:numtide/flake-utils";
hugo-coder = {
url = "github:luizdepra/hugo-coder";
flake = false;
};
hugo-theme-doks = {
url = "github:thuliteio/doks";
flake = false;
};
};
outputs = inputs@{ self, nixpkgs, utils, ... }: utils.lib.eachSystem [
utils.lib.system.x86_64-darwin
utils.lib.system.x86_64-linux
utils.lib.system.aarch64-darwin
utils.lib.system.aarch64-linux
] (system:
let
pkgs = import nixpkgs {
inherit system;
};
in
rec {
packages.website = pkgs.stdenv.mkDerivation {
name = "website";
src = self;
buildInputs = with pkgs; [
git
nodejs
nodePackages.prettier
hugo
];
buildPhase = ''
mkdir -p themes
ln -s ${inputs.hugo-theme-doks} themes/doks
sed -i -e 's/enableGitInfo = true/enableGitInfo = false/' config.toml
${pkgs.hugo}/bin/hugo
${pkgs.nodePackages.prettier}/bin/prettier -w public '!**/*.{js,css}'
'';
installPhase = "cp -r public $out";
};
defaultPackage = self.packages.${system}.website;
apps = rec {
hugo = utils.lib.mkApp { drv = pkgs.hugo; };
default = hugo;
};
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
git
nodejs
nodePackages.prettier
hugo
];
};
}
);
}