about summary refs log tree commit diff
path: root/home/modules/development/urbint.nix
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2020-05-26T15·27-0400
committerGriffin Smith <root@gws.fyi>2020-05-26T15·28-0400
commit9b2dd5c20fec6ca76adb470374ccea0f7c944233 (patch)
treeef4c4ba0110e56a0027137e1b6790da99f535b89 /home/modules/development/urbint.nix
parent0e9a2388bf9e1a3258b19ebd00da0a804875ad10 (diff)
break out an urbint development module
Diffstat (limited to 'home/modules/development/urbint.nix')
-rw-r--r--home/modules/development/urbint.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/home/modules/development/urbint.nix b/home/modules/development/urbint.nix
new file mode 100644
index 000000000000..6958e3155b58
--- /dev/null
+++ b/home/modules/development/urbint.nix
@@ -0,0 +1,45 @@
+# urbint-only dev stuff
+{ config, lib, pkgs, ... }:
+
+let
+
+  yarn2nix = (import (pkgs.fetchFromGitHub {
+    owner = "moretea";
+    repo = "yarn2nix";
+    rev = "9e7279edde2a4e0f5ec04c53f5cd64440a27a1ae";
+    sha256 = "0zz2lrwn3y3rb8gzaiwxgz02dvy3s552zc70zvfqc0zh5dhydgn7";
+  }) { inherit pkgs; }).yarn2nix;
+
+in
+
+{
+  home.packages = with pkgs; [
+    yarn2nix
+    python36
+    python36Packages.ipython
+  ];
+
+  programs.zsh = {
+    shellAliases = {
+      ipy = "ipython";
+      amerge = "alembic merge heads";
+    };
+
+    initExtra = ''
+      # Alembic {{{
+      function aup() {
+        alembic upgrade ''${1:-head}
+      }
+
+      function adown() {
+        alembic downgrade ''${1:--1}
+      }
+    '';
+  };
+
+  home.file.".ipython/profile_default/ipython_config.py".text = ''
+    c.InteractiveShellApp.exec_lines = ['%autoreload 2']
+    c.InteractiveShellApp.extensions = ['autoreload']
+    c.TerminalInteractiveShell.editing_mode = 'vi'
+  '';
+}