Skip to content

Instantly share code, notes, and snippets.

@influx6
Created March 7, 2022 15:15
Show Gist options
  • Save influx6/70b7d343e2a473f8e3c80967bca3b145 to your computer and use it in GitHub Desktop.
Save influx6/70b7d343e2a473f8e3c80967bca3b145 to your computer and use it in GitHub Desktop.
k0s source build attempt
{
pkgs ? import <nixpkgs> {}
}:
pkgs.stdenv.mkDerivation rec {
pname = "k0s-src";
version = "v1.23.3";
# src = builtins.fetchTarball {
# url = "https://github.com/k0sproject/k0s/archive/1a5afc71a0d4f6975e15b842aa1a934bc0986d7a.tar.gz";
# sha256 = "0p5h8rxwn1hjfz31znzp5rzyv2aj634zg351ncja2c339yxf2pjz";
# };
src = [];
sourceRoot = ".";
dontConfigure = true;
dontUnpack = true;
buildInputs = [
pkgs.go
pkgs.git
pkgs.cacert
];
buildPhase = ''
export GOPATH=$out/modules;
mkdir -p $out/bin;
mkdir -p $GOPATH;
go install github.com/k0sproject/k0s@v1.23.3+k0s.1;
mv $GOPATH/bin/k0s $out/bin/k0s;
unset GOPATH;
'';
installPhase = ''
chmod +x $out/bin/k0s;
patchShebangs $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 ];
platforms = pkgs.lib.platforms.unix;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment