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..f6229c6 100644 --- a/shell.nix +++ b/shell.nix @@ -8,6 +8,8 @@ ]; } ) +, 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 = ./.; }) ]; }