From f34ff0008242f9cd761ff3855a2307167d439613 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 13 Jul 2018 17:20:10 -0700 Subject: [PATCH 01/10] [NixOS] Add node packages --- nixos/configuration.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index b2d7c219..43d1ebc8 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -195,10 +195,15 @@ in sbt scala + # Node + nodePackages.npm + nodejs + # Tools bazaar binutils dfeet + dpkg gcc gdb gitAndTools.git-sync @@ -214,6 +219,7 @@ in ncdu neofetch pass + patchelf plasma-workspace powertop python-with-my-packages From 0026359c8ed701d6d703e0d3968b57f5d0e9e06f Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 13 Jul 2018 17:28:16 -0700 Subject: [PATCH 02/10] [NixOS] Add gitter --- dotfiles/config/systemd/user/gitter.service | 3 +- nixos/configuration.nix | 2 + nixos/gitter.nix | 65 +++++++++++++++++++++ 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 nixos/gitter.nix diff --git a/dotfiles/config/systemd/user/gitter.service b/dotfiles/config/systemd/user/gitter.service index 5779ba95..dfe54e37 100644 --- a/dotfiles/config/systemd/user/gitter.service +++ b/dotfiles/config/systemd/user/gitter.service @@ -4,7 +4,8 @@ Wants=taffybar.service After=taffybar.service [Service] -ExecStart=/usr/bin/env run_unity.sh gitter +ExecStart=/usr/bin/env Gitter +ExecStart/usr/bin/env pkill Gitter Restart=always [Install] diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 43d1ebc8..e6166b94 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -1,5 +1,6 @@ { config, pkgs, ... }: let + gitter = with pkgs; callPackage ./gitter.nix { }; my-python-packages = python-packages: with python-packages; [ appdirs requests @@ -134,6 +135,7 @@ in emacs firefox kleopatra + gitter google-chrome hexchat keybase-gui-fixed diff --git a/nixos/gitter.nix b/nixos/gitter.nix new file mode 100644 index 00000000..a7da1cb4 --- /dev/null +++ b/nixos/gitter.nix @@ -0,0 +1,65 @@ +{ stdenv, alsaLib, atk, cairo, cups, dbus, dpkg, expat, fetchurl +, fontconfig, freetype, gdk_pixbuf, glib, gnome3, gtk3, libX11 +, libXScrnSaver, libXcomposite, libXcursor, libXdamage, libXext, libXfixes +, libXi, libXrandr, libXrender, libXtst, libappindicator-gtk3, libcxx +, libnotify, libpulseaudio, libxcb, makeDesktopItem, makeWrapper, nspr, nss +, nwjs, pango, systemd }: + +stdenv.mkDerivation rec { + pname = "gitter"; + version = "4.1.0"; + name = "${pname}-${version}"; + + src = fetchurl { + url = "https://update.gitter.im/linux64/${pname}_${version}_amd64.deb"; + sha256 = "1gny9i2pywvczzrs93k8krqn6hwm6c2zg8yr3xmjqs3p88817wbi"; + }; + + nativeBuildInputs = [ makeWrapper dpkg ]; + + unpackPhase = "dpkg -x $src ."; + + libPath = stdenv.lib.makeLibraryPath [ + alsaLib atk cairo cups dbus expat fontconfig freetype gdk_pixbuf glib + gnome3.gconf gtk3 libX11 libXScrnSaver libXcomposite libXcursor libXdamage + libXext libXfixes libXi libXrandr libXrender libXtst libappindicator-gtk3 + libcxx libnotify libpulseaudio libxcb nspr nss pango stdenv.cc.cc systemd + ]; + + gitterDirectorySuffix = "opt/gitter"; + + installPhase = '' + mkdir -p $out/{bin,opt/gitter,share/pixmaps} + mv ./opt/Gitter/linux64/* $out/opt/gitter + + patchelf --debug --set-interpreter ${stdenv.cc.bintools.dynamicLinker} \ + --set-rpath "$out/${gitterDirectorySuffix}/lib:${libPath}" \ + $out/${gitterDirectorySuffix}/Gitter + + patchelf --debug --set-rpath "$out/${gitterDirectorySuffix}/lib:${libPath}" \ + $out/${gitterDirectorySuffix}/lib/libnw.so + + wrapProgram $out/${gitterDirectorySuffix}/Gitter --prefix LD_LIBRARY_PATH : ${libPath} + + ln -s $out/${gitterDirectorySuffix}/Gitter $out/bin/ + ln -s $out/${gitterDirectorySuffix}/logo.png $out/share/pixmaps/gitter.png + ln -s "${desktopItem}/share/applications" $out/share/ + ''; + + desktopItem = makeDesktopItem { + name = pname; + exec = "Gitter"; + icon = pname; + desktopName = "Gitter"; + genericName = meta.description; + categories = "Network;InstantMessaging;"; + }; + + meta = with stdenv.lib; { + description = "Where developers come to talk"; + downloadPage = "https://gitter.im/apps"; + license = licenses.mit; + maintainers = [ maintainers.imalison ]; + platforms = [ "x86_64-linux" ]; + }; +} From 35d25058bd661711ddc34e250e8fe2c629af8d44 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 13 Jul 2018 17:52:59 -0700 Subject: [PATCH 03/10] [NixOS] Fix gitter derivation --- nixos/configuration.nix | 3 +-- nixos/gitter.nix | 34 ++++++++++++++++++++-------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index e6166b94..539fa64c 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -313,8 +313,7 @@ in # Define a user account. Don't forget to set a password with ‘passwd’. users.extraUsers = let extraGroups = [ - "wheel" "disk" "audio" "video" - "networkmanager" "systemd-journal" + "wheel" "disk" "audio" "video" "networkmanager" "systemd-journal" ]; userDefaults = { inherit extraGroups; diff --git a/nixos/gitter.nix b/nixos/gitter.nix index a7da1cb4..ba8547f1 100644 --- a/nixos/gitter.nix +++ b/nixos/gitter.nix @@ -5,7 +5,19 @@ , libnotify, libpulseaudio, libxcb, makeDesktopItem, makeWrapper, nspr, nss , nwjs, pango, systemd }: -stdenv.mkDerivation rec { +let gitterDirectorySuffix = "opt/gitter"; + doELFPatch = target: '' + patchelf --set-interpreter ${stdenv.cc.bintools.dynamicLinker} \ + --set-rpath "$out/${gitterDirectorySuffix}/lib:${libPath}" \ + $out/${gitterDirectorySuffix}/${target} + ''; + libPath = stdenv.lib.makeLibraryPath [ + alsaLib atk cairo cups dbus expat fontconfig freetype gdk_pixbuf glib + gnome3.gconf gtk3 libX11 libXScrnSaver libXcomposite libXcursor libXdamage + libXext libXfixes libXi libXrandr libXrender libXtst libappindicator-gtk3 + libcxx libnotify libpulseaudio libxcb nspr nss pango stdenv.cc.cc systemd + ]; +in stdenv.mkDerivation rec { pname = "gitter"; version = "4.1.0"; name = "${pname}-${version}"; @@ -19,24 +31,18 @@ stdenv.mkDerivation rec { unpackPhase = "dpkg -x $src ."; - libPath = stdenv.lib.makeLibraryPath [ - alsaLib atk cairo cups dbus expat fontconfig freetype gdk_pixbuf glib - gnome3.gconf gtk3 libX11 libXScrnSaver libXcomposite libXcursor libXdamage - libXext libXfixes libXi libXrandr libXrender libXtst libappindicator-gtk3 - libcxx libnotify libpulseaudio libxcb nspr nss pango stdenv.cc.cc systemd - ]; - - gitterDirectorySuffix = "opt/gitter"; - installPhase = '' mkdir -p $out/{bin,opt/gitter,share/pixmaps} mv ./opt/Gitter/linux64/* $out/opt/gitter - patchelf --debug --set-interpreter ${stdenv.cc.bintools.dynamicLinker} \ - --set-rpath "$out/${gitterDirectorySuffix}/lib:${libPath}" \ - $out/${gitterDirectorySuffix}/Gitter + ${doELFPatch "Gitter"} + ${doELFPatch "nacl_helper"} + ${doELFPatch "minidump_stackwalk"} + ${doELFPatch "nwjc"} + ${doELFPatch "chromedriver"} + ${doELFPatch "payload"} - patchelf --debug --set-rpath "$out/${gitterDirectorySuffix}/lib:${libPath}" \ + patchelf --set-rpath "$out/${gitterDirectorySuffix}/lib:${libPath}" \ $out/${gitterDirectorySuffix}/lib/libnw.so wrapProgram $out/${gitterDirectorySuffix}/Gitter --prefix LD_LIBRARY_PATH : ${libPath} From d047bb205905203f898b76389dcb594894dc2242 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 13 Jul 2018 17:58:55 -0700 Subject: [PATCH 04/10] [Linux] Fix gitter service --- dotfiles/config/systemd/user/gitter.service | 1 - 1 file changed, 1 deletion(-) diff --git a/dotfiles/config/systemd/user/gitter.service b/dotfiles/config/systemd/user/gitter.service index dfe54e37..e193e1b2 100644 --- a/dotfiles/config/systemd/user/gitter.service +++ b/dotfiles/config/systemd/user/gitter.service @@ -5,7 +5,6 @@ After=taffybar.service [Service] ExecStart=/usr/bin/env Gitter -ExecStart/usr/bin/env pkill Gitter Restart=always [Install] From 3a4380b5bf7a90face518292e95a99d9f990bf9c Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 14 Jul 2018 10:31:44 -0700 Subject: [PATCH 05/10] [NixOS] Use plasma instead of gnome --- nixos/configuration.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 539fa64c..c38aab28 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -246,9 +246,10 @@ in transmission-gtk ]; - environment.variables = { - GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"; - }; + # XXX: Plasma seems to set this + # environment.variables = { + # GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"; + # }; programs.gnupg.agent = { enable = true; enableSSHSupport = true; }; # Enabling zsh will clobber path because of the way it sets up /etc/zshenv @@ -278,7 +279,7 @@ in enable = true; layout = "us"; desktopManager = { - gnome3.enable = true; + plasma5.enable = true; default = "none"; }; windowManager = { From 0c894d113eaf6c29667d09dee599463fcf808936 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 14 Jul 2018 10:32:03 -0700 Subject: [PATCH 06/10] [NixOS] Add quassel --- nixos/configuration.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index c38aab28..5db97889 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -137,7 +137,9 @@ in kleopatra gitter google-chrome + hexchat + quassel keybase-gui-fixed kodi lxappearance @@ -201,6 +203,9 @@ in nodePackages.npm nodejs + # Rust + cargo + # Tools bazaar binutils From e2a4c891c12e001e3851ef4cfcf05020f9cfef11 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 14 Jul 2018 12:51:22 -0700 Subject: [PATCH 07/10] [Emacs] Add major mode blacklisting macro --- dotfiles/emacs.d/README.org | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index bc56184d..bb264fee 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -933,6 +933,26 @@ This was stolen from https://github.com/jwiegley/dot-emacs (imalison:disable-mode-hook nlinum-mode) (imalison:disable-mode-hook yas-minor-mode) #+END_SRC +** Add a blacklist to a major mode +Sometimes a major mode's syntax highlighting can take a really long time to load +in certain buffers. Usually you can just set a header to tell emacs not to run +the major mode, but for cases where you can't always edit the file ahead of time +this macro allows you to define a blacklist for your major mode that will +prevent the major mode from being enabled on that file. +#+begin_src emacs-lisp +(defmacro imalison:add-blacklist-to-major (major-mode-fn-symbol) + (let ((blacklist-var-symbol (imalison:concat-symbols major-mode-fn-symbol "-blacklist")) + (check-blacklist-symbol (imalison:concat-symbols major-mode-fn-symbol "-check-blacklist"))) + `(progn + (defvar ,blacklist-var-symbol nil) + (defun ,check-blacklist-symbol (mode-fn &rest args) + (unless (and (not (equal major-mode (quote ,major-mode-fn-symbol))) + (equal nil args) + (cl-loop for blacklist-regex in ,blacklist-var-symbol + thereis (string-match blacklist-regex (buffer-name)))) + (apply mode-fn args))) + (advice-add (quote ,major-mode-fn-symbol) :around (quote ,check-blacklist-symbol))))) +#+end_src ** Other The stuff in this section is pretty crusty. I don't think its used anywhere, but I keep it around just in case I need it. From 8a20d9376eb9cd5e46e9377e6303f9625affb798 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 14 Jul 2018 12:51:39 -0700 Subject: [PATCH 08/10] [Emacs] Blacklist all-packages in nix mode --- dotfiles/emacs.d/README.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index bb264fee..e1e90300 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -2581,6 +2581,10 @@ eval-last-sexp. *** nix #+BEGIN_SRC emacs-lisp (use-package nix-mode + :preface + (progn + (imalison:add-blacklist-to-major nix-mode) + (setq nix-mode-blacklist '("all-packages.nix"))) :config (progn (setq nix-indent-function 'nix-indent-line))) From fc1d81c33a384e2952cdc4683b8581ed75c8ad0e Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 14 Jul 2018 12:51:53 -0700 Subject: [PATCH 09/10] [Emacs] Don't use tcp for server mode --- dotfiles/emacs.d/README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index e1e90300..f947395f 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -1443,6 +1443,7 @@ Paradox is a package.el extension. I have no use for it now that I use straight. :demand t :config (progn + (setq server-use-tcp nil) (defvar imalison:default-server-file (imalison:join-paths user-emacs-directory "server" "server")) (defun imalison:main-emacs-server-name () @@ -1461,7 +1462,6 @@ The file server file for this emacs instance no longer exists.") (defun imalison:get-this-server-filepath () (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) (when (equal nil (server-running-p)) (server-start) (imalison:make-main-emacs-server)))) #+END_SRC From 46367f5b0d75c163375897cfc5a91720c0b7788e Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 14 Jul 2018 12:53:02 -0700 Subject: [PATCH 10/10] [Emacs] Add macro blacklisting highlight --- dotfiles/emacs.d/README.org | 1 + 1 file changed, 1 insertion(+) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index f947395f..5fcc54c3 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -64,6 +64,7 @@ think its pretty awesome! [[Copy/Yank String Functions][Copy String Functions]] + [[namedbuild][Named Build of Builder Macros]] ([[https://github.com/IvanMalison/emit#named-builder][README]]) and [[composemacros][A Compose Supporting Macros]] ([[https://github.com/IvanMalison/emit#compose][README]]) ++ [[Add a blacklist to a major mode]] ** Configuration of My Own Packages - [[term-projectile][term-projectile]] and [[term-manager][term-manager]] - [[org-projectile][org-projectile]]