From 13f6d61d13291fbc8dbcf6ff9e16eaf8181c79af Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 25 May 2019 21:13:44 -0700 Subject: [PATCH 01/23] Fix laptop hostname --- .../taffybar/{ivanm-dfinity-razr.css => ivanm-dfinity-razer.css} | 0 dotfiles/xkb/keymap/{ivanm-dfinity-razr => ivanm-dfinity-razer} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename dotfiles/config/taffybar/{ivanm-dfinity-razr.css => ivanm-dfinity-razer.css} (100%) rename dotfiles/xkb/keymap/{ivanm-dfinity-razr => ivanm-dfinity-razer} (100%) diff --git a/dotfiles/config/taffybar/ivanm-dfinity-razr.css b/dotfiles/config/taffybar/ivanm-dfinity-razer.css similarity index 100% rename from dotfiles/config/taffybar/ivanm-dfinity-razr.css rename to dotfiles/config/taffybar/ivanm-dfinity-razer.css diff --git a/dotfiles/xkb/keymap/ivanm-dfinity-razr b/dotfiles/xkb/keymap/ivanm-dfinity-razer similarity index 100% rename from dotfiles/xkb/keymap/ivanm-dfinity-razr rename to dotfiles/xkb/keymap/ivanm-dfinity-razer From 23bc2100ed9a2901472e6881c0aacb99248e8613 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 25 May 2019 21:18:23 -0700 Subject: [PATCH 02/23] [NixOS] A bunch of tweaks --- nixos/configuration.nix | 7 ++++++- nixos/extra.nix | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index ecc0915b..9039b4bc 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -108,6 +108,7 @@ in # Desktop # haskellPackages.status-notifier-item autorandr + betterlockscreen blueman clipit compton @@ -187,6 +188,7 @@ in glxinfo gnumake gnupg + gparted htop inotify-tools ispell @@ -196,11 +198,13 @@ in ncdu neofetch openvpn + parallel pass patchelf pciutils plasma-workspace powertop + prometheus_2 pscircle python-with-my-packages qt5.qttools @@ -242,7 +246,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; diff --git a/nixos/extra.nix b/nixos/extra.nix index 9ff007a7..d155ad17 100644 --- a/nixos/extra.nix +++ b/nixos/extra.nix @@ -4,6 +4,6 @@ gimp android-studio texlive.combined.scheme-full + tor ]; - boot.extraModulePackages = with pkgs; [ xboxdrv ]; } From 1088dcfe7839247a57f256950d4a3df24a5bead2 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 25 May 2019 21:18:51 -0700 Subject: [PATCH 03/23] [NixOS] More hostname fixing --- nixos/machines/dfinity-blade15.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/machines/dfinity-blade15.nix b/nixos/machines/dfinity-blade15.nix index 8383f8e3..35f03b96 100644 --- a/nixos/machines/dfinity-blade15.nix +++ b/nixos/machines/dfinity-blade15.nix @@ -7,6 +7,7 @@ imports = [ ../configuration.nix + ../extra.nix ../dfinity.nix ]; @@ -33,7 +34,7 @@ swapDevices = [ ]; - networking.hostName = "ivanm-dfinity-razr"; + networking.hostName = "ivanm-dfinity-razer"; nix.maxJobs = lib.mkDefault 12; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; From c845f548549c943061c08fa79d8ed6f784dbb0db Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 25 May 2019 21:19:41 -0700 Subject: [PATCH 04/23] [Emacs] DFINITY haskell tweaks --- dotfiles/emacs.d/README.org | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index ac560e77..d35be186 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -2821,10 +2821,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) @@ -2833,6 +2833,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 @@ -2840,6 +2841,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 @@ -2849,6 +2851,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)) From 9043df745339f65132fcf99ef0f00bb1a32798a6 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 25 May 2019 21:21:43 -0700 Subject: [PATCH 05/23] [taffybar] Hostname changes --- dotfiles/config/taffybar/taffybar.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dotfiles/config/taffybar/taffybar.hs b/dotfiles/config/taffybar/taffybar.hs index dfd84388..5b310a50 100644 --- a/dotfiles/config/taffybar/taffybar.hs +++ b/dotfiles/config/taffybar/taffybar.hs @@ -111,7 +111,7 @@ 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 @@ -158,7 +158,7 @@ main = do , textClockNewWith defaultClockConfig , sniTrayNew ] - longLaptopWidgets = + longLaptopEndWidgets = map (>>= buildContentsBox) [ batteryIconNew , textBatteryNew "$percentage$%" @@ -187,8 +187,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 From 373e258a029564554c8cff2c9aeb29f49c630e52 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 25 May 2019 21:22:06 -0700 Subject: [PATCH 06/23] [Emacs] Get rid of broken xref hack --- dotfiles/emacs.d/README.org | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index d35be186..490923d1 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -1206,21 +1206,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. From 591ff5bda50565f0dcad535bf565dbdd6645485c Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 25 May 2019 21:22:24 -0700 Subject: [PATCH 07/23] [Emacs] Add direnv --- dotfiles/emacs.d/README.org | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 490923d1..40f9a9f2 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -4292,6 +4292,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 From 610433eaf385c8768f18415eb53e9af7950e14db Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 25 May 2019 21:22:51 -0700 Subject: [PATCH 08/23] [Emacs] Add format-all --- dotfiles/emacs.d/README.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 40f9a9f2..81a3d0a4 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -2104,6 +2104,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 From a23accd7d4aab7b8d63f069b65fac9ef6a1ff7b0 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 25 May 2019 21:24:19 -0700 Subject: [PATCH 09/23] [Emacs] Set gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3" --- dotfiles/emacs.d/README.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 81a3d0a4..f02de549 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -3905,7 +3905,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 From 672b40c3eeb7da84daa31ddd4fb1ac95f00712e2 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Mon, 27 May 2019 10:15:47 -0700 Subject: [PATCH 10/23] [Linux] Set wallpaper on all desktops --- dotfiles/lib/shellenv/wallpaper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotfiles/lib/shellenv/wallpaper.sh b/dotfiles/lib/shellenv/wallpaper.sh index a6a6ff4b..64099d93 100644 --- a/dotfiles/lib/shellenv/wallpaper.sh +++ b/dotfiles/lib/shellenv/wallpaper.sh @@ -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() { From 263108e92e67702d342ed9fd424e9f4640ddcdf5 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sun, 2 Jun 2019 11:01:31 -0700 Subject: [PATCH 11/23] [NixOS] Add service to fix immediate resume after suspend on blade --- nixos/machines/dfinity-blade15.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nixos/machines/dfinity-blade15.nix b/nixos/machines/dfinity-blade15.nix index 35f03b96..6cc4818a 100644 --- a/nixos/machines/dfinity-blade15.nix +++ b/nixos/machines/dfinity-blade15.nix @@ -32,6 +32,18 @@ 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-razer"; From d8009b4866547c800dc51abc69b4063f23548a73 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sun, 2 Jun 2019 13:14:01 -0700 Subject: [PATCH 12/23] Remove start.sh --- start.sh | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100755 start.sh diff --git a/start.sh b/start.sh deleted file mode 100755 index c2fba792..00000000 --- a/start.sh +++ /dev/null @@ -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 From c4bc73e45bcba94c7122027f162490ea2d2f3f98 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sun, 2 Jun 2019 22:24:19 -0700 Subject: [PATCH 13/23] [NixOS] Build taffybar and xmonad with nix instead of stack --- dotfiles/config/taffybar/taffybar | 2 +- dotfiles/config/xmonad/overlay.nix | 12 ++++++++++++ nixos/configuration.nix | 16 ++++++++++++---- 3 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 dotfiles/config/xmonad/overlay.nix diff --git a/dotfiles/config/taffybar/taffybar b/dotfiles/config/taffybar/taffybar index eb9f7b9f..07656d70 160000 --- a/dotfiles/config/taffybar/taffybar +++ b/dotfiles/config/taffybar/taffybar @@ -1 +1 @@ -Subproject commit eb9f7b9f43898201237000b921d1224c47d7dac7 +Subproject commit 07656d70f6bf59a4d1355243f595805b9c0a25df diff --git a/dotfiles/config/xmonad/overlay.nix b/dotfiles/config/xmonad/overlay.nix new file mode 100644 index 00000000..1f1cf24e --- /dev/null +++ b/dotfiles/config/xmonad/overlay.nix @@ -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; + }); + }); + }); +} diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 9039b4bc..7361d44b 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -1,7 +1,6 @@ { 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 +16,17 @@ 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 = ../dotfiles/config/xmonad; 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; @@ -106,7 +112,9 @@ in gnome-breeze # Desktop - # haskellPackages.status-notifier-item + (haskellPackages.callCabal2nix "imalison-taffybar" taffySource { }) + (haskellPackages.callCabal2nix "imalison-xmonad" xmonadSource { }) + haskellPackages.status-notifier-item autorandr betterlockscreen blueman From 6c7b4a80b73a6421c4d91cdf4c62358425bb2221 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sun, 2 Jun 2019 22:25:08 -0700 Subject: [PATCH 14/23] [NixOS] Add gnome cheese --- nixos/configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 7361d44b..a837d91e 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -79,6 +79,7 @@ in # Applications calibre + gnome3.cheese dfeet discord emacs From 9bc20005cd31d8311f4aab17b1a5dc36c846863c Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sun, 2 Jun 2019 22:48:29 -0700 Subject: [PATCH 15/23] [XMonad] Prepare for switching to nix build for recompilation of xmonad --- dotfiles/config/xmonad/{src => }/PagerHints.hs | 0 dotfiles/config/xmonad/default.nix | 6 ++++++ dotfiles/config/xmonad/taffybar | 1 - dotfiles/config/xmonad/xmonad-contrib | 2 +- dotfiles/config/xmonad/xmonad.hs | 4 +++- 5 files changed, 10 insertions(+), 3 deletions(-) rename dotfiles/config/xmonad/{src => }/PagerHints.hs (100%) create mode 100644 dotfiles/config/xmonad/default.nix delete mode 120000 dotfiles/config/xmonad/taffybar diff --git a/dotfiles/config/xmonad/src/PagerHints.hs b/dotfiles/config/xmonad/PagerHints.hs similarity index 100% rename from dotfiles/config/xmonad/src/PagerHints.hs rename to dotfiles/config/xmonad/PagerHints.hs diff --git a/dotfiles/config/xmonad/default.nix b/dotfiles/config/xmonad/default.nix new file mode 100644 index 00000000..bd64f85a --- /dev/null +++ b/dotfiles/config/xmonad/default.nix @@ -0,0 +1,6 @@ +let + pkgs = import { overlays = [ (import ./overlay.nix) ]; }; + source = pkgs.lib.sourceByRegex ./. [ + "xmonad.hs" "imalison-xmonad.cabal" "PagerHints.hs" "LICENSE" + ]; +in pkgs.haskellPackages.callCabal2nix "imalison-xmonad" source { } diff --git a/dotfiles/config/xmonad/taffybar b/dotfiles/config/xmonad/taffybar deleted file mode 120000 index 53a74d2a..00000000 --- a/dotfiles/config/xmonad/taffybar +++ /dev/null @@ -1 +0,0 @@ -../taffybar/taffybar \ No newline at end of file diff --git a/dotfiles/config/xmonad/xmonad-contrib b/dotfiles/config/xmonad/xmonad-contrib index 9c0eb36a..f1039909 160000 --- a/dotfiles/config/xmonad/xmonad-contrib +++ b/dotfiles/config/xmonad/xmonad-contrib @@ -1 +1 @@ -Subproject commit 9c0eb36a4a76963a5579f95566f73475579527dc +Subproject commit f10399096794addfd121f014b687a0298354f410 diff --git a/dotfiles/config/xmonad/xmonad.hs b/dotfiles/config/xmonad/xmonad.hs index 2da0605d..67beee97 100644 --- a/dotfiles/config/xmonad/xmonad.hs +++ b/dotfiles/config/xmonad/xmonad.hs @@ -341,11 +341,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 From 7d52d5c8b71f8f1a58d0636c0009cae485424707 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sun, 2 Jun 2019 23:32:17 -0700 Subject: [PATCH 16/23] [NixOS] Explicitly depend on all needed source files for xmonad --- nixos/configuration.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index a837d91e..73b59776 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -19,7 +19,9 @@ let taffySource = pkgs.lib.sourceByRegex ../dotfiles/config/taffybar [ "taffybar.hs" "imalison-taffybar.cabal" ]; - xmonadSource = ../dotfiles/config/xmonad; + xmonadSource = pkgs.lib.sourceByRegex ../dotfiles/config/xmonad [ + "xmonad.hs" "imalison-xmonad.cabal" "PagerHints.hs" "LICENSE" + ]; in { nixpkgs.overlays = [ From 52edf84a628cedc0a343075a1e238f7a81bcc971 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Mon, 3 Jun 2019 02:01:49 -0700 Subject: [PATCH 17/23] [NixOS] Add notifications tray icon --- nixos/configuration.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 73b59776..2a23f89e 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -1,6 +1,5 @@ { config, pkgs, options, ... }: let - all-hies = import (fetchTarball "https://github.com/infinisil/all-hies/tarball/master") {}; my-python-packages = python-packages: with python-packages; [ appdirs ipdb @@ -22,6 +21,15 @@ let 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 = "6f3b8da1d32dd655c5e484940cfb9d7e392f3235"; + sha256 = "0ag4gqiihgyiw3dfinz7a1c1dcnj30bs62f63zyk11fs37ys93rz"; + }; + ntiHaskellPackages = + (import (notifications-tray-icon-source.outPath + "/overlay.nix")) + (import /home/imalison/Projects/nixpkgs {}); in { nixpkgs.overlays = [ @@ -118,6 +126,8 @@ in (haskellPackages.callCabal2nix "imalison-taffybar" taffySource { }) (haskellPackages.callCabal2nix "imalison-xmonad" xmonadSource { }) haskellPackages.status-notifier-item + haskellPackages.xmonad + (ntiHaskellPackages.callCabal2nix "notifications-tray-icon" notifications-tray-icon-source { }) autorandr betterlockscreen blueman @@ -130,6 +140,7 @@ in lxqt.lxqt-powermanagement networkmanagerapplet customizable-notify-osd + pasystray-appindicator pinentry pommed_light @@ -160,7 +171,6 @@ in ghc stack haskellPackages.hasktags - # haskell.compiler.ghc863 # Scala sbt @@ -244,6 +254,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 From 15b899c60558419d6404ebad48c1af72aea47611 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Wed, 5 Jun 2019 00:35:47 -0700 Subject: [PATCH 18/23] [NixOS] Updates to haskell compilation --- .../config/taffybar/imalison-taffybar.cabal | 2 +- .../config/taffybar/ivanm-dfinity-razer.css | 2 +- dotfiles/config/taffybar/taffybar | 2 +- dotfiles/config/taffybar/taffybar.hs | 15 ++++++++++++--- nixos/configuration.nix | 17 ++++++++++------- 5 files changed, 25 insertions(+), 13 deletions(-) diff --git a/dotfiles/config/taffybar/imalison-taffybar.cabal b/dotfiles/config/taffybar/imalison-taffybar.cabal index 93976d70..b555f3bc 100644 --- a/dotfiles/config/taffybar/imalison-taffybar.cabal +++ b/dotfiles/config/taffybar/imalison-taffybar.cabal @@ -30,7 +30,7 @@ executable imalison-taffybar , hslogger , process , split - , taffybar + , taffybar>=3.2.0 , transformers , xdg-basedir , xmonad-contrib>=0.13 diff --git a/dotfiles/config/taffybar/ivanm-dfinity-razer.css b/dotfiles/config/taffybar/ivanm-dfinity-razer.css index 955b43f3..a75e7023 100644 --- a/dotfiles/config/taffybar/ivanm-dfinity-razer.css +++ b/dotfiles/config/taffybar/ivanm-dfinity-razer.css @@ -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; diff --git a/dotfiles/config/taffybar/taffybar b/dotfiles/config/taffybar/taffybar index 07656d70..811068a2 160000 --- a/dotfiles/config/taffybar/taffybar +++ b/dotfiles/config/taffybar/taffybar @@ -1 +1 @@ -Subproject commit 07656d70f6bf59a4d1355243f595805b9c0a25df +Subproject commit 811068a21758ac70f66583e8fc07fa7189c6dc9a diff --git a/dotfiles/config/taffybar/taffybar.hs b/dotfiles/config/taffybar/taffybar.hs index 5b310a50..eceaa62e 100644 --- a/dotfiles/config/taffybar/taffybar.hs +++ b/dotfiles/config/taffybar/taffybar.hs @@ -93,6 +93,8 @@ 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" @@ -140,9 +142,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,8 +163,9 @@ main = do map (>>= buildContentsBox) [ batteryIconNew , textBatteryNew "$percentage$%" - , textClockNewWith defaultClockConfig + , myClock , sniTrayNew + , mpris2New ] longLaptopEndWidgets = map (>>= buildContentsBox) @@ -172,7 +181,7 @@ main = do baseConfig = defaultSimpleTaffyConfig { startWidgets = - workspaces : map (>>= buildContentsBox) [layout, windows] + workspaces : map (>>= buildContentsBox) [layout, windows] , endWidgets = fullEndWidgets , barPosition = Top , barPadding = 0 diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 2a23f89e..a73fe7ca 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -24,12 +24,11 @@ let notifications-tray-icon-source = pkgs.fetchFromGitHub { owner = "IvanMalison"; repo = "notifications-tray-icon"; - rev = "6f3b8da1d32dd655c5e484940cfb9d7e392f3235"; - sha256 = "0ag4gqiihgyiw3dfinz7a1c1dcnj30bs62f63zyk11fs37ys93rz"; + rev = "f28288849a39feec8972a4181ce18ccdde6cc483"; + sha256 = "11r95m316x93bs1dj0bvas8adpd0xgql2jz8a8dnzv0fv4mw7aj4"; }; - ntiHaskellPackages = - (import (notifications-tray-icon-source.outPath + "/overlay.nix")) - (import /home/imalison/Projects/nixpkgs {}); + ntiOverlay = (import (notifications-tray-icon-source.outPath + "/overlay.nix")); + ntiHaskellPackages = (ntiOverlay pkgs pkgs).haskellPackages; in { nixpkgs.overlays = [ @@ -125,9 +124,10 @@ in # Desktop (haskellPackages.callCabal2nix "imalison-taffybar" taffySource { }) (haskellPackages.callCabal2nix "imalison-xmonad" xmonadSource { }) + (ntiHaskellPackages.callCabal2nix "notifications-tray-icon" notifications-tray-icon-source { }) haskellPackages.status-notifier-item haskellPackages.xmonad - (ntiHaskellPackages.callCabal2nix "notifications-tray-icon" notifications-tray-icon-source { }) + autorandr betterlockscreen blueman @@ -193,6 +193,7 @@ in # Tools automake bazaar + bind binutils dex direnv @@ -202,8 +203,9 @@ in file gcc gdb - gitAndTools.git-sync + gitAndTools.git-crypt gitAndTools.git-fame + gitAndTools.git-sync gitAndTools.hub gitFull glxinfo @@ -216,6 +218,7 @@ in jq mercurial networkmanager-openvpn + networkmanager_strongswan ncdu neofetch openvpn From 20238004df9f568eb0d4bf15ed6105fb4e28d77d Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 6 Jun 2019 00:30:15 -0700 Subject: [PATCH 19/23] [NixOS] Add gtk-sni-tray --- nixos/configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index a73fe7ca..fa30e586 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -125,6 +125,7 @@ in (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 From f2868c0ac1e2e9085c9de6df78e6cc6dd16e85ae Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 6 Jun 2019 00:30:36 -0700 Subject: [PATCH 20/23] [Emacs] No nix-mode on haskell-packages.nix --- 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 f02de549..cea518d1 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -2591,7 +2591,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))) From a1338e63f11802182697b3e0fc0ae0731fdfaf16 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 6 Jun 2019 00:31:10 -0700 Subject: [PATCH 21/23] [taffybar] Bump version --- dotfiles/config/taffybar/taffybar | 2 +- dotfiles/config/taffybar/taffybar.hs | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dotfiles/config/taffybar/taffybar b/dotfiles/config/taffybar/taffybar index 811068a2..397a85cb 160000 --- a/dotfiles/config/taffybar/taffybar +++ b/dotfiles/config/taffybar/taffybar @@ -1 +1 @@ -Subproject commit 811068a21758ac70f66583e8fc07fa7189c6dc9a +Subproject commit 397a85cbb712235624f402a3f1157a3c637f0aab diff --git a/dotfiles/config/taffybar/taffybar.hs b/dotfiles/config/taffybar/taffybar.hs index eceaa62e..63c48122 100644 --- a/dotfiles/config/taffybar/taffybar.hs +++ b/dotfiles/config/taffybar/taffybar.hs @@ -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) <$> @@ -101,8 +101,8 @@ logDebug = do 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 @@ -117,6 +117,7 @@ cssFileByHostname = ] main = do + -- logDebug hostName <- getHostName homeDirectory <- getHomeDirectory cssFilePath <- From 34e1eecd6b5a91e8b39f43fb758d8021541fa295 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 6 Jun 2019 00:34:29 -0700 Subject: [PATCH 22/23] [XMonad] Use nix for xmonad build script --- dotfiles/config/xmonad/build | 31 ++++---------------- dotfiles/config/xmonad/imalison-xmonad.cabal | 3 +- dotfiles/config/xmonad/xmonad.hs | 1 - 3 files changed, 6 insertions(+), 29 deletions(-) diff --git a/dotfiles/config/xmonad/build b/dotfiles/config/xmonad/build index b1282a26..e0dc98aa 100755 --- a/dotfiles/config/xmonad/build +++ b/dotfiles/config/xmonad/build @@ -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" diff --git a/dotfiles/config/xmonad/imalison-xmonad.cabal b/dotfiles/config/xmonad/imalison-xmonad.cabal index 4469c3c0..29cd7a81 100644 --- a/dotfiles/config/xmonad/imalison-xmonad.cabal +++ b/dotfiles/config/xmonad/imalison-xmonad.cabal @@ -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 diff --git a/dotfiles/config/xmonad/xmonad.hs b/dotfiles/config/xmonad/xmonad.hs index 67beee97..8e31c8b1 100644 --- a/dotfiles/config/xmonad/xmonad.hs +++ b/dotfiles/config/xmonad/xmonad.hs @@ -213,7 +213,6 @@ emacsCommand = "emacsclient -c" htopCommand = "termite -e htop -t htop" transmissionCommand = "transmission-gtk" volumeCommand = "pavucontrol" -taffybarCommand = "restart_taffybar.sh" -- Startup hook From fd3970962a626d7f18bf54073ddcb3558fb16988 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 6 Jun 2019 00:35:17 -0700 Subject: [PATCH 23/23] [taffybar] Add default.nix --- dotfiles/config/taffybar/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 dotfiles/config/taffybar/default.nix diff --git a/dotfiles/config/taffybar/default.nix b/dotfiles/config/taffybar/default.nix new file mode 100644 index 00000000..c743547c --- /dev/null +++ b/dotfiles/config/taffybar/default.nix @@ -0,0 +1,6 @@ +let + pkgs = import { 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 { }