@ -2,6 +2,7 @@
, buildGoModule
, fetchFromGitHub
, git
, installShellFiles
} :
buildGoModule rec {
@ -14,18 +15,37 @@ buildGoModule rec {
rev = " v ${ version } " ;
sha256 = " s h a 2 5 6 - L o O X Z Y 4 u F 7 G S S 3 D h / o z C s L J T x g m P m Z Z u E i s J 4 S h j C B c = " ;
} ;
vendorSha256 = null ;
excludedPackages = " t e s t " ;
# Don't build the legacy main.go or test dir
excludedPackages = " \\ ( c m d / k o \\ | t e s t \\ ) " ;
nativeBuildInputs = [ installShellFiles ] ;
ldflags = [ " - s " " - w " " - X g i t h u b . c o m / g o o g l e / k o / p k g / c o m m a n d s . V e r s i o n = ${ version } " ] ;
checkInputs = [ git ] ;
preCheck = ''
# resolves some complaints from ko
export GOROOT = " $ ( g o e n v G O R O O T ) "
git init
'' ;
postInstall = ''
installShellCompletion - - cmd ko \
- - bash < ( $ out/bin/ko completion ) \
- - zsh < ( $ out/bin/ko completion - - zsh )
'' ;
meta = with lib ; {
description = " A s i m p l e , f a s t c o n t a i n e r i m a g e b u i l d e r f o r G o a p p l i c a t i o n s . " ;
homepage = " h t t p s : / / g i t h u b . c o m / g o o g l e / k o " ;
changelog = " h t t p s : / / g i t h u b . c o m / g o o g l e / k o / r e l e a s e s / t a g / v ${ version } " ;
description = " B u i l d a n d d e p l o y G o a p p l i c a t i o n s o n K u b e r n e t e s " ;
longDescription = ''
ko is a simple , fast container image builder for Go applications .
It's ideal for use cases where your image contains a single Go application without any/many dependencies on the OS base image ( e . g . no cgo , no OS package dependencies ) .
ko builds images by effectively executing go build on your local machine , and as such doesn't require docker to be installed . This can make it a good fit for lightweight CI/CD use cases .
ko also includes support for simple YAML templating which makes it a powerful tool for Kubernetes applications .
'' ;
license = licenses . asl20 ;
maintainers = with maintainers ; [ nickcao ] ;
maintainers = with maintainers ; [ nickcao jk ] ;
} ;
}