all repos — homestead @ 6b75612bab693c8044071526a4bf0aba7eb6e15e

Code for my website

remove flake and docker setup

Alan Pearce
commit

6b75612bab693c8044071526a4bf0aba7eb6e15e

parent

9458f3d1b77a89c90d1759ae601c5e155c6ff752

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; + }; + }; + }; +}