Created
March 6, 2022 05:24
-
-
Save influx6/177afb2a5cc1655551b0a3fa4cfd516b to your computer and use it in GitHub Desktop.
Create k0s binary builder in NIX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs-channels/archive/a7ecde854aee5c4c7cd6177f54a99d2c1ff28a31.tar.gz") {} | |
}: | |
with pkgs; | |
{ | |
k0s = stdenv.mkDerivation rec { | |
pname = "k0s"; | |
version = "v1.23.3+k0s.1-amd64"; | |
src = pkgs.fetchurl { | |
url = "https://github.com/k0sproject/k0s/releases/download/v1.23.3%2Bk0s.1/k0s-v1.23.3+k0s.1-amd64"; | |
sha256 = "0ki0drb1dsy3izxa6z34qfqms2g4nnmwqxrshz9ih7pqkv2ggl8c"; | |
}; | |
sourceRoot = "."; | |
dontConfigure = true; | |
dontBuild = true; | |
dontUnpack = true; | |
buildInputs = [ pkgs.which ]; | |
buildPhase = '' | |
''; | |
installPhase = '' | |
mkdir -p $out/bin; | |
cp $src $out/bin/k0s; | |
chmod +x $out/bin/k0s; | |
''; | |
meta = { | |
description= "k0s installation module for kubernetes clusters"; | |
homepage = "https://docs.k0sproject.io/v1.23.3+k0s.1/"; | |
maintainers = with pkgs.maintainers; [ k0sproject influx6 ]; | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment