mirror of
https://github.com/tweag/gomod2nix.git
synced 2024-11-09 12:09:08 +00:00
cf42f710c1
As creator of small tools, my flakes might often end up in other peoples projects. Overlays are a performance problem in those use cases because I would kept re-instantiating nixpkgs instances. Of course I could also expose my stuff as overlays as well. In that case I would need to merge downstream dependencies like go2modnix as well, which would polute their nixpkgs instance with unrelated stuff and also make it harder for my users to tell what random attributes came from which place.
21 lines
463 B
Nix
21 lines
463 B
Nix
{ 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")
|
|
];
|
|
}
|
|
)
|
|
, buildGoApplication ? pkgs.buildGoApplication
|
|
}:
|
|
|
|
buildGoApplication {
|
|
pname = "myapp";
|
|
version = "0.1";
|
|
pwd = ./.;
|
|
src = ./.;
|
|
modules = ./gomod2nix.toml;
|
|
}
|