about summary refs log tree commit diff stats
path: root/default.nix
diff options
context:
space:
mode:
authorAlan Pearce2024-06-18 12:20:06 +0200
committerAlan Pearce2024-06-18 12:22:12 +0200
commitcf0da6d13edc55c003564f31d56a659cfa681e0c (patch)
treefc39a25b1a69b7922106b538c80fc2ecd9bb08ae /default.nix
parentf690e8cb7a820b0685b98f83a6761cfc169487e4 (diff)
downloadwebsite-cf0da6d13edc55c003564f31d56a659cfa681e0c.tar.lz
website-cf0da6d13edc55c003564f31d56a659cfa681e0c.tar.zst
website-cf0da6d13edc55c003564f31d56a659cfa681e0c.zip
remove flake and docker setup
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix43
1 files changed, 33 insertions, 10 deletions
diff --git a/default.nix b/default.nix
index 2cccff2..fd92a90 100644
--- a/default.nix
+++ b/default.nix
@@ -1,10 +1,33 @@
-(import
-  (
-    let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
-    fetchTarball {
-      url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
-      sha256 = lock.nodes.flake-compat.locked.narHash;
-    }
-  )
-  { src = ./.; }
-).defaultNix
+let
+  sources = import ./npins;
+
+  pkgs = import sources.nixpkgs {
+    overlays = [
+      (import "${sources.gomod2nix}/overlay.nix")
+    ];
+  };
+  pre-commit-hooks = import sources.pre-commit-hooks;
+in
+{
+  pre-commit-check = pre-commit-hooks.run {
+    src = ./.;
+    hooks = {
+      go-mod-tidy = {
+        enable = true;
+        name = "go-mod-tidy";
+        description = "Run `go mod tidy`";
+        types_or = [ "go" "go-mod" ];
+        entry = "${pkgs.go}/bin/go mod tidy";
+        pass_filenames = false;
+      };
+      gomod2nix = {
+        enable = true;
+        name = "gomod2nix";
+        description = "Import go.mod updates to nix";
+        types_or = [ "go-sum" ];
+        entry = "${pkgs.gomod2nix}/bin/gomod2nix --outdir nix";
+        pass_filenames = false;
+      };
+    };
+  };
+}