all repos — website @ cf0da6d13edc55c003564f31d56a659cfa681e0c

My website

remove flake and docker setup

Alan Pearce
commit

cf0da6d13edc55c003564f31d56a659cfa681e0c

parent

f690e8cb7a820b0685b98f83a6761cfc169487e4

1 file changed, 33 insertions(+), 10 deletions(-)

changed files
M default.nixdefault.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; + }; + }; + }; +}