about summary refs log tree commit diff stats
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix61
1 files changed, 48 insertions, 13 deletions
diff --git a/flake.nix b/flake.nix
index c257b2a..d788db4 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,20 +1,55 @@
 {
-  description = "A bear blog theme for Zola";
+  description = "My website, alanpearce.eu";
   inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
+  inputs.flockenzeit.url = "github:balsoft/Flockenzeit";
   inputs.flake-utils.url = "github:numtide/flake-utils";
+  inputs.flake-compat = {
+    url = "github:edolstra/flake-compat";
+    flake = false;
+  };
 
-  outputs = { self, nixpkgs, flake-utils }:
-    flake-utils.lib.eachDefaultSystem (system:
-      let
-        pkgs = nixpkgs.legacyPackages.${system};
-      in
-      {
-        devShells.default = pkgs.mkShell {
-          packages = with pkgs; [
-            git
-            gnugrep
+  outputs = { self, nixpkgs, flockenzeit, flake-utils, ... }:
+    flake-utils.lib.eachDefaultSystem
+      (system:
+        let
+          pkgs = nixpkgs.legacyPackages.${system};
+          nativeBuildInputs = with pkgs; [
             zola
+            nodePackages_latest.prettier
+            fd
+            brotli
+            gzip
+            zstd
+            git
           ];
-        };
-      });
+        in
+        rec {
+          packages = {
+            default = pkgs.stdenv.mkDerivation {
+              name = "alanpearce.eu";
+              src = self;
+
+              enableParallelBuilding = true;
+              makeFlags = [ "PREFIX=$(out)/public" ];
+
+              inherit nativeBuildInputs;
+
+              dontFixup = true;
+
+              postInstall = ''
+                cp Caddyfile $out/
+              '';
+            };
+            docker = import ./docker.nix {
+              inherit self pkgs flockenzeit;
+              website = packages.default;
+            };
+          };
+          devShell = pkgs.mkShell {
+            buildInputs = with pkgs; [
+              caddy
+              flyctl
+            ] ++ nativeBuildInputs;
+          };
+        });
 }