remove flake and docker setup
1 file changed, 33 insertions(+), 10 deletions(-)
changed files
M default.nix → 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; + }; + }; + }; +}