diff options
author | Griffin Smith <root@gws.fyi> | 2020-04-28T18·36-0400 |
---|---|---|
committer | Griffin Smith <root@gws.fyi> | 2020-04-28T18·36-0400 |
commit | 446c8bfddd0bca947433b848a43b953c08dc8506 (patch) | |
tree | fab6ea37ffc33a79ca6f42dca86b1aee74827ad0 /home/modules | |
parent | 100b962b7211a6544c8214b3690f45fe457818f3 (diff) |
Bump kubie, extract kube config
Diffstat (limited to 'home/modules')
-rw-r--r-- | home/modules/development.nix | 75 | ||||
-rw-r--r-- | home/modules/development/kube.nix | 52 |
2 files changed, 127 insertions, 0 deletions
diff --git a/home/modules/development.nix b/home/modules/development.nix new file mode 100644 index 000000000000..fecb48f1644b --- /dev/null +++ b/home/modules/development.nix @@ -0,0 +1,75 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./development/kube.nix + ]; + + home.packages = with pkgs; [ + jq + gitAndTools.hub + gitAndTools.tig + shellcheck + httpie + entr + gnumake + inetutils + (import (pkgs.fetchFromGitHub { + owner = "moretea"; + repo = "yarn2nix"; + rev = "9e7279edde2a4e0f5ec04c53f5cd64440a27a1ae"; + sha256 = "0zz2lrwn3y3rb8gzaiwxgz02dvy3s552zc70zvfqc0zh5dhydgn7"; + }) { inherit pkgs; }).yarn2nix + julia + ]; + + programs.git = { + enable = true; + # bah, this doesn't work + # package = pkgs.git.override { + # sendEmailSupport = true; + # }; + userEmail = "root@gws.fyi"; + userName = "Griffin Smith"; + ignores = [ + "*.sw*" + ".classpath" + ".project" + ".settings/" + ".dir-locals.el" + ".stack-work-profiling" + ".projectile" + ]; + extraConfig = { + github.user = "glittershark"; + merge.conflictstyle = "diff3"; + }; + }; + + home.file.".psqlrc".text = '' + \set QUIET 1 + \timing + \set ON_ERROR_ROLLBACK interactive + \set VERBOSITY verbose + \x auto + \set PROMPT1 '%[%033[1m%]%M/%/%R%[%033[0m%]%# ' + \set PROMPT2 '...%# ' + \set HISTFILE ~/.psql_history- :DBNAME + \set HISTCONTROL ignoredups + \pset null [null] + \unset QUIET + ''; + + home.file.".ipython/profile_default/ipython_config.py".text = '' + c.InteractiveShellApp.exec_lines = ['%autoreload 2'] + c.InteractiveShellApp.extensions = ['autoreload'] + c.TerminalInteractiveShell.editing_mode = 'vi' + ''; + + programs.readline = { + enable = true; + extraConfig = '' + set editing-mode vi + ''; + }; +} diff --git a/home/modules/development/kube.nix b/home/modules/development/kube.nix new file mode 100644 index 000000000000..58de4b70ed00 --- /dev/null +++ b/home/modules/development/kube.nix @@ -0,0 +1,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 + ''; +} |