From 605dca1626129dc9c5dc84037e039cfc3ab0e35c Mon Sep 17 00:00:00 2001 From: John Boehr Date: Sat, 4 Feb 2023 10:03:59 -0800 Subject: [PATCH] Don't use overlay internally with nixpkgs See: https://github.com/nix-community/poetry2nix/commit/05b788f7b9beaa9014c9d794acf004e23ad571af See: https://zimbatm.com/notes/1000-instances-of-nixpkgs --- flake.nix | 17 +++++++---------- shell.nix | 8 +++++--- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/flake.nix b/flake.nix index 85ee185..29732ec 100644 --- a/flake.nix +++ b/flake.nix @@ -15,22 +15,19 @@ description = "Gomod2nix packaged application"; }; }; - defaultTemplate = self.templates.app; + templates.default = self.templates.app; } // (utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs { - inherit system; - overlays = [ - self.overlays.default - ]; - }; + pkgs = nixpkgs.legacyPackages.${system}; + callPackage = pkgs.darwin.apple_sdk_11_0.callPackage or pkgs.callPackage; in - { - packages.default = pkgs.callPackage ./. { }; - devShells.default = import ./shell.nix { inherit pkgs; }; + rec { + packages.default = pkgs.callPackage ./. { inherit (lib) buildGoApplication mkGoEnv; }; + devShells.default = import ./shell.nix { inherit pkgs; gomod2nix = packages.default; inherit (lib) mkGoEnv; }; + lib = { inherit (callPackage ./builder { gomod2nix = packages.default; }) buildGoApplication mkGoEnv; }; }) ); } diff --git a/shell.nix b/shell.nix index f80d988..e278a7b 100644 --- a/shell.nix +++ b/shell.nix @@ -7,7 +7,9 @@ (import ./overlay.nix) ]; } - ) + ), + gomod2nix ? pkgs.gomod2nix, + mkGoEnv ? pkgs.mkGoEnv }: pkgs.mkShell { @@ -15,7 +17,7 @@ pkgs.mkShell { nativeBuildInputs = [ pkgs.nixpkgs-fmt pkgs.golangci-lint - pkgs.gomod2nix - (pkgs.mkGoEnv { pwd = ./.; }) + gomod2nix + (mkGoEnv { pwd = ./.; }) ]; }