about summary refs log tree commit diff
path: root/home/modules/development/kube.nix
blob: 58de4b70ed005692c6a46413241f5c48aae14481 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{ config, lib, pkgs, ... }:
let
  pkgs-unstable = import <nixpkgs-unstable> {};

  kubie = pkgs-unstable.kubie.overrideAttrs (drv: rec {
    name = "kubie-${version}";
    version = "0.8.4";
    src = pkgs.fetchFromGitHub {
      rev = "v${version}";
      owner = "sbstp";
      repo = "kubie";
      sha256 = "1f82xlhhxbjadjw609kr1kdm4n69c9mqjia4b3k505wjh7cc55n0";
    };

    cargoDeps = drv.cargoDeps.overrideAttrs (lib.const {
      name = "${name}-vendor.tar.gz";
      inherit src;
      outputHash = "0mish7wqwq5ynl98n6swdn5i6mg62aih5rfykbl3wx39b468n481";
    });
  });
in
{
  home.packages = with pkgs; [
    kubectl
    kubetail
    sops
    kubie
    pkgs-unstable.argocd
  ];

  programs.zsh.shellAliases = {
    "kc" = "kubectl";
    "kg" = "kc get";
    "kga" = "kc get --all-namespaces";
    "kpd" = "kubectl get pods";
    "kpa" = "kubectl get pods --all-namespaces";
    "klf" = "kubectl logs -f";
    "kdep" = "kubectl get deployments";
    "ked" =  "kubectl edit deployment";
    "kpw" = "kubectl get pods -w";
    "kew" = "kubectl get events -w";
    "kdel" = "kubectl delete";
    "knw" = "kubectl get nodes -w";
    "arsy" = "argocd app sync --prune";
  };

  home.file.".kube/kubie.yaml".text = ''
    shell: zsh
    prompt:
      zsh_use_rps1: true
  '';
}