1
0
forked from crony/UpFast
UpFast/shell.nix

33 lines
655 B
Nix
Raw Normal View History

2024-03-03 11:02:29 +01:00
{ pkgs ? (
let
inherit (builtins) fetchTree fromJSON readFile;
inherit ((fromJSON (readFile ./flake.lock)).nodes) nixpkgs gomod2nix;
in
import (fetchTree nixpkgs.locked) {
overlays = [
(import "${fetchTree gomod2nix.locked}/overlay.nix")
];
}
)
, mkGoEnv ? pkgs.mkGoEnv
, gomod2nix ? pkgs.gomod2nix
2024-03-17 15:06:04 +01:00
, pre-commit-hooks
2024-03-03 11:02:29 +01:00
}:
let
goEnv = mkGoEnv { pwd = ./.; };
2024-03-17 15:06:04 +01:00
pre-commit-check = pre-commit-hooks.lib.${pkgs.system}.run {
src = ./.;
hooks = {
gofmt.enable = true;
};
};
2024-03-03 11:02:29 +01:00
in
pkgs.mkShell {
2024-03-17 15:06:04 +01:00
inherit (pre-commit-check) shellHook;
2024-03-03 11:02:29 +01:00
packages = [
goEnv
gomod2nix
];
}