aboutsummaryrefslogblamecommitdiff
path: root/home/profiles/k8s.nix
blob: 1e6cd416d986ee5d4dcb894a726cff8993c3b653 (plain) (tree)
1
2
3
4
5
6
7
8
9
              
 



                                     
                                                             
                                         
                                

    




















                                
                   

                    
                         

                             
                    
                                                                                                                                                                    


      
{ pkgs, ... }:
{
  home.packages = with pkgs; [
    kind # k8s in docker
    kubebuilder # generate controller
    kubectl
    kubie # kubeconfig browser https://github.com/sbstp/kubie
    kubernetes-helm # deploy applications
    kubelogin-oidc # OIDC plugin
  ];

  programs.k9s = {
    enable = true;
    settings = {
      k9s = {
        refreshRate = 1;
      };
    };
  };

  home.file.kubie = {
    target = ".kube/kubie.yaml";
    text = ''
      shell: fish
      configs:
        include:
          - ~/.kube/rksconfig
      prompt:
        fish_use_rprompt: false
    '';
  };

  programs.fish = {
    shellAbbrs = {
      k = "kubectl";
      kctx = "kubie ctx";
      klogs = "kubectl logs";
    };
    shellAliases = {
      ukctx = "${pkgs.gh}/bin/gh api --hostname github.rbx.com repos/Roblox/cell-lifecycle/contents/rks/kubeconfig --jq '.content' | base64 -d > ~/.kube/rksconfig";
    };
  };
}