From f1e40f560572a290aa6bcf4e7b9bbbaf5f233931 Mon Sep 17 00:00:00 2001 From: Christian Segundo Date: Sun, 25 Feb 2024 00:34:29 +0100 Subject: Add kontext --- flake.nix | 10 ++++++++++ pkgs/default.nix | 4 ++++ pkgs/kontext.nix | 28 ++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 flake.nix create mode 100644 pkgs/default.nix create mode 100644 pkgs/kontext.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..7abd93d --- /dev/null +++ b/flake.nix @@ -0,0 +1,10 @@ +{ + outputs = { self, nixpkgs }@inputs: + let + forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed; + in + { + packages = forAllSystems (system: import ./pkgs (inputs // { inherit system; })); + overlays.default = final: prev: (import ./pkgs { pkgs = final; }); + }; +} diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 0000000..bd8a98b --- /dev/null +++ b/pkgs/default.nix @@ -0,0 +1,4 @@ +{ pkgs, ... }: rec { + kontext = pkgs.callPackage ./kontext.nix { }; +} + diff --git a/pkgs/kontext.nix b/pkgs/kontext.nix new file mode 100644 index 0000000..48faeea --- /dev/null +++ b/pkgs/kontext.nix @@ -0,0 +1,28 @@ +{ stdenv, lib, fetchgit, makeWrapper, autoconf, automake, util-linux, kubectl }: +stdenv.mkDerivation rec { + name = "kontext"; + version = "1.0.0"; + + src = fetchgit { + url = "https://git.segundo.io/k8s/kontext"; + rev = "46d44777169aa8e18e7b5c3a69b9e679db8a4617"; + hash = "sha256-V63cboLzeX9kHtQKF5DPtBkkaBKbxTDNLPcfKB37YeQ="; + }; + + nativeBuildInputs = [ makeWrapper autoconf automake util-linux ]; + buildInputs = [ kubectl ]; + + configurePhase = '' + aclocal + autoconf + automake --add-missing + ./configure --prefix=$out + ''; + + meta = with lib; { + description = "Per shell Kubernetes contexts"; + license = licenses.gpl2Plus; + mainProgram = "kontext"; + platforms = platforms.unix; + }; +} -- cgit v1.2.3