diff --git a/dotfiles/config/taffybar/cabal.project b/dotfiles/config/taffybar/cabal.project new file mode 100644 index 00000000..a066d60c --- /dev/null +++ b/dotfiles/config/taffybar/cabal.project @@ -0,0 +1 @@ +packages: . taffybar/ diff --git a/dotfiles/config/taffybar/imalison-taffybar.cabal b/dotfiles/config/taffybar/imalison-taffybar.cabal index b555f3bc..4545bae1 100644 --- a/dotfiles/config/taffybar/imalison-taffybar.cabal +++ b/dotfiles/config/taffybar/imalison-taffybar.cabal @@ -33,8 +33,6 @@ executable imalison-taffybar , taffybar>=3.2.0 , transformers , xdg-basedir - , xmonad-contrib>=0.13 - , xmonad>=0.13 default-language: Haskell2010 source-repository head diff --git a/dotfiles/config/taffybar/shell.nix b/dotfiles/config/taffybar/shell.nix new file mode 100644 index 00000000..aae7a934 --- /dev/null +++ b/dotfiles/config/taffybar/shell.nix @@ -0,0 +1,7 @@ +let + pkgs = import { overlays = [ + (import ./taffybar/overlay.nix) (import ../xmonad/overlay.nix) + ]; }; + source = pkgs.lib.sourceByRegex ./. ["taffybar.hs" "imalison-taffybar.cabal"]; + imalison-taffybar = pkgs.haskellPackages.callCabal2nix "imalison-taffybar" source { }; +in pkgs.haskellPackages.shellFor { packages = _: [imalison-taffybar pkgs.haskellPackages.taffybar]; } diff --git a/dotfiles/config/taffybar/taffybar b/dotfiles/config/taffybar/taffybar index 397a85cb..cb09a5d1 160000 --- a/dotfiles/config/taffybar/taffybar +++ b/dotfiles/config/taffybar/taffybar @@ -1 +1 @@ -Subproject commit 397a85cbb712235624f402a3f1157a3c637f0aab +Subproject commit cb09a5d1c5ee7af55c627175373fb1ea469d651e diff --git a/dotfiles/config/taffybar/taffybar.hs b/dotfiles/config/taffybar/taffybar.hs index 63c48122..dc6122b7 100644 --- a/dotfiles/config/taffybar/taffybar.hs +++ b/dotfiles/config/taffybar/taffybar.hs @@ -202,7 +202,7 @@ main = do ) ] simpleTaffyConfig = selectedConfig - { centerWidgets = map (>>= buildContentsBox) [] + { centerWidgets = [] -- , endWidgets = [] -- , startWidgets = [] } diff --git a/dotfiles/config/xmonad/PagerHints.hs b/dotfiles/config/xmonad/PagerHints.hs index 1deb7a70..4ffe2a66 100644 --- a/dotfiles/config/xmonad/PagerHints.hs +++ b/dotfiles/config/xmonad/PagerHints.hs @@ -1,8 +1,4 @@ -module PagerHints ( - -- * Usage - -- $usage - pagerHints -) where +module PagerHints where import Codec.Binary.UTF8.String (encode) import Control.Monad @@ -66,10 +62,10 @@ setVisibleWorkspaces vis = withDisplay $ \dpy -> do -- | Handle all \"Current Layout\" events received from pager widgets, and -- set the current layout accordingly. pagerHintsEventHook :: Event -> X All -pagerHintsEventHook ClientMessageEvent { - ev_message_type = mt, - ev_data = d - } = withWindowSet $ \_ -> do +pagerHintsEventHook ClientMessageEvent + { ev_message_type = mt + , ev_data = d + } = withWindowSet $ \_ -> do a <- xLayoutProp when (mt == a) $ sendLayoutMessage d return (All True) diff --git a/dotfiles/config/xmonad/overlay.nix b/dotfiles/config/xmonad/overlay.nix index 1f1cf24e..75d46de7 100644 --- a/dotfiles/config/xmonad/overlay.nix +++ b/dotfiles/config/xmonad/overlay.nix @@ -1,12 +1,8 @@ _: 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; - }); + xmonad = self.callCabal2nix "xmonad" (fetchGit ./xmonad) { }; + xmonad-contrib = self.callCabal2nix "xmonad-contrib" (fetchGit ./xmonad-contrib) { }; }); }); } diff --git a/dotfiles/config/xmonad/xmonad-contrib b/dotfiles/config/xmonad/xmonad-contrib index f1039909..3239bf74 160000 --- a/dotfiles/config/xmonad/xmonad-contrib +++ b/dotfiles/config/xmonad/xmonad-contrib @@ -1 +1 @@ -Subproject commit f10399096794addfd121f014b687a0298354f410 +Subproject commit 3239bf74cf85794be2e427a3fb2518738d613866 diff --git a/dotfiles/config/xmonad/xmonad.hs b/dotfiles/config/xmonad/xmonad.hs index 8e31c8b1..093d4bc1 100644 --- a/dotfiles/config/xmonad/xmonad.hs +++ b/dotfiles/config/xmonad/xmonad.hs @@ -361,7 +361,7 @@ selectLayout = myDmenu layoutNames >>= (sendMessage . JumpToLayout) myLayoutHook = avoidStruts . - minimize . + minimizeNoDescription . boringAuto . mkToggle1 MIRROR . mkToggle1 LIMIT . diff --git a/dotfiles/lib/bin/taffybar b/dotfiles/lib/bin/taffybar deleted file mode 100755 index 3d838f78..00000000 --- a/dotfiles/lib/bin/taffybar +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env zsh -# -*- mode:sh - -cd "$HOME/.config/taffybar" -stack install - -if command_exists "imalison-taffybar"; then - imalison-taffybar "$@" -else - # Move .lib/bin to the end of PATH so that this script is not called again - add_to_path "$HOME/.lib/bin" --after - taffybar "$@" -fi diff --git a/nixos/configuration.nix b/nixos/configuration.nix index e90a56a8..38354cfd 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -15,6 +15,7 @@ let virtualenvwrapper ]; python-with-my-packages = pkgs.python3.withPackages my-python-packages; + all-hies = import (fetchTarball "https://github.com/infinisil/all-hies/tarball/master") {}; taffySource = pkgs.lib.sourceByRegex ../dotfiles/config/taffybar [ "taffybar.hs" "imalison-taffybar.cabal" ]; @@ -84,6 +85,7 @@ in }; }; + xdg.menus.enable = true; environment.systemPackages = with pkgs; [ # Applications @@ -121,7 +123,7 @@ in plasma5.breeze-qt5 gnome-breeze - # Desktop + # Haskell Desktop (haskellPackages.callCabal2nix "imalison-taffybar" taffySource { }) (haskellPackages.callCabal2nix "imalison-xmonad" xmonadSource { }) (ntiHaskellPackages.callCabal2nix "notifications-tray-icon" notifications-tray-icon-source { }) @@ -130,6 +132,8 @@ in haskellPackages.xmonad haskellPackages.taffybar + # Desktop + taffybar autorandr betterlockscreen blueman @@ -173,6 +177,8 @@ in ghc stack haskellPackages.hasktags + haskellPackages.hoogle + (all-hies.selection { selector = p: { inherit (p) ghc864; }; }) # Scala sbt @@ -248,6 +254,7 @@ in # Nix nix-prefetch-git + cachix # Miscellaneous android-udev-rules diff --git a/nixos/machines/dfinity-blade15.nix b/nixos/machines/ivanm-dfinity-razer.nix similarity index 54% rename from nixos/machines/dfinity-blade15.nix rename to nixos/machines/ivanm-dfinity-razer.nix index 31bb085c..0f914632 100644 --- a/nixos/machines/dfinity-blade15.nix +++ b/nixos/machines/ivanm-dfinity-razer.nix @@ -4,12 +4,15 @@ { config, lib, pkgs, ... }: { - imports = - [ + imports = [ + ../configuration.nix ../extra.nix ../dfinity.nix - ]; + /etc/nixos/cachix.nix + ]; + + hardware.bumblebee.enable = true; boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "usbhid" "sd_mod" ]; boot.kernelModules = [ "kvm-intel" ]; @@ -22,29 +25,29 @@ services.tlp.enable = true; services.acpid.enable = false; - fileSystems."/" = - { device = "/dev/disk/by-uuid/58218a04-3ba1-4295-86bb-ada59f75e3b6"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/58218a04-3ba1-4295-86bb-ada59f75e3b6"; + fsType = "ext4"; + }; boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/8142784e-45c6-4a2b-91f1-09df741ac00f"; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/36E1-BE93"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/36E1-BE93"; + 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"; - }; + 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 = [ ];