diff options
| author | andre4ik3 <andre4ik3@fastmail.com> | 2025-08-18 17:42:27 +0000 |
|---|---|---|
| committer | andre4ik3 <andre4ik3@fastmail.com> | 2025-08-18 17:42:27 +0000 |
| commit | d9ff6edbfcdc408e23684c00df806eac72fd02b2 (patch) | |
| tree | 45a8fe89aa4de37a2dab4b293330874e37907beb /flake.nix | |
Initial commit
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..86a452f --- /dev/null +++ b/flake.nix @@ -0,0 +1,46 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/release-25.05"; + utils.url = "github:numtide/flake-utils"; + }; + + outputs = { utils, ... }@inputs: utils.lib.eachDefaultSystem (system: let + pkgs = inputs.nixpkgs.legacyPackages.${system}; + + fonts = pkgs.stdenv.mkDerivation { + name = "caladea-woff2"; + src = pkgs.caladea; + nativeBuildInputs = [ pkgs.woff2 ]; + buildPhase = '' + pushd "share/fonts/truetype" + + for file in *.ttf; do + woff2_compress "$file" + done + + mkdir -p "$out" + mv *.woff2 "$out" + ''; + }; + + site = pkgs.stdenv.mkDerivation { + name = "site"; + src = ./.; + nativeBuildInputs = [ pkgs.hugo ]; + buildPhase = '' + runHook preBuild + ln -sf "${fonts}" "static/fonts" + hugo --destination "$out" + runHook postBuild + ''; + }; + + in { + inherit (inputs) self; + devShells.default = pkgs.mkShell { + packages = [ pkgs.hugo ]; + }; + + packages.default = site; + }); +} |
