mirror of
https://github.com/tweag/gomod2nix.git
synced 2024-11-05 01:59: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.
23 lines
750 B
Nix
23 lines
750 B
Nix
{
|
|
description = "A basic gomod2nix flake";
|
|
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
|
inputs.gomod2nix.url = "github:nix-community/gomod2nix";
|
|
|
|
outputs = { self, nixpkgs, flake-utils, gomod2nix }:
|
|
(flake-utils.lib.eachDefaultSystem
|
|
(system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
in
|
|
{
|
|
packages.default = pkgs.callPackage ./. {
|
|
inherit (gomod2nix.legacyPackages.${system}) buildGoApplication;
|
|
};
|
|
devShells.default = pkgs.callPackage ./shell.nix {
|
|
inherit (gomod2nix.legacyPackages.${system}) buildGoApplication mkGoEnv gomod2nix;
|
|
};
|
|
})
|
|
);
|
|
}
|