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

This commit is contained in:
Ivan Malison 2019-06-06 00:39:05 -07:00
commit cdb1afc6ab
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8
20 changed files with 135 additions and 116 deletions

View File

@ -0,0 +1,6 @@
let
pkgs = import <nixpkgs> { overlays = [
(import ./taffybar/overlay.nix) (import ../xmonad/overlay.nix)
]; };
source = pkgs.lib.sourceByRegex ./. ["taffybar.hs" "imalison-taffybar.cabal"];
in pkgs.haskellPackages.callCabal2nix "imalison-taffybar" source { }

View File

@ -30,7 +30,7 @@ executable imalison-taffybar
, hslogger
, process
, split
, taffybar
, taffybar>=3.2.0
, transformers
, xdg-basedir
, xmonad-contrib>=0.13

View File

@ -5,7 +5,7 @@
@define-color active-window-color @white;
@define-color urgent-window-color @taffy-blue;
@define-color font-color @white;
@define-color font-color @black;
@define-color menu-background-color @white;
@define-color menu-font-color @black;

@ -1 +1 @@
Subproject commit eb9f7b9f43898201237000b921d1224c47d7dac7
Subproject commit 397a85cbb712235624f402a3f1157a3c637f0aab

View File

@ -80,9 +80,9 @@ cpuCallback = do
(_, systemLoad, totalLoad) <- cpuLoad
return [totalLoad, systemLoad]
getFullWorkspaceNames :: X11Property [(WorkspaceIdx, String)]
getFullWorkspaceNames :: X11Property [(WorkspaceId, String)]
getFullWorkspaceNames = go <$> readAsListOfString Nothing "_NET_DESKTOP_FULL_NAMES"
where go = zip [WSIdx i | i <- [0..]]
where go = zip [WorkspaceId i | i <- [0..]]
workspaceNamesLabelSetter workspace =
fromMaybe "" . lookup (workspaceIdx workspace) <$>
@ -93,14 +93,16 @@ enableLogger logger level = do
saveGlobalLogger $ setLevel level logger
logDebug = do
global <- getLogger ""
saveGlobalLogger $ setLevel DEBUG global
logger3 <- getLogger "System.Taffybar"
saveGlobalLogger $ setLevel DEBUG logger3
logger <- getLogger "System.Taffybar.Widget.Generic.AutoSizeImage"
saveGlobalLogger $ setLevel DEBUG logger
logger2 <- getLogger "StatusNotifier.Tray"
saveGlobalLogger $ setLevel DEBUG logger2
workspacesLogger <- getLogger "System.Taffybar.Widget.Workspaces"
saveGlobalLogger $ setLevel WARNING workspacesLogger
-- workspacesLogger <- getLogger "System.Taffybar.Widget.Workspaces"
-- saveGlobalLogger $ setLevel WARNING workspacesLogger
-- logDebug
-- logM "What" WARNING "Why"
-- enableLogger "System.Taffybar.Widget.Util" DEBUG
@ -111,10 +113,11 @@ logDebug = do
cssFileByHostname =
[ ("uber-loaner", "uber-loaner.css")
, ("imalison-home", "taffybar.css")
, ("ivanm-dfinity-razr", "ivanm-dfinity-razr.css")
, ("ivanm-dfinity-razer", "ivanm-dfinity-razer.css")
]
main = do
-- logDebug
hostName <- getHostName
homeDirectory <- getHomeDirectory
cssFilePath <-
@ -140,9 +143,15 @@ main = do
, labelSetter = workspaceNamesLabelSetter
}
workspaces = workspacesNew myWorkspacesConfig
myClock =
textClockNewWith
defaultClockConfig
{ clockUpdateStrategy = RoundedTargetInterval 60 0.0
, clockFormatString = "%a %b %_d %I:%M %p"
}
fullEndWidgets =
map (>>= buildContentsBox)
[ textClockNewWith defaultClockConfig
[ myClock
, sniTrayNew
, cpuGraph
, memoryGraph
@ -155,10 +164,11 @@ main = do
map (>>= buildContentsBox)
[ batteryIconNew
, textBatteryNew "$percentage$%"
, textClockNewWith defaultClockConfig
, myClock
, sniTrayNew
, mpris2New
]
longLaptopWidgets =
longLaptopEndWidgets =
map (>>= buildContentsBox)
[ batteryIconNew
, textBatteryNew "$percentage$%"
@ -172,7 +182,7 @@ main = do
baseConfig =
defaultSimpleTaffyConfig
{ startWidgets =
workspaces : map (>>= buildContentsBox) [layout, windows]
workspaces : map (>>= buildContentsBox) [layout, windows]
, endWidgets = fullEndWidgets
, barPosition = Top
, barPadding = 0
@ -187,8 +197,8 @@ main = do
, ( "imalison-home"
, baseConfig { endWidgets = fullEndWidgets, barHeight = 42 }
)
, ( "ivanm-dfinity-razr"
, baseConfig { endWidgets = longLaptopWidgets, barHeight = 42 }
, ( "ivanm-dfinity-razer"
, baseConfig { endWidgets = shortLaptopEndWidgets, barHeight = 42 }
)
]
simpleTaffyConfig = selectedConfig

View File

@ -1,32 +1,11 @@
#!/usr/bin/env bash
function min {
[ $1 -le $2 ] && echo "$1" || echo "$2"
}
function get_exe_dir {
# XXX: This exists because calling in to stack is kind of slow with nix
# integration enabled, even when just using it to get a path.
if [ -e ./.cached-stack-install-path ]; then
cat .cached-stack-install-path
else
stack path --local-install-root
fi
}
SRC_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
EXE_NAME=imalison-xmonad
EXE_LOCATION=$(get_exe_dir)/bin/$EXE_NAME
output_file=$1; shift
if [ -e ./.cached-stack-install-path ]; then
last_built=$(stat -c '%Y' $EXE_LOCATION)
xmonad_modified=$(stat -c '%Y' ./xmonad.hs)
[ $last_built -lt $xmonad_modified ] && stack install
else
stack install
fi
cp -uf $EXE_LOCATION $output_file
cd "$SRC_DIR"
exe_location="$SRC_DIR/result/bin/imalison-xmonad"
nix-build
echo "$exe_location" "$output_file" > did_build
cp -f "$exe_location" "$output_file"

View File

@ -0,0 +1,6 @@
let
pkgs = import <nixpkgs> { overlays = [ (import ./overlay.nix) ]; };
source = pkgs.lib.sourceByRegex ./. [
"xmonad.hs" "imalison-xmonad.cabal" "PagerHints.hs" "LICENSE"
];
in pkgs.haskellPackages.callCabal2nix "imalison-xmonad" source { }

View File

@ -29,6 +29,5 @@ executable imalison-xmonad
, xmonad-contrib>=0.13
, xmonad>=0.13
hs-source-dirs: .
src
other-modules: PagerHints
other-modules: PagerHints
default-language: Haskell2010

View File

@ -0,0 +1,12 @@
_: pkgs: rec {
haskellPackages = pkgs.haskellPackages.override (old: {
overrides = pkgs.lib.composeExtensions (old.overrides or (_: _: {})) (self: super: rec {
xmonad = super.xmonad.overrideAttrs (_: {
src = fetchGit ./xmonad;
});
xmonad-contrib = super.xmonad-contrib.overrideAttrs (_: {
src = fetchGit ./xmonad-contrib;
});
});
});
}

View File

@ -1 +0,0 @@
../taffybar/taffybar

@ -1 +1 @@
Subproject commit 9c0eb36a4a76963a5579f95566f73475579527dc
Subproject commit f10399096794addfd121f014b687a0298354f410

View File

@ -213,7 +213,6 @@ emacsCommand = "emacsclient -c"
htopCommand = "termite -e htop -t htop"
transmissionCommand = "transmission-gtk"
volumeCommand = "pavucontrol"
taffybarCommand = "restart_taffybar.sh"
-- Startup hook
@ -341,11 +340,13 @@ myTabConfig =
rename newName = RN.renamed [RN.Replace newName]
layoutsStart layout = (layout, [Layout layout])
(|||!) (joined, layouts) newLayout =
(joined ||| newLayout, layouts ++ [Layout newLayout])
layoutInfo =
layoutsStart (rename "Columns" $ multiCol [1, 1] 2 0.01 (-0.5)) |||!
layoutsStart (rename "4 Columns" $ (multiCol [1, 1, 1] 2 0.0 (-0.5))) |||!
rename "3 Columns" (multiCol [1, 1] 2 0.01 (-0.5)) |||!
rename "Large Main" (Tall 1 (3 / 100) (3 / 4)) |||!
rename "2 Columns" (Tall 1 (3 / 100) (1 / 2)) |||!
Accordion |||! simpleCross |||! myTabbed

View File

@ -1210,21 +1210,7 @@ Disabling line numbers because they are slow as fuck.
#+END_SRC
*** Handle xrefs annoying dedicated window garbage
#+BEGIN_SRC emacs-lisp
(use-package xref
:config
(defun xref--show-pos-in-buf (pos buf select)
(let ((xref-buf (current-buffer))
win)
(with-selected-window
(display-buffer buf)
(xref--goto-char pos)
(run-hooks 'xref-after-jump-hook)
(let ((buf (current-buffer)))
(setq win (selected-window))
(with-current-buffer xref-buf
(setq-local other-window-scroll-buffer buf))))
(when select
(select-window win)))))
(use-package xref)
#+END_SRC
** Fill Setup
Get rid of nags about requiring setences to end with two spaces.
@ -2121,6 +2107,11 @@ I don't use auto-complete at all, so I have set up a hook to automatically disab
(use-package unfill
:bind ("M-q" . unfill-toggle))
#+END_SRC
** format-all
#+begin_src emacs-lisp
(use-package format-all
:commands format-all-buffer)
#+end_src
** cliphist
#+BEGIN_SRC emacs-lisp
(use-package cliphist
@ -2603,7 +2594,7 @@ eval-last-sexp.
:preface
(progn
(imalison:add-blacklist-to-major nix-mode)
(setq nix-mode-blacklist '("all-packages.nix")))
(setq nix-mode-blacklist '("all-packages.nix" "hackage-packages.nix")))
:config
(progn
(setq nix-indent-function 'nix-indent-line)))
@ -2824,10 +2815,10 @@ The following is taken from [[https://github.com/syl20bnr/spacemacs/blob/a650877
;; Better import handling
haskell-process-suggest-remove-import-lines t
haskell-process-auto-import-loaded-modules nil
;; Disable haskell-stylish-on-save, as it breaks flycheck highlighting.
;; NOTE: May not be true anymore - taksuyu 2015-10-06
haskell-stylish-on-save nil
haskell-tags-on-save nil
haskell-tags-on-save t
haskell-mode-stylish-haskell-path "brittany"
haskell-mode-stylish-haskell-args '("-")
haskell-indent-offset 2)
(require 'flycheck)
(delq 'haskell-stack-ghc flycheck-checkers)
@ -2836,6 +2827,7 @@ The following is taken from [[https://github.com/syl20bnr/spacemacs/blob/a650877
**** haskell-ide-engine
#+BEGIN_SRC emacs-lisp
(use-package lsp-haskell
:disabled t
:config
(add-hook 'haskell-mode-hook 'lsp))
#+END_SRC
@ -2843,6 +2835,7 @@ The following is taken from [[https://github.com/syl20bnr/spacemacs/blob/a650877
Intero seems to be causing hangs, so it has been disabled
#+BEGIN_SRC emacs-lisp
(use-package intero
:disabled t
:after haskell-mode
:config
(progn
@ -2852,6 +2845,7 @@ Intero seems to be causing hangs, so it has been disabled
**** hindent
#+BEGIN_SRC emacs-lisp
(use-package hindent
:disabled t
:after haskell-mode
:bind (:map hindent-mode-map
("C-c d" . hindent-reformat-decl))
@ -3914,7 +3908,9 @@ I've disabled magithub because it causes magit to be super slow
:config
(progn
(setq github-search-get-target-directory-for-repo-function
'imalison:get-projects-directory-target-from-repo)))
'imalison:get-projects-directory-target-from-repo
;; See https://github.com/sigma/gh.el/issues/102
gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")))
#+END_SRC
*** github-clone
#+BEGIN_SRC emacs-lisp
@ -4306,6 +4302,12 @@ I had to disable this mode because something that it does messes with coding set
(add-to-list 'editorconfig-exclude-modes '(org-mode))
(editorconfig-mode 1)))
#+END_SRC
** direnv
#+begin_src emacs-lisp
(use-package direnv
:config
(direnv-mode +1))
#+end_src
** dtrt-indent
#+BEGIN_SRC emacs-lisp
(use-package dtrt-indent

View File

@ -6,7 +6,7 @@ random_paper() {
wallpaper() {
local target_paper=${1:-"$(random_paper)"}
feh --bg-center $target_paper --bg-scale "$WALLPAPER_DIR"transparent1x1.png --bg-center $target_paper
feh --bg-center $target_paper --bg-center $target_paper
}
wallpaper_timer() {

View File

@ -1,7 +1,5 @@
{ config, pkgs, options, ... }:
let
all-hies = import (fetchTarball "https://github.com/infinisil/all-hies/tarball/master") {};
my-overlays = import ./overlays.nix;
my-python-packages = python-packages: with python-packages; [
appdirs
ipdb
@ -17,10 +15,27 @@ let
virtualenvwrapper
];
python-with-my-packages = pkgs.python3.withPackages my-python-packages;
taffySource = pkgs.lib.sourceByRegex ../dotfiles/config/taffybar [
"taffybar.hs" "imalison-taffybar.cabal"
];
xmonadSource = pkgs.lib.sourceByRegex ../dotfiles/config/xmonad [
"xmonad.hs" "imalison-xmonad.cabal" "PagerHints.hs" "LICENSE"
];
notifications-tray-icon-source = pkgs.fetchFromGitHub {
owner = "IvanMalison";
repo = "notifications-tray-icon";
rev = "f28288849a39feec8972a4181ce18ccdde6cc483";
sha256 = "11r95m316x93bs1dj0bvas8adpd0xgql2jz8a8dnzv0fv4mw7aj4";
};
ntiOverlay = (import (notifications-tray-icon-source.outPath + "/overlay.nix"));
ntiHaskellPackages = (ntiOverlay pkgs pkgs).haskellPackages;
in
{
nixpkgs.overlays = [ my-overlays ];
# XXX: This ensures that all nix tools pick up the overlays that are set here
nixpkgs.overlays = [
(import ./overlays.nix)
(import ../dotfiles/config/taffybar/taffybar/overlay.nix)
(import ../dotfiles/config/xmonad/overlay.nix)
];
# Allow all the things
nixpkgs.config.allowUnfree = true;
@ -73,6 +88,7 @@ in
# Applications
calibre
gnome3.cheese
dfeet
discord
emacs
@ -106,8 +122,15 @@ in
gnome-breeze
# Desktop
# haskellPackages.status-notifier-item
(haskellPackages.callCabal2nix "imalison-taffybar" taffySource { })
(haskellPackages.callCabal2nix "imalison-xmonad" xmonadSource { })
(ntiHaskellPackages.callCabal2nix "notifications-tray-icon" notifications-tray-icon-source { })
haskellPackages.gtk-sni-tray
haskellPackages.status-notifier-item
haskellPackages.xmonad
autorandr
betterlockscreen
blueman
clipit
compton
@ -118,6 +141,7 @@ in
lxqt.lxqt-powermanagement
networkmanagerapplet
customizable-notify-osd
pasystray-appindicator
pinentry
pommed_light
@ -148,7 +172,6 @@ in
ghc
stack
haskellPackages.hasktags
# haskell.compiler.ghc863
# Scala
sbt
@ -171,6 +194,7 @@ in
# Tools
automake
bazaar
bind
binutils
dex
direnv
@ -180,27 +204,32 @@ in
file
gcc
gdb
gitAndTools.git-sync
gitAndTools.git-crypt
gitAndTools.git-fame
gitAndTools.git-sync
gitAndTools.hub
gitFull
glxinfo
gnumake
gnupg
gparted
htop
inotify-tools
ispell
jq
mercurial
networkmanager-openvpn
networkmanager_strongswan
ncdu
neofetch
openvpn
parallel
pass
patchelf
pciutils
plasma-workspace
powertop
prometheus_2
pscircle
python-with-my-packages
qt5.qttools
@ -229,6 +258,7 @@ in
# environment.variables = {
# GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache";
# };
# Enabling zsh will clobber path because of the way it sets up /etc/zshenv
# programs.zsh.enable = true;
# Instead we just make sure to source profile from zsh
@ -242,7 +272,8 @@ in
programs.gnupg.agent = { enable = true; enableSSHSupport = true; };
programs.adb.enable = true;
services.acpid.enable = true;
services.tlp.enable = true;
services.acpid.enable = false;
services.openssh.enable = true;

View File

@ -4,6 +4,6 @@
gimp
android-studio
texlive.combined.scheme-full
tor
];
boot.extraModulePackages = with pkgs; [ xboxdrv ];
}

View File

@ -7,6 +7,7 @@
imports =
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
../configuration.nix
../extra.nix
../dfinity.nix
];
@ -31,9 +32,21 @@
fsType = "vfat";
};
systemd.services.resume-fix = {
description = "Fixes acpi immediate resume after suspend";
wantedBy = [ "multi-user.target" "post-resume.target" ];
after = [ "multi-user.target" "post-resume.target" ];
script = ''
if ${pkgs.gnugrep}/bin/grep -q '\bXHC\b.*\benabled\b' /proc/acpi/wakeup; then
echo XHC > /proc/acpi/wakeup
fi
'';
serviceConfig.Type = "oneshot";
};
swapDevices = [ ];
networking.hostName = "ivanm-dfinity-razr";
networking.hostName = "ivanm-dfinity-razer";
nix.maxJobs = lib.mkDefault 12;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";

View File

@ -1,39 +0,0 @@
#!/usr/bin/env bash
function brew_for_multiple_users() {
sudo chgrp -R admin /usr/local
sudo chmod -R g+w /usr/local
sudo chgrp -R admin /Library/Caches/Homebrew
sudo chmod -R g+w /Library/Caches/Homebrew
}
function osx() {
xcode-select --install
hash brew &>/dev/null && echo "brew found" || ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew_for_multiple_users
brew doctor
brew update
brew install git
brew install python
sudo easy_install pip
}
function go() {
git clone https://github.com/IvanMalison/dotfiles.git --recursive
cd dotfiles
sudo pip install invoke
invoke setup
}
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
case `uname` in
'Darwin')
osx
;;
'Linux')
debian
;;
esac
go