| @@ -104,7 +104,7 @@ nukehost() | |||||
| # Cheap copy function to make copying a file via ssh from one host | # Cheap copy function to make copying a file via ssh from one host | ||||
| # to another less painful, use pipeviewer to give some idea as to progress. | # to another less painful, use pipeviewer to give some idea as to progress. | ||||
| ssh-copyfile() | |||||
| sshcopy() | |||||
| { | { | ||||
| if [ -z "$1" -o -z "$2" ]; then | if [ -z "$1" -o -z "$2" ]; then | ||||
| echo "Usage: copy source:/file/location destination:/file/location" | echo "Usage: copy source:/file/location destination:/file/location" | ||||
| @@ -114,9 +114,13 @@ ssh-copyfile() | |||||
| dsthost="$(echo "$2" | awk -F: '{print $1}')" | dsthost="$(echo "$2" | awk -F: '{print $1}')" | ||||
| dst="$(echo "$2" | awk -F: '{print $2}')" | dst="$(echo "$2" | awk -F: '{print $2}')" | ||||
| size=$(ssh "$srchost" du -hs "$src" 2> /dev/null) | size=$(ssh "$srchost" du -hs "$src" 2> /dev/null) | ||||
| if [ "${size}" = "" ]; then | |||||
| echo "${src} doesn't seem to exist on ${srchost}" | |||||
| return 1 | |||||
| fi | |||||
| size=$(echo "${size}" | awk '{print $1}') | size=$(echo "${size}" | awk '{print $1}') | ||||
| echo "Copying $size to $dst" | echo "Copying $size to $dst" | ||||
| ssh "$srchost" "/bin/cat \$src" 2> /dev/null | pv -cb -N copied - | ssh "$dsthost" "/bin/cat - > \$dst" 2> /dev/null | |||||
| (ssh "$srchost" "/bin/cat $src" | pv -cb -N copied - | ssh "$dsthost" "/bin/cat - > $dst") 2> /dev/null | |||||
| fi | fi | ||||
| } | } | ||||
| @@ -274,16 +278,30 @@ nix_env_setup() | |||||
| } | } | ||||
| } | } | ||||
| nix_env_setup | |||||
| nix-on() { | |||||
| rm ~/.nonix | |||||
| } | |||||
| nix-off() { | |||||
| touch ~/.nonix | |||||
| } | |||||
| #+END_SRC | #+END_SRC | ||||
| Workaround stupid ssl crap with recent nix. | Workaround stupid ssl crap with recent nix. | ||||
| #+BEGIN_SRC sh :tangle (when (and (eq nix-p t) (eq osx-p t)) "tmp/.profile") | #+BEGIN_SRC sh :tangle (when (and (eq nix-p t) (eq osx-p t)) "tmp/.profile") | ||||
| SSL_CERT_FILE="${HOME}/.nix-profile/etc/ssl/certs/ca-bundle.crt" | |||||
| GIT_SSL_CAINFO=$SSL_CERT_FILE | |||||
| export SSL_CERT_FILE | |||||
| export GIT_SSL_CAINFO | |||||
| if [ ! -e ${HOME}/.nonix ]; then | |||||
| SSL_CERT_FILE="${HOME}/.nix-profile/etc/ssl/certs/ca-bundle.crt" | |||||
| GIT_SSL_CAINFO=$SSL_CERT_FILE | |||||
| export SSL_CERT_FILE | |||||
| export GIT_SSL_CAINFO | |||||
| fi | |||||
| #+END_SRC | |||||
| #+BEGIN_SRC sh :tangle (when (eq nix-p t) "tmp/.profile") | |||||
| if [ ! -e ${HOME}/.nonix ]; then | |||||
| nix_env_setup | |||||
| fi | |||||
| #+END_SRC | #+END_SRC | ||||
| TODO Add linux ca-bundle detection | TODO Add linux ca-bundle detection | ||||
| @@ -441,7 +441,7 @@ All the packages I use. | |||||
| #+BEGIN_SRC emacs-lisp | #+BEGIN_SRC emacs-lisp | ||||
| (use-package tramp | (use-package tramp | ||||
| :ensure t | |||||
| :defer t | |||||
| :config (custom-set-variables '(tramp-default-method "ssh")) | :config (custom-set-variables '(tramp-default-method "ssh")) | ||||
| ) | ) | ||||
| #+END_SRC | #+END_SRC | ||||
| @@ -45,7 +45,7 @@ General git configuration split out into sections mostly. | |||||
| wd = diff --color-words | wd = diff --color-words | ||||
| fa = fetch --all | fa = fetch --all | ||||
| ci = commit | ci = commit | ||||
| ciu = commit --all | |||||
| cia = commit --all | |||||
| co = checkout | co = checkout | ||||
| ds = diff --stat | ds = diff --stat | ||||
| ba = branch --all | ba = branch --all | ||||
| @@ -61,6 +61,7 @@ General git configuration split out into sections mostly. | |||||
| ri = rebase --interactive --autosquash | ri = rebase --interactive --autosquash | ||||
| ra = rebase --abort | ra = rebase --abort | ||||
| effit = reset --hard | effit = reset --hard | ||||
| bn = rev-parse --abbrev-ref HEAD | |||||
| cp = log --no-merges --cherry --graph --oneline | cp = log --no-merges --cherry --graph --oneline | ||||
| # What commits differ between branches, note, equivalent commits are omitted. | # What commits differ between branches, note, equivalent commits are omitted. | ||||
| # Use this with three dot operator aka master...origin/master | # Use this with three dot operator aka master...origin/master | ||||
| @@ -68,16 +69,18 @@ General git configuration split out into sections mostly. | |||||
| # Same as ^ only equivalent commits are listed with a = sign. | # Same as ^ only equivalent commits are listed with a = sign. | ||||
| cmd = log --no-merges --left-right --graph --cherry-mark --oneline | cmd = log --no-merges --left-right --graph --cherry-mark --oneline | ||||
| # git update with submodule update | # git update with submodule update | ||||
| sup = git pull --rebase && git submodule update --init --recursive | |||||
| sup = !git pull --rebase && git submodule update --init --recursive | |||||
| # git clone with submodules | # git clone with submodules | ||||
| sc = !git clone --recursive $1 | sc = !git clone --recursive $1 | ||||
| # what files are getting updated a lot | # what files are getting updated a lot | ||||
| churn = !git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print "count,file"} {print $1 "," $2}' | churn = !git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print "count,file"} {print $1 "," $2}' | ||||
| # help the gc a bit and get a bit more space back for a local clone | # help the gc a bit and get a bit more space back for a local clone | ||||
| trim = !git reflog expire --expire=now --all && git gc --prune=now | trim = !git reflog expire --expire=now --all && git gc --prune=now | ||||
| aliases = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\ \t => \\2/' | sort | |||||
| defremote = !git branch -rvv | egrep 'HEAD' | awk '{print $1}' | sed -e 's|/HEAD||g' | defremote = !git branch -rvv | egrep 'HEAD' | awk '{print $1}' | sed -e 's|/HEAD||g' | ||||
| p = !sh -c 'git branch ${1:-$(git defremote)}pr$0@$(iso8601 -s) $(git ls-remote -q ${1:-$(git defremote)} | grep refs/pull-requests/$0/from | cut -c1-8)' | |||||
| short = rev-parse --short | |||||
| find-merge = !sh -c "commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 | uniq -f1 -d | sort -n | tail -1 | cut -f2" | |||||
| show-merge = !sh -c "merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge" | |||||
| pbr = !git push --set-upstream $(git defremote) $(git bn) | |||||
| #+END_SRC | #+END_SRC | ||||
| ** github | ** github | ||||
| #+BEGIN_SRC conf :tangle (when (eq git-p t) "tmp/.gitconfig") | #+BEGIN_SRC conf :tangle (when (eq git-p t) "tmp/.gitconfig") | ||||
| @@ -15,11 +15,11 @@ in | |||||
| packageOverrides = pkgs: with pkgs; | packageOverrides = pkgs: with pkgs; | ||||
| let in rec { | let in rec { | ||||
| my-pinentry = pinentry.override { gtk2 = null; qt4 = null; ncurses = null; }; | |||||
| my-gnupg = gnupg.override { x11Support = false; pinentry = false; }; | |||||
| my-youtube-dl = python27Packages.youtube-dl.override { pandoc = null; }; | |||||
| custom-pinentry = pinentry.override { gtk2 = null; qt4 = null; ncurses = null; }; | |||||
| custom-gnupg = gnupg.override { x11Support = false; }; | |||||
| custom-youtube-dl = python27Packages.youtube-dl.override { pandoc = null; }; | |||||
| my-git = git.override { | |||||
| custom-git = git.override { | |||||
| pythonSupport = false; | pythonSupport = false; | ||||
| svnSupport = true; | svnSupport = true; | ||||
| guiSupport = false; | guiSupport = false; | ||||
| @@ -41,7 +41,7 @@ in | |||||
| ctags | ctags | ||||
| diffutils | diffutils | ||||
| patchutils | patchutils | ||||
| my-git | |||||
| custom-git | |||||
| gitAndTools.gitFull | gitAndTools.gitFull | ||||
| gitAndTools.git-extras | gitAndTools.git-extras | ||||
| bazaarTools | bazaarTools | ||||
| @@ -52,8 +52,8 @@ in | |||||
| docbook5 | docbook5 | ||||
| entr | entr | ||||
| emacs | emacs | ||||
| my-gnupg | |||||
| # gnupg1compat | |||||
| gnupg | |||||
| gnupg1compat | |||||
| gnutar | gnutar | ||||
| gnumake | gnumake | ||||
| sloccount | sloccount | ||||
| @@ -71,10 +71,13 @@ in | |||||
| aspell | aspell | ||||
| aspellDicts.en | aspellDicts.en | ||||
| openssl | openssl | ||||
| my-pinentry | |||||
| custom-pinentry | |||||
| poppler_utils | |||||
| ghostscript | |||||
| pbzip2 | pbzip2 | ||||
| pigz | pigz | ||||
| pv | pv | ||||
| pkgconfig | |||||
| postgresql | postgresql | ||||
| readline | readline | ||||
| rsync | rsync | ||||
| @@ -93,20 +96,21 @@ in | |||||
| unrar | unrar | ||||
| watch | watch | ||||
| nox | nox | ||||
| graphviz-nox | |||||
| mutt | mutt | ||||
| duply | duply | ||||
| # xhyve compiles normally, figure out hypervisor framework issue | |||||
| lastpass-cli | lastpass-cli | ||||
| my-youtube-dl | |||||
| custom-youtube-dl | |||||
| python27Packages.bugzilla | |||||
| python27Packages.howdoi | python27Packages.howdoi | ||||
| python27Packages.pyflakes | python27Packages.pyflakes | ||||
| python27Packages.flake8 | python27Packages.flake8 | ||||
| python27Packages.virtualenv | python27Packages.virtualenv | ||||
| python27Packages.pip | python27Packages.pip | ||||
| python27Packages.bugzilla | |||||
| python27Packages.pylint | |||||
| haskellPackages.bake | haskellPackages.bake | ||||
| haskellPackages.cabal-dependency-licenses | haskellPackages.cabal-dependency-licenses | ||||
| haskellPackages.cabal-install | |||||
| # haskellPackages.cabal-install | |||||
| haskellPackages.ghc-core | haskellPackages.ghc-core | ||||
| haskellPackages.ghc-mod | haskellPackages.ghc-mod | ||||
| haskellPackages.hasktags | haskellPackages.hasktags | ||||
| @@ -117,14 +121,15 @@ in | |||||
| haskellPackages.shake | haskellPackages.shake | ||||
| haskellPackages.idris | haskellPackages.idris | ||||
| haskellPackages.ShellCheck | haskellPackages.ShellCheck | ||||
| haskellPackages.idris | |||||
| haskellPackages.nats | |||||
| haskellPackages.transformers-compat | |||||
| haskellPackages.stack | |||||
| ] ++ stdenv.lib.optionals stdenv.isLinux [ | ] ++ stdenv.lib.optionals stdenv.isLinux [ | ||||
| # some of these are broken on osx, fix them | |||||
| # some of these are broken on osx, fix them | |||||
| rtags | rtags | ||||
| pylint | |||||
| cscope | cscope | ||||
| gcc | |||||
| # disabled for now | |||||
| # ] ++ stdenv.lib.optionals stdenv.isDarwin [ | |||||
| # xhyve compiles normally, figure out hypervisor framework issue | |||||
| ]; | ]; | ||||
| }; | }; | ||||
| }; | }; | ||||