From ddd85115398fd47e7eaf76741e2e93582d52c1a1 Mon Sep 17 00:00:00 2001 From: Yorick van Pelt Date: Sat, 10 Mar 2018 17:39:29 +0100 Subject: [PATCH] update dotfiles --- emacs/emacs.org | 5 + git/.gitconfig | 2 + gpg/.gnupg/gpg-agent.conf | 1 + i3/i3.nix | 4 +- install.sh | 2 +- misc/.ssh/config | 10 ++ nix/.config/nixpkgs/overlays/02-extrapkgs.nix | 11 +- nix/.config/nixpkgs/overlays/05-envs.nix | 21 ++- nix/.config/nixpkgs/pkgs/ftb.nix | 4 +- rofi/.config/rofi/config.rasi | 136 ++++++++++++++++++ rofi/.config/rofi/rofi-pass | 92 ++++++++++++ 11 files changed, 264 insertions(+), 24 deletions(-) create mode 100644 rofi/.config/rofi/config.rasi create mode 100644 rofi/.config/rofi/rofi-pass diff --git a/emacs/emacs.org b/emacs/emacs.org index f890925..ee8902c 100644 --- a/emacs/emacs.org +++ b/emacs/emacs.org @@ -165,6 +165,11 @@ (put 'sfp-page-up 'isearch-scroll t) (put 'sfp-page-up 'CUA 'move) (setq scroll-error-top-bottom t) +#+END_SRC +** fix c-z +#+BEGIN_SRC emacs-lisp +(global-unset-key (kbd "C-z")) + #+END_SRC ** Ivy #+BEGIN_SRC emacs-lisp diff --git a/git/.gitconfig b/git/.gitconfig index 418df8d..fc37b7a 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -23,3 +23,5 @@ signingkey = A36E70F9DC014A15 [help] autocorrect = 5 +[includeIf "gitdir:~/serokell/"] +path=~/serokell/.gitconfig diff --git a/gpg/.gnupg/gpg-agent.conf b/gpg/.gnupg/gpg-agent.conf index 85405bc..5e8a57c 100644 --- a/gpg/.gnupg/gpg-agent.conf +++ b/gpg/.gnupg/gpg-agent.conf @@ -1 +1,2 @@ enable-ssh-support +extra-socket /home/yorick/.gnupg/S.gpg-agent.extra diff --git a/i3/i3.nix b/i3/i3.nix index e2af6ec..b24bbef 100644 --- a/i3/i3.nix +++ b/i3/i3.nix @@ -1,7 +1,7 @@ {writeTextDir, writeScript, lib, rofi, xss-lock, nitrogen, compton-git, i3status, i3-gaps ,i3lock-color, xset, alsaUtils, light, screenshot_public, xorg, libinput-gestures, -haskellPackages, polybar, procps, +haskellPackages, polybar, procps, rofi-pass, with_lock ? true, compton_name ? "default"}: let @@ -185,7 +185,7 @@ bindsym XF86AudioRaiseVolume exec ${alsaUtils}/bin/amixer set Master 1%+ bindsym XF86AudioMute exec ${alsaUtils}/bin/amixer set Master toggle bindsym $mod+Shift+s exec --no-startup-id ${screenshot_public}/bin/screenshot_public bindsym Print exec --no-startup-id ${screenshot_public}/bin/screenshot_public -bindsym $mod+p exec --no-startup-id passmenu +bindsym $mod+p exec --no-startup-id ${rofi-pass}/bin/rofi-pass workspace_auto_back_and_forth yes hide_edge_borders smart diff --git a/install.sh b/install.sh index 381374c..836b31f 100755 --- a/install.sh +++ b/install.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash #!nix-shell -i bash -p stow -$(nix-build '' -A stow --no-out-link)/bin/stow -d `dirname $0` -t ~ nix git x gtk gpg mutt misc bash stow +$(nix-build '' -A stow --no-out-link)/bin/stow -d `dirname $0` -t ~ nix git x gtk gpg mutt misc bash stow rofi nix-build -A $(hostname -s) diff --git a/misc/.ssh/config b/misc/.ssh/config index d82916b..b47b847 100644 --- a/misc/.ssh/config +++ b/misc/.ssh/config @@ -39,3 +39,13 @@ Host asc_wh hostname 192.168.1.4 ProxyJump yorick@woodhouse.onion +Host skl_deployer + hostname deployer.serokell.team + RemoteForward /home/yorick/.aws/pass-socket /home/yorick/.aws/pass-socket + RemoteForward /home/yorick/.gnupg/S.gpg-agent /home/yorick/.gnupg/S.gpg-agent.extra + ForwardAgent yes +Host skl_deployer_vbox + hostname 192.168.56.101 + ForwardAgent yes + RemoteForward /home/yorick/.aws/pass-socket /home/yorick/.aws/pass-socket + RemoteForward /home/yorick/.gnupg/S.gpg-agent /home/yorick/.gnupg/S.gpg-agent.extra diff --git a/nix/.config/nixpkgs/overlays/02-extrapkgs.nix b/nix/.config/nixpkgs/overlays/02-extrapkgs.nix index 67d317a..fe8de1a 100644 --- a/nix/.config/nixpkgs/overlays/02-extrapkgs.nix +++ b/nix/.config/nixpkgs/overlays/02-extrapkgs.nix @@ -21,18 +21,13 @@ self: super: { ''; }; - weiightminder = super.callPackage (super.fetchgit { + + weiightminder = super.callPackage (builtins.fetchGit { url = https://gist.github.com/yorickvP/229d21a7da13c9c514dbd26147822641; rev = "9749ef4d83c0078bc0248215ee882d7124827cf3"; - sha256 = "0kxi20ss2k22sv3ndplnklc6r7ja0lcgklw6mz43qcj7vmgxxllf"; + #sha256 = "0kxi20ss2k22sv3ndplnklc6r7ja0lcgklw6mz43qcj7vmgxxllf"; }) {}; - node2nix_git = (super.callPackage (super.fetchFromGitHub { - owner = "svanderburg"; - repo = "node2nix"; - rev = "b6545937592e7e54a14a2df315598570480fee9f"; - sha256 = "1y50gs5mk2sdzqx68lr3qb71lh7jp4c38ynybf8ikx7kfkzxvasb"; - }) {}).package; yscripts = super.callPackage /home/yorick/dotfiles/bin {}; } diff --git a/nix/.config/nixpkgs/overlays/05-envs.nix b/nix/.config/nixpkgs/overlays/05-envs.nix index a900ed2..a68adf3 100644 --- a/nix/.config/nixpkgs/overlays/05-envs.nix +++ b/nix/.config/nixpkgs/overlays/05-envs.nix @@ -16,8 +16,7 @@ in { xorg.xrandr pavucontrol light nitrogen - dropbox # really? - # wpa_supplicant_gui + # dropbox # really? xclip siji fira-mono playerctl font-awesome-ttf ]; scripts = mkEnv "y-scripts" [ @@ -26,6 +25,7 @@ in { ]; apps = mkEnv "y-apps" [ + wpa_supplicant_gui gajim neomutt torbrowser @@ -35,14 +35,13 @@ in { tdesktop #hexchat #inkscape - keepassx + #keepassx # libreoffice # skype spotify quasselClient leafpad calibre - wpa_supplicant_gui #py2.plover wireshark meld discord @@ -64,7 +63,7 @@ in { ]; nix = mkEnv "y-nix" [ - patchelf nix nix-prefetch-git nix-repl nixopsUnstable nox + patchelf nixUnstable nix-prefetch-git nixopsUnstable nox ]; c = mkEnv "y-cdev" [ @@ -83,9 +82,9 @@ in { jq jo ]; - code = mkEnv "y-code" [ - python gitAndTools.hub gnumake cloc silver-searcher gitFire gti - ]; + code = mkEnv "y-code" (with gitAndTools; [ + python3 git-crypt hub gnumake cloc silver-searcher gitFire gti gcc + ]); java = openjdk; games = mkEnv "y-games" [ @@ -94,7 +93,7 @@ in { ]; js = mkEnv "y-jsdev" [ - js.jshint nodejs-6_x electron node2nix_git + js.jshint nodejs electron js.node2nix ]; pdf = mkEnv "y-pdf" [ @@ -109,8 +108,8 @@ in { # will remove all your previously installed nix-env stuff # so check with nix-env -q first hosts = with self; with self.envs; { - ascanius = [apps code de games envs.js pdf nix media gcc misc scripts coins]; - jarvis = [apps code de games envs.js pdf nix media gcc misc scripts myEmacs]; + ascanius = [apps code de games envs.js pdf nix media misc scripts coins myEmacs]; + jarvis = [apps code de games envs.js pdf nix media misc scripts myEmacs]; woodhouse = [de media misc kodi chromium spotify]; pennyworth = []; frumar = [bup gitAndTools.git-annex rtorrent pyroscope]; diff --git a/nix/.config/nixpkgs/pkgs/ftb.nix b/nix/.config/nixpkgs/pkgs/ftb.nix index 632f72e..d76f3e6 100644 --- a/nix/.config/nixpkgs/pkgs/ftb.nix +++ b/nix/.config/nixpkgs/pkgs/ftb.nix @@ -9,7 +9,7 @@ in name = "ftb-1.4.14"; src = fetchurl { url = "http://ftb.cursecdn.com/FTB2/launcher/FTB_Launcher.jar"; - sha256 = "1m2kyvq4fknr3ric5wwg55qzjqhpkjaq9zragsvippibg78w9hy4"; + sha256 = "10ga4jgyfsj5dy4rj2rla0fpnfpnxv8r3bmxpqpwn7fsry4il79v"; }; phases = "installPhase"; @@ -32,4 +32,4 @@ in homepage = http://www.feed-the-beast.com; license = stdenv.lib.licenses.unfreeRedistributable; }; -} \ No newline at end of file +} diff --git a/rofi/.config/rofi/config.rasi b/rofi/.config/rofi/config.rasi new file mode 100644 index 0000000..1bd0075 --- /dev/null +++ b/rofi/.config/rofi/config.rasi @@ -0,0 +1,136 @@ +configuration { + modi: "window,run,ssh,drun"; +/* width: 50;*/ +/* lines: 15;*/ +/* columns: 1;*/ + font: "Source Code Pro 12"; +/* bw: 1;*/ +/* location: 0;*/ +/* padding: 5;*/ +/* yoffset: 0;*/ +/* xoffset: 0;*/ +/* fixed-num-lines: true;*/ +/* show-icons: false;*/ +/* terminal: "rofi-sensible-terminal";*/ +/* ssh-client: "ssh";*/ +/* ssh-command: "{terminal} -e {ssh-client} {host}";*/ +/* run-command: "{cmd}";*/ +/* run-list-command: "";*/ +/* run-shell-command: "{terminal} -e {cmd}";*/ +/* window-command: "xkill -id {window}";*/ +/* drun-icon-theme: ;*/ +/* disable-history: false;*/ +/* sort: false;*/ +/* levenshtein-sort: false;*/ +/* case-sensitive: false;*/ +/* cycle: true;*/ +/* sidebar-mode: false;*/ +/* eh: 1;*/ +/* auto-select: false;*/ +/* parse-hosts: false;*/ +/* parse-known-hosts: true;*/ +/* combi-modi: "window,run";*/ +/* matching: "normal";*/ +/* tokenize: true;*/ +/* m: "-5";*/ +/* line-margin: 2;*/ +/* line-padding: 1;*/ +/* filter: ;*/ +/* separator-style: "dash";*/ +/* hide-scrollbar: false;*/ +/* fullscreen: false;*/ +/* fake-transparency: false;*/ + dpi: 109; +/* threads: 0;*/ +/* scrollbar-width: 8;*/ +/* scroll-method: 0;*/ +/* fake-background: "screenshot";*/ +/* window-format: "{w} {i}{c} {t}";*/ +/* click-to-exit: true;*/ +/* show-match: true;*/ + theme: "solarized_alternate"; +/* color-normal: ;*/ +/* color-urgent: ;*/ +/* color-active: ;*/ +/* color-window: ;*/ +/* plugin-path: "/nix/store/21jzqk1r0ni4dwjr6icq5w7kginmg61y-rofi-1.4.2/lib/rofi";*/ +/* pid: "/run/user/1000/rofi.pid";*/ +/* display-window: ;*/ +/* display-windowcd: ;*/ +/* display-run: ;*/ +/* display-ssh: ;*/ +/* display-drun: ;*/ +/* display-combi: ;*/ +/* display-keys: ;*/ +/* kb-primary-paste: "Control+V,Shift+Insert";*/ +/* kb-secondary-paste: "Control+v,Insert";*/ +/* kb-clear-line: "Control+w";*/ +/* kb-move-front: "Control+a";*/ +/* kb-move-end: "Control+e";*/ +/* kb-move-word-back: "Alt+b";*/ +/* kb-move-word-forward: "Alt+f";*/ +/* kb-move-char-back: "Left,Control+b";*/ +/* kb-move-char-forward: "Right,Control+f";*/ +/* kb-remove-word-back: "Control+Alt+h,Control+BackSpace";*/ +/* kb-remove-word-forward: "Control+Alt+d";*/ +/* kb-remove-char-forward: "Delete,Control+d";*/ +/* kb-remove-char-back: "BackSpace,Control+h";*/ +/* kb-remove-to-eol: "Control+k";*/ +/* kb-remove-to-sol: "Control+u";*/ +/* kb-accept-entry: "Control+j,Control+m,Return,KP_Enter";*/ +/* kb-accept-custom: "Control+Return";*/ +/* kb-accept-alt: "Shift+Return";*/ +/* kb-delete-entry: "Shift+Delete";*/ +/* kb-mode-next: "Shift+Right,Control+Tab";*/ +/* kb-mode-previous: "Shift+Left,Control+ISO_Left_Tab";*/ +/* kb-row-left: "Control+Page_Up";*/ +/* kb-row-right: "Control+Page_Down";*/ +/* kb-row-up: "Up,Control+p,ISO_Left_Tab";*/ +/* kb-row-down: "Down,Control+n";*/ +/* kb-row-tab: "Tab";*/ +/* kb-page-prev: "Page_Up";*/ +/* kb-page-next: "Page_Down";*/ +/* kb-row-first: "Home,KP_Home";*/ +/* kb-row-last: "End,KP_End";*/ +/* kb-row-select: "Control+space";*/ +/* kb-screenshot: "Alt+S";*/ +/* kb-toggle-case-sensitivity: "grave,dead_grave";*/ +/* kb-toggle-sort: "Alt+grave";*/ +/* kb-cancel: "Escape,Control+g,Control+bracketleft";*/ +/* kb-custom-1: "Alt+1";*/ +/* kb-custom-2: "Alt+2";*/ +/* kb-custom-3: "Alt+3";*/ +/* kb-custom-4: "Alt+4";*/ +/* kb-custom-5: "Alt+5";*/ +/* kb-custom-6: "Alt+6";*/ +/* kb-custom-7: "Alt+7";*/ +/* kb-custom-8: "Alt+8";*/ +/* kb-custom-9: "Alt+9";*/ +/* kb-custom-10: "Alt+0";*/ +/* kb-custom-11: "Alt+exclam";*/ +/* kb-custom-12: "Alt+at";*/ +/* kb-custom-13: "Alt+numbersign";*/ +/* kb-custom-14: "Alt+dollar";*/ +/* kb-custom-15: "Alt+percent";*/ +/* kb-custom-16: "Alt+dead_circumflex";*/ +/* kb-custom-17: "Alt+ampersand";*/ +/* kb-custom-18: "Alt+asterisk";*/ +/* kb-custom-19: "Alt+parenleft";*/ +/* kb-select-1: "Super+1";*/ +/* kb-select-2: "Super+2";*/ +/* kb-select-3: "Super+3";*/ +/* kb-select-4: "Super+4";*/ +/* kb-select-5: "Super+5";*/ +/* kb-select-6: "Super+6";*/ +/* kb-select-7: "Super+7";*/ +/* kb-select-8: "Super+8";*/ +/* kb-select-9: "Super+9";*/ +/* kb-select-10: "Super+0";*/ +/* ml-row-left: "Mouse6";*/ +/* ml-row-right: "Mouse7";*/ +/* ml-row-up: "Mouse4";*/ +/* ml-row-down: "Mouse5";*/ +/* me-select-entry: "Mouse1";*/ +/* me-accept-entry: "MouseD1";*/ +/* me-accept-custom: "Control+MouseD1";*/ +} diff --git a/rofi/.config/rofi/rofi-pass b/rofi/.config/rofi/rofi-pass new file mode 100644 index 0000000..0794c0f --- /dev/null +++ b/rofi/.config/rofi/rofi-pass @@ -0,0 +1,92 @@ +#!/usr/bin/env bash +set -e +set -o pipefail + +print-passwords() { + prefix=${PASSWORD_STORE_DIR-~/.password-store} + password_files=( "$prefix"/**/*.gpg ) + password_files=( "${password_files[@]#"$prefix"/}" ) + password_files=( "${password_files[@]%.gpg}" ) + printf '%s\n' "${password_files[@]}" +} + +copy-account-field() { + lpass show --clip "--${2}" "$1" >/dev/null 2>/dev/null +} + +open-account-url() { + local url=$(lpass show --url "$1") + if [[ -n $url ]]; then + xdg-open "$url" >/dev/null 2>/dev/null + else + exit 2 + fi +} + +is-actual-url() { + local url="$1" + if [[ -n $url && "$url" != " " && "$url" != "http://" && "$url" != "https://" ]]; then + return 0 + else + return 1 + fi +} + +show-account-options() { + local id="$1" + + echo ">> Copy password [$id]" + echo ">> Copy username [$id]" + + url=$(lpass show --url "$id") + if is-actual-url "$url"; then + echo ">> Open $url [$id]" + echo ">> Copy URL [$id]" + fi + + echo ">> Copy ID [$id]" +} + +is-entry-selected() { + if [[ -n $@ ]]; then + return 0 + else + return 1 + fi +} + +id-in-selection() { + echo "$1" | grep -oE '\[[0-9]+\]$' | tr -d '[]' +} + +debug() { + echo "$@" > /dev/stderr +} + +if is-entry-selected "$1"; then + selected="$1" + + id="$(id-in-selection "$selected")" + + if [[ -n $id ]]; then + case "$selected" in + '>> Copy password'*) + copy-account-field "$id" password ;; + '>> Copy username'*) + copy-account-field "$id" username ;; + '>> Copy URL'*) + copy-account-field "$id" url ;; + '>> Copy ID'*) + copy-account-field "$id" id ;; + '>> Open'*) + open-account-url "$id" ;; + *) + show-account-options "$id" ;; + esac + else + echo "Could not detect the entry ID of \"${selection}\"" + exit 1 + fi +else + print-passwords +fi