From ef83a4b8907c30446df0b5e34154af4587cc3f3e Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 14 Jun 2018 15:16:17 -0700 Subject: [PATCH] [Emacs] Fix inverted server start condition --- dotfiles/emacs.d/README.org | 2 +- dotfiles/lib/bin/enable_git_sync.sh | 5 +++++ dotfiles/lib/bin/git_sync_directory.sh | 11 +++++++++++ nixos/configuration.nix | 17 +++++++++++++++-- 4 files changed, 32 insertions(+), 3 deletions(-) create mode 100755 dotfiles/lib/bin/enable_git_sync.sh create mode 100755 dotfiles/lib/bin/git_sync_directory.sh diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index c83a941a..444790d5 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -1440,7 +1440,7 @@ The file server file for this emacs instance no longer exists.") (let ((server-dir (if server-use-tcp server-auth-dir server-socket-dir))) (expand-file-name server-name server-dir))) (setq server-use-tcp t) - (unless (equal nil (server-running-p)) (server-start)) + (when (equal nil (server-running-p)) (server-start)) (run-with-timer 0 60 'imalison:make-main-emacs-server))) #+END_SRC ** list-environment diff --git a/dotfiles/lib/bin/enable_git_sync.sh b/dotfiles/lib/bin/enable_git_sync.sh new file mode 100755 index 00000000..2e1ab9d1 --- /dev/null +++ b/dotfiles/lib/bin/enable_git_sync.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +git config --bool branch.master.sync true +git config --bool branch.master.syncNewFiles true +git branch --set-upstream-to=origin/master diff --git a/dotfiles/lib/bin/git_sync_directory.sh b/dotfiles/lib/bin/git_sync_directory.sh new file mode 100755 index 00000000..ce756041 --- /dev/null +++ b/dotfiles/lib/bin/git_sync_directory.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +cd "$1" + +echo "Syncing $1" +git-sync +enable_git_sync.sh + +while changedFile=$(inotifywait ./ -r -e modify,move,create,delete --format "%w%f" --exclude '\.git' 2>/dev/null); do + git check-ignore "$changedFile" >> /dev/null || git-sync +done diff --git a/nixos/configuration.nix b/nixos/configuration.nix index c3a96cdb..9656b557 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -10,9 +10,16 @@ let pip ]; python-with-my-packages = pkgs.python3.withPackages my-python-packages; + # clipit-master = pkgs.clipt.overrideAttrs (oldAttrs: rec { + # src = fetchFromGitHub { + # owner = "shantzu"; + # repo = "ClipIt"; + # rev = "eb9adaf2b5fd65aac1e83d6544b9076aae6af5b7"; + # sha256 = "01if8y93wa0mwbkzkzx2v1vqh47zlz4k1dysl6yh5rmppd1psknz"; + # }; + # }); in { - boot.loader.systemd-boot.enable = true; nixpkgs.config.allowUnfree = true; security.sudo.wheelNeedsPassword = false; networking.networkmanager.enable = true; @@ -76,12 +83,13 @@ in clipit compton feh - sddm-kcm networkmanagerapplet pinentry pommed_light rofi rofi-pass + sddm-kcm + udiskie volnoti xclip xdotool @@ -107,6 +115,7 @@ in gnumake gnupg htop + inotify-tools ncdu pass python-with-my-packages @@ -117,7 +126,11 @@ in wget zsh + # Nix + nix-prefetch-git + # Miscellaneous + android-udev-rules librsvg ];