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.nix75
1 files changed, 40 insertions, 35 deletions
diff --git a/flake.nix b/flake.nix
index dec5e4d..85f7915 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,54 +1,59 @@
 {
   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.utils.url = "github:numtide/flake-utils";
   inputs.flake-compat = {
     url = "github:edolstra/flake-compat";
     flake = false;
   };
+  inputs.gomod2nix = {
+    url = "github:tweag/gomod2nix";
+    inputs.nixpkgs.follows = "nixpkgs";
+    inputs.flake-utils.follows = "utils";
+  };
 
-  outputs = { self, nixpkgs, flockenzeit, flake-utils, ... }:
-    flake-utils.lib.eachDefaultSystem
+  outputs = { self, nixpkgs, utils, gomod2nix, ... }:
+    utils.lib.eachDefaultSystem
       (system:
         let
-          pkgs = nixpkgs.legacyPackages.${system};
-          nativeBuildInputs = with pkgs; [
-            nodePackages.prettier
-            fd
-            brotli
-            gzip
-            zstd
-            git
+          pkgs = import nixpkgs {
+            inherit system;
+            overlays = [ gomod2nix.overlays.default ];
+          };
+          packages = import ./nix/default.nix {
+            inherit pkgs self;
+          };
+          commonShellPackages = with pkgs; [
+            just
+            skopeo
+            flyctl
           ];
         in
-        rec {
-          packages = {
-            default = pkgs.stdenv.mkDerivation {
-              name = "alanpearce.eu";
-              src = self;
-
-              enableParallelBuilding = true;
-              makeFlags = [ "PREFIX=$(out)/public" ];
-
-              inherit nativeBuildInputs;
-
-              dontFixup = true;
-            };
-            docker = import ./docker.nix {
-              inherit self pkgs flockenzeit;
-              website = packages.default;
-            };
-          };
+        {
+          inherit packages;
           devShells = {
+            ci = pkgs.mkShell {
+              packages = commonShellPackages;
+            };
             default = pkgs.mkShell {
+              inputsFrom = [ packages.builder ];
               packages = with pkgs; [
-                bun
-                flyctl
-              ] ++ nativeBuildInputs ++ (with pkgs.nodePackages; [
-                prettier
-              ]);
+                gopls
+                gotools
+                go-tools
+                gomod2nix.packages.${system}.default
+                gci
+                netlify-cli
+                sentry-cli
+              ] ++ commonShellPackages;
             };
           };
+          checks = rec {
+            default = hyperlink;
+            hyperlink = pkgs.runCommandLocal "hyperlink" { } ''
+              ${pkgs.hyperlink}/bin/hyperlink ${packages.website}/website/public
+              touch $out
+            '';
+          };
         });
 }