aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2024-12-25 13:01:30 -0800
committerFranck Cuny <franck@fcuny.net>2024-12-25 13:01:30 -0800
commitd324442d4750388c13d76ec9f1ca20664e3052ed (patch)
treeab5a8eafa0fd198651d3251284031b45976bc0bb /flake.nix
parentfix some text (diff)
downloadfcuny.net-d324442d4750388c13d76ec9f1ca20664e3052ed.tar.gz
actually build the site with nix build
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix50
1 files changed, 47 insertions, 3 deletions
diff --git a/flake.nix b/flake.nix
index 07770fb..d49334c 100644
--- a/flake.nix
+++ b/flake.nix
@@ -7,12 +7,55 @@
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
};
- outputs = { self, nixpkgs, flake-utils, pre-commit-hooks, }:
- flake-utils.lib.eachDefaultSystem (system:
+ outputs =
+ { self
+ , nixpkgs
+ , flake-utils
+ , pre-commit-hooks
+ ,
+ }:
+ flake-utils.lib.eachDefaultSystem (
+ system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
+ apps = {
+ default = {
+ type = "app";
+ program = "${self.packages."${system}".zola}/bin/zola";
+ };
+ };
+
+ packages = {
+ default =
+ with pkgs;
+ stdenv.mkDerivation {
+ pname = "fcuny.net";
+ version = self.lastModifiedDate;
+ src = ./.;
+ buildInputs = [
+ zola
+ git
+ ];
+ buildPhase = ''
+ mkdir -p $out
+ ${pkgs.zola}/bin/zola build -o $out -f
+ '';
+ dontInstall = true;
+ };
+ zola = pkgs.writeShellScriptBin "zola" ''
+ set -euo pipefail
+ export PATH=${
+ pkgs.lib.makeBinPath [
+ pkgs.zola
+ pkgs.git
+ ]
+ }
+ zola serve
+ '';
+ };
+
checks = {
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
@@ -42,5 +85,6 @@
exiftool
];
};
- });
+ }
+ );
}