Merge branch 'master' of github.com:IvanMalison/dotfiles

This commit is contained in:
Ivan Malison 2018-07-14 19:26:29 -07:00
commit 44718aeb57
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8
4 changed files with 117 additions and 8 deletions

View File

@ -4,7 +4,7 @@ Wants=taffybar.service
After=taffybar.service
[Service]
ExecStart=/usr/bin/env run_unity.sh gitter
ExecStart=/usr/bin/env Gitter
Restart=always
[Install]

View File

@ -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]]
@ -933,6 +934,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.
@ -1423,6 +1444,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 ()
@ -1441,7 +1463,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
@ -2561,6 +2582,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)))

View File

@ -1,5 +1,6 @@
{ config, pkgs, ... }:
let
gitter = with pkgs; callPackage ./gitter.nix { };
my-python-packages = python-packages: with python-packages; [
appdirs
requests
@ -134,8 +135,11 @@ in
emacs
firefox
kleopatra
gitter
google-chrome
hexchat
quassel
keybase-gui-fixed
kodi
lxappearance
@ -195,10 +199,18 @@ in
sbt
scala
# Node
nodePackages.npm
nodejs
# Rust
cargo
# Tools
bazaar
binutils
dfeet
dpkg
gcc
gdb
gitAndTools.git-sync
@ -214,6 +226,7 @@ in
ncdu
neofetch
pass
patchelf
plasma-workspace
powertop
python-with-my-packages
@ -238,9 +251,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
@ -270,7 +284,7 @@ in
enable = true;
layout = "us";
desktopManager = {
gnome3.enable = true;
plasma5.enable = true;
default = "none";
};
windowManager = {
@ -305,8 +319,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;

71
nixos/gitter.nix Normal file
View File

@ -0,0 +1,71 @@
{ 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 }:
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}";
src = fetchurl {
url = "https://update.gitter.im/linux64/${pname}_${version}_amd64.deb";
sha256 = "1gny9i2pywvczzrs93k8krqn6hwm6c2zg8yr3xmjqs3p88817wbi";
};
nativeBuildInputs = [ makeWrapper dpkg ];
unpackPhase = "dpkg -x $src .";
installPhase = ''
mkdir -p $out/{bin,opt/gitter,share/pixmaps}
mv ./opt/Gitter/linux64/* $out/opt/gitter
${doELFPatch "Gitter"}
${doELFPatch "nacl_helper"}
${doELFPatch "minidump_stackwalk"}
${doELFPatch "nwjc"}
${doELFPatch "chromedriver"}
${doELFPatch "payload"}
patchelf --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" ];
};
}