about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2020-05-04T17·18-0400
committerGriffin Smith <root@gws.fyi>2020-05-04T17·19-0400
commit5222b8d15a51d6118b090040a1bfd4d48ffff8c2 (patch)
tree5bfed8bb92b5456fc5600acc88bc60a17d298c55
parentb2d21123139cb37f8c5e31976e72e7beba14ca93 (diff)
urbint module
-rw-r--r--home/modules/urbint/backend.nix22
-rw-r--r--home/modules/urbint/common.nix79
-rw-r--r--home/modules/urbint/default.nix8
-rw-r--r--home/modules/urbint/frontend.nix14
4 files changed, 123 insertions, 0 deletions
diff --git a/home/modules/urbint/backend.nix b/home/modules/urbint/backend.nix
new file mode 100644
index 000000000000..ed8a3a3e7a76
--- /dev/null
+++ b/home/modules/urbint/backend.nix
@@ -0,0 +1,22 @@
+{ config, lib, pkgs, ... }:
+
+{
+  imports = [
+    ./common.nix
+  ];
+
+  home.packages = with pkgs; [
+    cloud-sql-proxy
+    postgresql
+    jupyter
+    python3Packages.jupyter_core
+    redis
+    ngrok-2
+  ];
+
+  home.file.".ipython/profile_default/ipython_config.py".text = ''
+    c.InteractiveShellApp.exec_lines = ['%autoreload 2']
+    c.InteractiveShellApp.extensions = ['autoreload']
+    c.TerminalInteractiveShell.editing_mode = 'vi'
+  '';
+}
diff --git a/home/modules/urbint/common.nix b/home/modules/urbint/common.nix
new file mode 100644
index 000000000000..52db4c66629b
--- /dev/null
+++ b/home/modules/urbint/common.nix
@@ -0,0 +1,79 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+  aliases = {
+    cluster = "gcloud container clusters get-credentials";
+    vpon = "sudo systemctl start openvpn-urbint.service";
+  };
+in
+{
+  imports = [ ../lib/cloneRepo.nix ];
+
+  options = {
+    urbint.projectPath = mkOption {
+      description = ''
+      Root path to clone Urbint repos in, relative to your home directory
+      '';
+      type = types.str;
+      default = "code";
+    };
+  };
+
+  config = {
+    services.lorri.enable = true;
+
+    programs.direnv = {
+      enable = true;
+      enableBashIntegration = true;
+      enableZshIntegration = true;
+    };
+
+    home.packages = with pkgs; [
+      docker
+      docker-compose
+      skopeo
+
+      kubectl
+      kubetail
+      google-cloud-sdk
+      openvpn
+      sops
+      (import <nixpkgs-unstable> {}).argocd
+      drone-cli
+
+      git
+
+      zoom-us
+      slack
+      _1password
+    ];
+
+    nixpkgs.config.allowUnfree = true;
+
+    impure.clonedRepos = {
+      grid = {
+        github = "urbint/grid";
+        path = "${config.urbint.projectPath}/grid";
+      };
+
+      docker-images = {
+        github = "urbint/docker-images";
+        path = "${config.urbint.projectPath}/docker-images";
+      };
+
+      gitops = {
+        github = "urbint/gitops";
+        path = "${config.urbint.projectPath}/gitops";
+      };
+    };
+
+    programs.zsh.shellAliases = aliases;
+    programs.bash.shellAliases = aliases;
+
+    programs.zsh.envExtra = ''
+      export DRONE_SERVER=https://ci.urbinternal.com
+    '';
+  };
+}
diff --git a/home/modules/urbint/default.nix b/home/modules/urbint/default.nix
new file mode 100644
index 000000000000..fac57acff701
--- /dev/null
+++ b/home/modules/urbint/default.nix
@@ -0,0 +1,8 @@
+{ config, lib, pkgs, ... }:
+
+{
+  imports = [
+    ./frontend.nix
+    ./backend.nix
+  ];
+}
diff --git a/home/modules/urbint/frontend.nix b/home/modules/urbint/frontend.nix
new file mode 100644
index 000000000000..543e9eebc057
--- /dev/null
+++ b/home/modules/urbint/frontend.nix
@@ -0,0 +1,14 @@
+{ config, lib, pkgs, ... }:
+
+{
+  imports = [
+    ./common.nix
+  ];
+
+  home.packages = with pkgs; [
+    yarn
+    nodejs
+    clojure
+    nodePackages.prettier
+  ];
+}