From 8687bc3518a7ec97b339d4b1b05fb78a4c12f4e0 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 11 Jan 2019 13:40:03 -0800 Subject: [PATCH 1/9] [Emacs] Basic python lsp support --- dotfiles/emacs.d/README.org | 43 ++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 90d57ee3..d84b688a 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -2205,35 +2205,38 @@ I don't use auto-complete at all, so I have set up a hook to automatically disab <> *** python #+BEGIN_SRC emacs-lisp +(defvar imalison:use-lsp-python t) (use-package python :commands python-mode :mode ("\\.py\\'" . python-mode) :preface - (defun imalison:python-mode () - (setq show-trailing-whitespace t) - ;; TODO: This was likely fixed and can probably be removed - ;; Somehow this is sometimes set to jedi:ac-setup which we - ;; don't want. This binding avoids starting auto-complete mode. - (let ((jedi:setup-function nil)) - (jedi:setup)) + (progn + (defun imalison:jedi-setup () + ;; TODO: This was likely fixed and can probably be removed + ;; Somehow this is sometimes set to jedi:ac-setup which we + ;; don't want. This binding avoids starting auto-complete mode. + (let ((jedi:setup-function nil)) + (jedi:setup)) - ;; XXX: This has become pretty annoying - ;; (add-hook 'before-save-hook 'pyimport-remove-unused t t) + ;; XXX: This has become pretty annoying + ;; (add-hook 'before-save-hook 'pyimport-remove-unused t t) - ;; Ensure company is active - (company-mode +1) - ;; Only use company-jedi for completion - (set (make-local-variable 'company-backends) '(company-jedi)) + ;; Only use company-jedi for completion + (set (make-local-variable 'company-backends) '(company-jedi))) - ;; Remove default python completion, as we are going to rely on - ;; company-jedi. - (remove-hook 'completion-at-point-functions - 'python-completion-complete-at-point 'local)) + (defun imalison:python-mode () + (setq show-trailing-whitespace t) + ;; Remove default python completion, as we are going to rely on + ;; company-jedi or company-lsp. + ;; (remove-hook 'completion-at-point-functions + ;; 'python-completion-complete-at-point 'local) + (unless imalison:use-lsp-python + (imalison:jedi-setup)))) :config (progn - (use-package sphinx-doc) - (unbind-key "C-j" python-mode-map) - (add-hook 'python-mode-hook #'imalison:python-mode))) + (use-package sphinx-doc) + (unbind-key "C-j" python-mode-map) + (add-hook 'python-mode-hook #'imalison:python-mode))) #+END_SRC **** pippel pippel lets one manage pip packages From 72c4fd33bf7fa8d97b7f921805915985e93e0232 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 11 Jan 2019 13:40:25 -0800 Subject: [PATCH 2/9] [Emacs] Attempt to fix helm --- dotfiles/emacs.d/README.org | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index d84b688a..b0891370 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -1767,6 +1767,7 @@ bind-key and global-set-key forms. I use helm for almost all emacs completion #+BEGIN_SRC emacs-lisp -n -r (use-package helm-config + :demand t :diminish helm-mode :straight helm :bind (("M-y" . helm-show-kill-ring) @@ -1809,8 +1810,12 @@ I use helm for almost all emacs completion (setq helm-ag--extra-options option)))) :config (progn - (setq helm-ag-always-set-extra-option nil))) - (run-with-idle-timer 1 nil 'helm-mode 1))) + (setq helm-ag-always-set-extra-option nil))))) + +(use-package helm + :diminish helm-mode + :config + (helm-mode +1)) #+END_SRC ** helm-projectile #+BEGIN_SRC emacs-lisp @@ -1912,7 +1917,8 @@ I use helm for almost all emacs completion ido-use-virtual-buffers t ido-use-filename-at-point nil ido-create-new-buffer 'always) - (ido-everywhere 1) + ;; This is incompatible with helm-mode + ;; (ido-everywhere 1) (setq ido-enable-flex-matching t) (use-package flx-ido :defer 5 From 8af7af9ea8197659b4460cb655570dccd7aae641 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 11 Jan 2019 13:40:54 -0800 Subject: [PATCH 3/9] [Emacs] Misc --- dotfiles/emacs.d/README.org | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index b0891370..ac560e77 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -2685,13 +2685,13 @@ The following is taken from [[https://github.com/syl20bnr/spacemacs/blob/a650877 (progn (use-package ensime :demand t - :pin melpa-stable :bind (:map ensime-mode-map ("M-," . ensime-pop-find-definition-stack)) :commands ensime-mode :config (progn - (setq ensime-startup-snapshot-notification nil))) + (setq ensime-startup-snapshot-notification nil + ensime-startup-notification nil))) (add-hook 'scala-mode-hook 'ensime-scala-mode-hook) (setq scala-indent:align-parameters t))) #+END_SRC @@ -2730,7 +2730,7 @@ The following is taken from [[https://github.com/syl20bnr/spacemacs/blob/a650877 indent-tabs-mode nil js2-indent-switch-body t) ;; (edconf-find-file-hook) ;; Make sure that editorconfig takes precedence - (tern-mode t) + ;; (tern-mode t) (when nil (skewer-mode)) ;; TODO: reenable (setq imenu-create-index-function (lambda () @@ -4308,6 +4308,12 @@ I had to disable this mode because something that it does messes with coding set (use-package dtrt-indent :diminish 'dtrt-indent-mode :commands 'dtrt-indent-mode + :preface + (progn + (defun dtrt-indent-force-adapt () + (interactive) + (setq dtrt-indent-original-indent nil) + (dtrt-indent-adapt))) :init (add-hook 'prog-mode-hook 'dtrt-indent-mode) :config (progn From 8389279a0255233ec8fd31dfece9e90047305275 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 11 Jan 2019 13:41:20 -0800 Subject: [PATCH 4/9] [git] Ignore flymake files --- dotfiles/gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/dotfiles/gitignore b/dotfiles/gitignore index 95e40732..f560b84d 100644 --- a/dotfiles/gitignore +++ b/dotfiles/gitignore @@ -5,6 +5,7 @@ projectile.cache projectile-bookmarks.eld .dir-locals.el +*_flymake\.* # Org produces folders with temp files when editing source blocks. *Org Src* From 6a1249d5b1ce4629c5dbee5920d5a8b8d4595d06 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 11 Jan 2019 13:42:13 -0800 Subject: [PATCH 5/9] [XMonad] Build with ghc 8.6 --- dotfiles/config/xmonad/src/PagerHints.hs | 6 ++++-- dotfiles/config/xmonad/stack.yaml | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dotfiles/config/xmonad/src/PagerHints.hs b/dotfiles/config/xmonad/src/PagerHints.hs index 8126cd72..1deb7a70 100644 --- a/dotfiles/config/xmonad/src/PagerHints.hs +++ b/dotfiles/config/xmonad/src/PagerHints.hs @@ -31,8 +31,10 @@ xVisibleProp = getAtom "_XMONAD_VISIBLE_WORKSPACES" -- | Add support for the \"Current Layout\" and \"Visible Workspaces\" custom -- hints to the given config. pagerHints :: XConfig a -> XConfig a -pagerHints c = c { handleEventHook = handleEventHook c +++ pagerHintsEventHook - , logHook = logHook c +++ pagerHintsLogHook } +pagerHints c = + c { handleEventHook = handleEventHook c +++ pagerHintsEventHook + , logHook = logHook c +++ pagerHintsLogHook + } where x +++ y = x `mappend` y -- | Update the current values of both custom hints. diff --git a/dotfiles/config/xmonad/stack.yaml b/dotfiles/config/xmonad/stack.yaml index 8e09048c..910d7197 100644 --- a/dotfiles/config/xmonad/stack.yaml +++ b/dotfiles/config/xmonad/stack.yaml @@ -8,7 +8,7 @@ packages: extra-dep: true extra-deps: - X11-xft-0.3.1 -resolver: lts-11.7 +resolver: lts-13.2 nix: packages: - pkgconfig @@ -18,3 +18,4 @@ nix: - xorg.libXinerama - xorg.libXrandr - xorg.libXrender + - xorg.libXScrnSaver From 8427bbbc16aa6a5abddc2f5b7fce6bcd5d806d83 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 11 Jan 2019 13:44:04 -0800 Subject: [PATCH 6/9] [transmission] Stop tracking settings because they change from comp to comp --- dotfiles/config/transmission/settings.json | 97 ---------------------- 1 file changed, 97 deletions(-) delete mode 100644 dotfiles/config/transmission/settings.json diff --git a/dotfiles/config/transmission/settings.json b/dotfiles/config/transmission/settings.json deleted file mode 100644 index bba150ce..00000000 --- a/dotfiles/config/transmission/settings.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "alt-speed-down": 50, - "alt-speed-enabled": false, - "alt-speed-time-begin": 540, - "alt-speed-time-day": 127, - "alt-speed-time-enabled": false, - "alt-speed-time-end": 1020, - "alt-speed-up": 50, - "bind-address-ipv4": "0.0.0.0", - "bind-address-ipv6": "::", - "blocklist-enabled": false, - "blocklist-updates-enabled": true, - "blocklist-url": "http://www.example.com/blocklist", - "cache-size-mb": 4, - "compact-view": false, - "dht-enabled": true, - "download-dir": "/backups", - "download-queue-enabled": true, - "download-queue-size": 5, - "encryption": 1, - "idle-seeding-limit": 30, - "idle-seeding-limit-enabled": false, - "incomplete-dir": "/backups", - "incomplete-dir-enabled": true, - "inhibit-desktop-hibernation": false, - "lpd-enabled": false, - "main-window-height": 597, - "main-window-is-maximized": 0, - "main-window-width": 1478, - "main-window-x": 1545, - "main-window-y": 2396, - "message-level": 2, - "open-dialog-dir": "/home/imalison", - "peer-congestion-algorithm": "", - "peer-id-ttl-hours": 6, - "peer-limit-global": 200, - "peer-limit-per-torrent": 50, - "peer-port": 51413, - "peer-port-random-high": 65535, - "peer-port-random-low": 49152, - "peer-port-random-on-start": false, - "peer-socket-tos": "default", - "pex-enabled": true, - "port-forwarding-enabled": true, - "preallocation": 1, - "prefetch-enabled": true, - "queue-stalled-enabled": true, - "queue-stalled-minutes": 30, - "ratio-limit": 1.5000, - "ratio-limit-enabled": true, - "recent-download-dir-1": "/backups", - "recent-download-dir-2": "/home/imalison/Downloads", - "recent-download-dir-3": "/backups/Download", - "rename-partial-files": true, - "rpc-authentication-required": false, - "rpc-bind-address": "0.0.0.0", - "rpc-enabled": true, - "rpc-password": "{885dd6dad1998041734e98dbfe4c837900eeeeac9YQyusfH", - "rpc-port": 9091, - "rpc-url": "/transmission/", - "rpc-username": "", - "rpc-whitelist": "127.0.0.1", - "rpc-whitelist-enabled": true, - "scrape-paused-torrents-enabled": true, - "script-torrent-done-enabled": false, - "script-torrent-done-filename": "/home/imalison", - "seed-queue-enabled": false, - "seed-queue-size": 10, - "show-backup-trackers": false, - "show-extra-peer-details": true, - "show-filterbar": true, - "show-notification-area-icon": false, - "show-options-window": true, - "show-statusbar": true, - "show-toolbar": true, - "show-tracker-scrapes": false, - "sort-mode": "sort-by-name", - "sort-reversed": false, - "speed-limit-down": 100, - "speed-limit-down-enabled": false, - "speed-limit-up": 100, - "speed-limit-up-enabled": false, - "start-added-torrents": true, - "statusbar-stats": "total-ratio", - "torrent-added-notification-enabled": true, - "torrent-complete-notification-enabled": true, - "torrent-complete-sound-command": "canberra-gtk-play -i complete-download -d 'transmission torrent downloaded'", - "torrent-complete-sound-enabled": true, - "trash-can-enabled": true, - "trash-original-torrent-files": false, - "umask": 18, - "upload-slots-per-torrent": 14, - "user-has-given-informed-consent": true, - "utp-enabled": true, - "watch-dir": "/home/imalison/Downloads", - "watch-dir-enabled": false -} From c714d3826fbf2ca0d407dafdbfe5240ccd1252be Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Mon, 4 Feb 2019 09:21:51 -0800 Subject: [PATCH 7/9] Ignore cabal files --- .gitignore | 2 +- dotfiles/cabal/.gitignore | 4 ++++ dotfiles/cabal/config | 10 ++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 dotfiles/cabal/.gitignore create mode 100644 dotfiles/cabal/config diff --git a/.gitignore b/.gitignore index 57ec0659..e33ad5ea 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ /dotfiles/boot/cache /dotfiles/chrome-remote-desktop-session /dotfiles/cider/.cache/ +/dotfiles/config/gtk-2.0/gtkfilechooser.ini /dotfiles/pip/cache/ /dotfiles/pip/download_cache/ /dotfiles/pip/pip.conf @@ -18,4 +19,3 @@ /dotfiles/vim/bundle/* /dotfiles/wemo/cache gotools -/dotfiles/config/gtk-2.0/gtkfilechooser.ini diff --git a/dotfiles/cabal/.gitignore b/dotfiles/cabal/.gitignore new file mode 100644 index 00000000..58e4f6ba --- /dev/null +++ b/dotfiles/cabal/.gitignore @@ -0,0 +1,4 @@ +/lib +/logs +/packages +/share diff --git a/dotfiles/cabal/config b/dotfiles/cabal/config new file mode 100644 index 00000000..8e4454ce --- /dev/null +++ b/dotfiles/cabal/config @@ -0,0 +1,10 @@ +repository hackage.haskell.org + url: http://hackage.haskell.org/ + +nix: True +remote-repo-cache: /home/imalison/.cabal/packages +world-file: /home/imalison/.cabal/world +extra-prog-path: /home/imalison/.cabal/bin +build-summary: /home/imalison/.cabal/logs/build.log +remote-build-reporting: anonymous +jobs: $ncpus From 5bf56a797b7c678731cbeae2ec89c879ec68d3d6 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 5 Feb 2019 09:30:25 -0800 Subject: [PATCH 8/9] [NixOS] Add openvpn dependencies --- nixos/configuration.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index f6efb0ef..842db5aa 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -176,8 +176,10 @@ in ispell jq mercurial + networkmanager-openvpn ncdu neofetch + openvpn pass patchelf plasma-workspace @@ -192,6 +194,7 @@ in stow tmux unzip + usbutils valgrind wget wmctrl From 2ab0b3babfabac31c15dc754c366bd679d03e55e Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 5 Feb 2019 09:30:51 -0800 Subject: [PATCH 9/9] [NixOS] Add samba service to imalison-home --- nixos/machines/imalison-home.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/nixos/machines/imalison-home.nix b/nixos/machines/imalison-home.nix index 7fb10313..7c1b2fae 100644 --- a/nixos/machines/imalison-home.nix +++ b/nixos/machines/imalison-home.nix @@ -61,6 +61,32 @@ networking.hostName = "imalison-home"; boot.loader.efi.canTouchEfiVariables = true; + services.samba = { + enable = true; + syncPasswordsByPam = true; + extraConfig = '' + workgroup = WORKGROUP + server string = smbnix + netbios name = smbnix + #use sendfile = yes + #max protocol = smb2 + hosts allow = 192.168.0 localhost + hosts deny = 0.0.0.0/0 + ''; + shares = { + private = { + path = "/backups"; + browseable = "yes"; + "read only" = "no"; + "guest ok" = "no"; + "create mask" = "0644"; + "directory mask" = "0755"; + "force user" = "username"; + "force group" = "groupname"; + }; + }; + }; + services.xserver = { screenSection = '' DefaultDepth 24