Skip to content

Latest commit

 

History

History
2103 lines (1752 loc) · 68.7 KB

Workstation.org

File metadata and controls

2103 lines (1752 loc) · 68.7 KB

Workstation Definition

Table of Contents

Channels

Guix manages package definitions through channels. As Guix strongly respects the freedom of computer users, to download non-free software one must include non-free channels. I include one of these below (nongnu), in addition to the default Guix channel definition.

(list (channel
        (name 'guix)
        (url "https://git.savannah.gnu.org/git/guix.git")
        (introduction
          (make-channel-introduction
            "9edb3f66fd807b096b48283debdcddccfea34bad"
            (openpgp-fingerprint
              "BBB0 2DDF 2CEA F6A8 0D1D  E643 A2A0 6DF2 A33A 54FA"))))
      (channel
        (name 'nonguix)
        (url "https://gitlab.com/nonguix/nonguix")
        (introduction
          (make-channel-introduction
            "897c1a470da759236cc11798f4e0a5f7d4d59fbc"
            (openpgp-fingerprint
              "2A39 3FFF 68F4 EF7A 3D29  12AF 6F51 20A0 22FB B2D5")))))

Operating System

I build up my system configurations using noweb style syntax. This enables us to write a base operating system available to be inherited by concrete system definitions (laptops, desktops, servers).

Dependencies

Define all dependencies we need to build the base definition.

(define-module (workstation)
  #:use-module (gnu)
  #:use-module (guix)
  #:use-module (gnu packages)
  #:use-module (gnu system)
  #:use-module (gnu system nss)
  #:use-module (nongnu system linux-initrd)
  #:use-module (nongnu packages linux)
  #:use-module (guix transformations)
  #:use-module (gnu packages base)
  #:use-module (gnu packages xorg)
  #:use-module (gnu services xorg)
  #:use-module (gnu packages file-systems)
  #:use-module (gnu packages shells)
  #:use-module (gnu packages certs)
  #:use-module (gnu services networking)
  #:use-module (gnu services desktop)
  #:use-module (gnu services ssh))

Initialize

Initialize our bash script that runs as part of each first install.

# This script created from Workstation.org
WORKING_DIR=$(dirname $(readlink -f $0))
GREEN_TERMINAL_OUTPUT='\033[1;32m'
CLEAR='\033[0m'

Activate

Initialize our bash script that runs as part of each generation activation.

GREEN_TERMINAL_OUTPUT='\033[1;32m'
CLEAR='\033[0m'

Helpers

I define small groups of packages in manifest files that enable me to build up to a larger package list of software to install. These helper scripts turn on and or update individual manifests (profiles) without forcing me to update everything. Thanks to David Wilson for these.

# Create bin if it doesn't already exist
mkdir -p ~/bin

# activate-profiles and update-profiles, scripts for Guix profiles
mv $WORKING_DIR/activate-profiles ~/bin/activate-profiles
mv $WORKING_DIR/update-profiles ~/bin/update-profiles
chmod +x ~/bin/activate-profiles
chmod +x ~/bin/update-profiles

Scripts

activate-profiles
#!/bin/sh

GREEN='\033[1;32m'
RED='\033[1;30m'
NC='\033[0m'
GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles

profiles=$*
if [[ $# -eq 0 ]]; then
    profiles="$HOME/.config/guix/manifests/*.scm";
fi

for profile in $profiles; do

  # Remove the path and file extension, if any
  profileName=$(basename $profile)
  profileName="${profileName%.*}"
  profilePath="$GUIX_EXTRA_PROFILES/$profileName"
  manifestPath=$HOME/.config/guix/manifests/$profileName.scm

  if [ -f $manifestPath ]; then
    echo -e "${GREEN}Activating profile:" $manifestPath "${NC}"
    echo

    mkdir -p $profilePath
    guix package --manifest=$manifestPath --profile="$profilePath/$profileName"

    # Source the new profile
    GUIX_PROFILE="$profilePath/$profileName"
    if [ -f $GUIX_PROFILE/etc/profile ]; then
        . "$GUIX_PROFILE"/etc/profile
    else
        echo -e "${RED}Couldn't find profile:" $GUIX_PROFILE/etc/profile "${NC}"
    fi
  else
    echo "No profile found at path" $profilePath
  fi
done
update-profiles
#!/bin/sh

GREEN='\033[1;32m'
NC='\033[0m'
GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles

profiles=$*
if [[ $# -eq 0 ]]; then
    profiles="$GUIX_EXTRA_PROFILES/*";
fi

for profile in $profiles; do
  profileName=$(basename $profile)
  profilePath=$GUIX_EXTRA_PROFILES/$profileName

  echo -e "${GREEN}Updating profile:" $profilePath "${NC}"
  echo

  guix package --profile="$profilePath/$profileName" --manifest="$HOME/.config/guix/manifests/$profileName.scm"
done

Operating System Definition

Now that we’ve prepped module definitions and labeled values to be used in our base operating system, let’s define it. All systems inherit from this defintion, both servers and computers.

;; Base Operating System
(define-public base-operating-system
  (operating-system
    (host-name "workstation")
    (hosts-file
      (plain-file "hosts"
        (string-append (local-host-aliases host-name)
        (string-append
         "---------- This file is generated by guix-config (Workstation.org) ----------\n"
        "192.168.0.67    BRN008077D92A06.local")))) ;; Add office printer
    (locale "en_US.utf8")
    (timezone "America/Kentucky/Louisville")
    (keyboard-layout (keyboard-layout "us"))

Kernel

Linux-lts kernel is chosen as the nvidia-driver in the nonfree channel was compiled against it. In the future I’d like to move away from lts to get more frequent patches.

(kernel linux-lts)
(firmware (list linux-firmware))

File Systems

Boot Loader

Define GRUB as the bootloader for all machines and insert an empty filesystem to be overridden by derivative machines.

;; Boot settings (UEFI)
(bootloader
  (bootloader-configuration
    (bootloader grub-efi-bootloader)
    (targets (list "/boot/efi"))
    (keyboard-layout keyboard-layout)))

Empty Stub

Stub out an empty filesystem to be overriden later. Guix complains otherwise.

(file-systems (cons*
               (file-system
                 (mount-point "/tmp")
                 (device "none")
                 (type "tmpfs")
                 (check? #f))
               %base-file-systems))))

X Window Systems

These components and their respective dotfiles are shared across all computers.

Compositor - Picom

Compositing is the process of combining visual elements from separate sources into single images, i.e building the window image. Also provides shaders for drop shadows and other effects.

Guix Packages

"picom"

Manifest

"picom/picom.conf"

Files

picom/picom.conf
#################################
#       Shadows
#################################
shadow = true;
shadow-radius = 15;
shadow-offset-x = -15;
shadow-offset-y = -15;
shadow-opacity = 0.6;
shadow-ignore-shaped = false;
shadow-exclude = [
    "class_g = 'firefox' && window_type = 'utility'",
    "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
    "_GTK_FRAME_EXTENTS@:c"
];

#################################
#       Opacity
#################################
inactive-opacity = 1;
active-opacity = 1;
frame-opacity = 0.9;
inactive-opacity-override = false;
blur-background = true;
blur-background-frame = true;
blur-background-fixed = true;
blur-background-exclude = [
    "window_type = 'dock'",
    "window_type = 'desktop'"
];

#################################
#       Fading
#################################
fading = true;
fade-delta = 10;  # 30;
fade-in-step = 0.1;
fade-out-step = 0.1;
fade-exclude = [ ];

wintypes:
{
  dock = { shadow = false; }
  dnd = { shadow = false; }
  popup_menu = { opacity = 1.0; }
  dropdown_menu = { opacity = 1.0; }
}

#################################
#       Rendering
#################################
vsync = false;
unredir-if-possible = false;

Color Theme and Fonts

I use my own theme throughout my terminal, emacs, and status bars.

Activate

Link the .Xresources file defined below.

# Link configuration and theme from Guix Store to final location
echo -e "${GREEN_TERMINAL_OUTPUT}--> [X11] Linking Xresources...${CLEAR}"
mv ~/.config/.Xresources ~/.Xresources && \
    echo -e "${GREEN_TERMINAL_OUTPUT}--> [X11] Linked.${CLEAR}"

Guix Packages

"font-hack"
"font-awesome"
"font-google-roboto"
"font-google-material-design-icons"

Dotfiles Manifest

".Xresources"

Dotfiles

.Xresources
! Color palette
#define RED #EC5F67
#define GREEN #99C794
#define YELLOW #FAC863
#define BLUE #6699CC
#define PURPLE #C594C5
#define TEAL #5FB3B3
#define BLACK #1F2528
#define LIGHT_GREY #C0C5CE
#define DARK_GREY #65737E

! Colors 0-15.
*.color0: BLACK
*color0:  BLACK
*.color1: RED
*color1:  RED
*.color2: GREEN
*color2:  GREEN
*.color3: YELLOW
*color3:  YELLOW
*.color4: BLUE
*color4:  BLUE
*.color5: PURPLE
*color5:  PURPLE
*.color6: TEAL
*color6:  TEAL
*.color7: LIGHT_GREY
*color7:  LIGHT_GREY
*.color8: DARK_GREY
*color8:  DARK_GREY
*.color9: RED
*color9:  RED
*.color10: GREEN
*color10:  GREEN
*.color11: YELLOW
*color11:  YELLOW
*.color12: BLUE
*color12:  BLUE
*.color13: PURPLE
*color13:  PURPLE
*.color14: TEAL
*color14:  TEAL
*.color15: LIGHT_GREY
*color15:  LIGHT_GREY

! Black color that will not be affected by bold highlighting.
*.color66: BLACK
*color66:  BLACK

! Xclock colors.
XClock*foreground: LIGHT_GREY
XClock*background: BLACK
XClock*majorColor:  rgba:d8/de/e9/ff
XClock*minorColor:  rgba:d8/de/e9/ff
XClock*hourColor:   rgba:d8/de/e9/ff
XClock*minuteColor: rgba:d8/de/e9/ff
XClock*secondColor: rgba:d8/de/e9/ff

Xft.dpi: 96
Xft.antialias: true
Xft.hinting: true
Xft.rgba: rgb
Xft.autohint: false
Xft.hintstyle: hintslight
Xft.lcdfilter: lcddefault

Status Bar - Polybar

I use polybar to provide a minimal amount of data in a status bar. Date, time, and a watch over CPU, RAM, and Network.

Guix Packages

"polybar"

Dotfiles Manifest

"polybar/colors.ini"
"polybar/bars.ini"
"polybar/modules.ini"
"polybar/config.ini"

Dotfiles

polybar/colors.ini

Color definitions for various modules. @todo: pull this from my global color definition.

;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
[color]
background = #1F2528
background-alt = #000000
foreground = #FFFFFF
foreground-alt = #FDF6E3
primary = #FAC863
white = #FFFFFF
black = #000000
red = #EC5F67
purple = #C594C5
blue = #6699CC
cyan = #5FB3B3
teal = #5FB3B3
green = #99C794
yellow = #FAC863
pink = #EC6798
lime = #B9C244
amber = #EDB83F
orange = #E57C46
brown = #AC8476
gray = #1F2528
indigo = #6C77BB
blue-gray = #5FB3B3
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

polybar/bars.ini

Define bars and visual elements.

;; Bar settings

[bar]
fill = ⏽
empty = ⏽
indicator = ⏽

;; Module settings

[module/volume]
type = internal/alsa

; Soundcard to be used
; Usually in the format hw:# where # is the card number
; You can find the different card numbers in `/proc/asound/cards`
master-soundcard = default
speaker-soundcard = default
headphone-soundcard = default

; Name of the master, speaker and headphone mixers
; Use the following command to list available mixer controls:
; $ amixer scontrols | sed -nr "s/.*'([[:alnum:]]+)'.*/\1/p"
; If master, speaker or headphone-soundcard isn't the default,
; use `amixer -c # scontrols` instead where # is the number
; of the master, speaker or headphone soundcard respectively
;
; Default: Master
master-mixer = Master

; Optionally define speaker and headphone mixers
; Default: none
;;speaker-mixer = Speaker
; Default: none
;;headphone-mixer = Headphone

; NOTE: This is required if headphone_mixer is defined
; Default: none
;;headphone-id = 9

; Use volume mapping (similar to amixer -M and alsamixer), where the increase in volume is linear to the ear
; Default: false
;;mapped = true

; Interval for volume increase/decrease (in percent points)
interval = 5
format-volume = <bar-volume>
format-volume-prefix = 
format-volume-prefix-padding = 1
format-volume-prefix-background = ${color.blue}
format-volume-prefix-foreground = ${color.foreground}
format-volume-background = ${color.background-alt}
format-volume-foreground = ${color.foreground}
format-volume-overline = ${color.background}
format-volume-underline = ${color.background}
format-muted = <label-muted>
format-muted-prefix = 
format-muted-prefix-padding = 1
format-muted-prefix-background = ${color.red}
format-muted-overline = ${color.background}
format-muted-underline = ${color.background}
label-volume = %percentage%%
label-volume-background = ${color.background-alt}
label-volume-padding = 1
label-muted = "Off"
label-muted-foreground = ${color.foreground}
label-muted-background = ${color.background-alt}
label-muted-padding = 1

; Only applies if <bar-volume> is used
bar-volume-format = " %fill%%indicator%%empty% "
bar-volume-width = 10
bar-volume-gradient = false
bar-volume-indicator = ${bar.indicator}
bar-volume-indicator-foreground = ${color.foreground}
bar-volume-fill = ${bar.fill}
bar-volume-foreground-0 = ${color.foreground}
bar-volume-foreground-1 = ${color.foreground}
bar-volume-foreground-2 = ${color.foreground}
bar-volume-empty = ${bar.empty}
bar-volume-empty-foreground = ${color.gray}
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

[module/cpu_bar]
type = internal/cpu

; Seconds to sleep between updates
; Default: 1
interval = 0.5
format = <bar-load><label>
format-prefix = 
format-prefix-padding = 1
format-prefix-background = ${color.teal}
format-prefix-foreground = ${color.foreground}
format-background = ${color.background-alt}
format-foreground = ${color.foreground}
format-overline = ${color.background}
format-underline = ${color.background}

; Available tokens:
;   %percentage% (default) - total cpu load averaged over all cores
;   %percentage-sum% - Cumulative load on all cores
;   %percentage-cores% - load percentage for each core
;   %percentage-core[1-9]% - load percentage for specific core
label = "%percentage%% "

; Only applies if <bar-load> is used
bar-load-format = " %fill%%indicator%%empty% "
bar-load-width = 10
bar-load-gradient = false

bar-load-indicator = ${bar.indicator}
bar-load-indicator-foreground = ${color.foreground}

bar-load-fill = ${bar.fill}
bar-load-foreground-0 = ${color.foreground}
bar-load-foreground-1 = ${color.foreground}
bar-load-foreground-2 = ${color.foreground}

bar-load-empty = ${bar.empty}
bar-load-empty-foreground = ${color.gray}

;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

[module/memory_bar]
type = internal/memory
interval = 2
format = <bar-used><label>
format-prefix = 
format-prefix-padding = 1
format-prefix-background = ${color.indigo}
format-prefix-foreground = ${color.foreground}
format-background = ${color.background-alt}
format-foreground = ${color.foreground}
format-overline = ${color.background}
format-underline = ${color.background}

; Available tokens:
;   %percentage_used% (default)
;   %percentage_free%
;   %gb_used%
;   %gb_free%
;   %gb_total%
;   %mb_used%
;   %mb_free%
;   %mb_total%
;   %percentage_swap_used%
;   %percentage_swap_free%
;   %mb_swap_total%
;   %mb_swap_free%
;   %mb_swap_used%
;   %gb_swap_total%
;   %gb_swap_free%
;   %gb_swap_used%

label = "%mb_used% "

; Only applies if <bar-used> is used
bar-used-format = " %fill%%indicator%%empty% "
bar-used-width = 10
bar-used-gradient = false
bar-used-indicator = ${bar.indicator}
bar-used-indicator-foreground = ${color.foreground}
bar-used-fill = ${bar.fill}
bar-used-foreground-0 = ${color.foreground}
bar-used-foreground-1 = ${color.foreground}
bar-used-foreground-2 = ${color.foreground}
bar-used-empty = ${bar.empty}
bar-used-empty-foreground = ${color.gray}

polybar/modules.ini

Define modules and their functionality.

;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

[module/alsa]
type = internal/alsa

; Soundcard to be used
; Usually in the format hw:# where # is the card number
; You can find the different card numbers in `/proc/asound/cards`
master-soundcard = default
speaker-soundcard = default
headphone-soundcard = default

; Name of the master, speaker and headphone mixers
; Use the following command to list available mixer controls:
; $ amixer scontrols | sed -nr "s/.*'([[:alnum:]]+)'.*/\1/p"
; If master, speaker or headphone-soundcard isn't the default,
; use `amixer -c # scontrols` instead where # is the number
; of the master, speaker or headphone soundcard respectively
;
; Default: Master
master-mixer = Master

; Default: none
;;headphone-id = 9

; Use volume mapping (similar to amixer -M and alsamixer), where the increase in volume is linear to the ear
; Default: false
;;mapped = true

; Interval for volume increase/decrease (in percent points)
; Default: 5
interval = 5

; Available tags:
;   <label-volume> (default)
;   <ramp-volume>
;   <bar-volume>
format-volume = <ramp-volume><label-volume>
format-volume-overline = ${color.background}
format-volume-underline = ${color.background}

; Available tags:
;   <label-muted> (default)
;   <ramp-volume>
;   <bar-volume>
format-muted = <label-muted>
format-muted-prefix = 
format-muted-prefix-background = ${color.red}
format-muted-prefix-padding = 1
format-muted-overline = ${color.background}
format-muted-underline = ${color.background}

; Available tokens:
;   %percentage% (default)
label-volume = %percentage%%
label-volume-background = ${color.background-alt}
label-volume-padding = 1

; Available tokens:
;   %percentage% (default
label-muted = "Off"
label-muted-foreground = ${color.foreground}
label-muted-background = ${color.background-alt}
label-muted-padding = 1

ramp-volume-0 = 
ramp-volume-1 = 
ramp-volume-2 = 
ramp-volume-background = ${color.blue}
ramp-volume-padding = 1

; If defined, it will replace <ramp-volume> when
; headphones are plugged in to `headphone_control_numid`
; If undefined, <ramp-volume> will be used for both
; Only applies if <ramp-volume> is used
ramp-headphones-0 = 
ramp-headphones-background = ${color.blue}
ramp-headphones-padding = 1

;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

[module/cpu]
type = internal/cpu

; Seconds to sleep between updates
; Default: 1
interval = 1

; Available tags:
;   <label> (default)
;   <bar-load>
;   <ramp-load>
;   <ramp-coreload>
format = <label>
format-prefix = 
format-prefix-background = ${color.brown}
format-prefix-padding = 1
format-overline = ${color.background}
format-underline = ${color.background}

; Available tokens:
;   %percentage% (default) - total cpu load averaged over all cores
;   %percentage-sum% - Cumulative load on all cores
;   %percentage-cores% - load percentage for each core
;   %percentage-core[1-9]% - load percentage for specific core
label = "%percentage%%"
label-background = ${color.background-alt}
label-padding = 1

;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

[module/date]
type = internal/date

; Seconds to sleep between updates
interval = 1.0
time = "%I:%M"
time-alt = "%a, %d %b %Y"

; Available tags:
;   <label> (default)
format = <label>
format-prefix = 
format-prefix-background = ${color.blue}
format-prefix-padding = 1
format-overline = ${color.background}
format-underline = ${color.background}

; Available tokens:
;   %date%
;   %time%
; Default: %date%
label = %time%
label-background = ${color.background-alt}
label-padding = 1

;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

[module/memory]
type = internal/memory

; Seconds to sleep between updates
; Default: 1
interval = 1

; Available tags:
;   <label> (default)
;   <bar-used>
;   <bar-free>
;   <ramp-used>
;   <ramp-free>
;   <bar-swap-used>
;   <bar-swap-free>
;   <ramp-swap-used>
;   <ramp-swap-free>
format = <label>
format-prefix = 
format-prefix-background = ${color.brown}
format-prefix-padding = 1
format-overline = ${color.background}
format-underline = ${color.background}

; Available tokens:
;   %percentage_used% (default)
;   %percentage_free%
;   %gb_used%
;   %gb_free%
;   %gb_total%
;   %mb_used%
;   %mb_free%
;   %mb_total%
;   %percentage_swap_used%
;   %percentage_swap_free%
;   %mb_swap_total%
;   %mb_swap_free%
;   %mb_swap_used%
;   %gb_swap_total%
;   %gb_swap_free%
;   %gb_swap_used%

label = "%mb_used%"
label-background = ${color.background-alt}
label-padding = 1

;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

; Normal Module
[module/network]
type = internal/network
interface = eno1

; Seconds to sleep between updates
; Default: 1
interval = 1.0

; Accumulate values from all interfaces
; when querying for up/downspeed rate
; Default: false
accumulate-stats = true

; Consider an `UNKNOWN` interface state as up.
; Some devices have an unknown state, even when they're running
; Default: false
unknown-as-up = false

; Available tags:
;   <label-connected> (default)
;   <ramp-signal>
format-connected = <label-connected>
format-connected-prefix = 
format-connected-prefix-background = ${color.brown}
format-connected-prefix-padding = 1
format-connected-overline = ${color.background}
format-connected-underline = ${color.background}

; Available tags:
;   <label-disconnected> (default)
format-disconnected = <label-disconnected>
format-disconnected-prefix = 
format-disconnected-prefix-background = ${color.orange}
format-disconnected-prefix-padding = 1
format-disconnected-overline = ${color.background}
format-disconnected-underline = ${color.background}

; Available tags:
;   <label-connected> (default)
;   <label-packetloss>
;   <animation-packetloss>
;;format-packetloss = <animation-packetloss> <label-connected>

; Available tokens:
;   %ifname%    [wireless+wired]
;   %local_ip%  [wireless+wired]
;   %local_ip6% [wireless+wired]
;   %essid%     [wireless]
;   %signal%    [wireless]
;   %upspeed%   [wireless+wired]
;   %downspeed% [wireless+wired]
;   %linkspeed% [wired]
; Default: %ifname% %local_ip%
label-connected = "%{A1:networkmanager_dmenu &:}%downspeed%%{A}"
label-connected-background = ${color.background-alt}
label-connected-padding = 1

; Available tokens:
;   %ifname%    [wireless+wired]
; Default: (none)
label-disconnected = "%{A1:networkmanager_dmenu &:}Offline%{A}"
label-disconnected-background = ${color.background-alt}
label-disconnected-padding = 1

;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

[module/workspaces]
type = internal/xworkspaces

; Only show workspaces defined on the same output as the bar
;
; Useful if you want to show monitor specific workspaces
; on different bars
;
; Default: false
pin-workspaces = true

; Create click handler used to focus desktop
; Default: true
enable-click = true

; Create scroll handlers used to cycle desktops
; Default: true
enable-scroll = true

; icon-[0-9]+ = <desktop-name>;<icon>
; NOTE: The desktop name needs to match the name configured by the WM
; You can get a list of the defined desktops using:
; $ xprop -root _NET_DESKTOP_NAMES
icon-0 = 1;
icon-1 = 2;
icon-2 = 3;
icon-3 = 4;
icon-4 = 5;
icon-default = 

; Available tags:
;   <label-monitor>
;   <label-state> - gets replaced with <label-(active|urgent|occupied|empty)>
; Default: <label-state>
format = <label-state>
format-overline = ${color.background}
format-underline = ${color.background}

; Available tokens:
;   %name%
label-monitor = %name%

; Available tokens:
;   %name%
;   %icon%
;   %index%
label-active = %icon%
label-active-foreground = ${color.foreground}
label-active-background = ${color.primary}

; Available tokens:
;   %name%
;   %icon%
;   %index%
label-occupied = %icon%
label-occupied-foreground = ${color.foreground}
label-occupied-background = ${color.gray}

; Available tokens:
;   %name%
;   %icon%
;   %index%
label-urgent = %icon%
label-urgent-foreground = ${color.foreground}
label-urgent-background = ${color.red}

; Available tokens:
;   %name%
;   %icon%
;   %index%
label-empty = %icon%
label-empty-foreground = ${color.foreground}
label-empty-background = ${color.background-alt}

label-active-padding = 1
label-urgent-padding = 1
label-occupied-padding = 1
label-empty-padding = 1

[module/sep]
type = custom/text
content = |

content-background = ${color.background}
content-foreground = ${color.background}

polybar/config.ini

Main script for polybar.

;; Global WM Settings

[global/wm]
margin-bottom = 0
margin-top = 0

;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

include-file = /home/dustin/.config/polybar/bars.ini
include-file = /home/dustin/.config/polybar/colors.ini
include-file = /home/dustin/.config/polybar/modules.ini

;; Bar Settings

[bar/main]
monitor-strict = false
override-redirect = false
bottom = false
fixed-center = true
width = 100%
height = 34
background = ${color.background}
foreground = ${color.foreground}
line-size = 5
line-color = ${color.background}
border-bottom-size = 0
border-bottom-color = ${color.primary}
padding = 0
module-margin-left = 0
module-margin-right = 0
font-0 = "Helvetica LT Std:size=12;4"
font-1 = "FontAwesome:size=12;3"
enable-ipc = true

modules-left = sep workspaces sep memory sep cpu sep network
modules-right = sep alsa sep date

;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

; Opacity value between 0.0 and 1.0 used on fade in/out
dim-value = 1.0

; Set a DPI values used when rendering text
; This only affects scalable fonts
; dpi =

;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

;; Application Settings

[settings]
; The throttle settings lets the eventloop swallow up til X events
; if they happen within Y millisecond after first event was received.
; This is done to prevent flood of update event.
throttle-output = 5
throttle-output-for = 10
screenchange-reload = false

; Compositing operators
; https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-operator-t
compositing-background = source
compositing-foreground = over
compositing-overline = over
compositing-underline = over
compositing-border = over

File Manager - Thunar

Thunar provides a rich user interface for file management. The dotfiles configure commands I run with contextual menus based on file type.

Guix Packages

"thunar"
"tumbler"

Dotfiles Manifest

"Thunar/uca.xml"

Dotfiles

Thunar/uca.xml
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
	<icon>utilities-terminal</icon>
	<name>Open Terminal Here</name>
	<unique-id>1632887846683536-1</unique-id>
	<command>alacritty --working-directory %f</command>
	<description>Open an instance of Alacritty at file</description>
	<patterns>*</patterns>
	<startup-notify/>
	<directories/>
</action>
<action>
	<icon>preferences-desktop-wallpaper</icon>
	<name>Set Wallpaper</name>
	<unique-id>1632887846683536-2</unique-id>
        <command>feh --no-fehbg --bg-scale %f</command>
	<description>Set the wallpaper using feh</description>
	<patterns>*</patterns>
	<image-files/>
</action>
<action>
	<icon>catfish</icon>
	<name>Search</name>
	<unique-id>1489089852658523-2</unique-id>
	<command>catfish --path=$f$d</command>
	<description>Open search dialog at path</description>
	<patterns>*</patterns>
	<directories/>
</action>
<action>
	<icon>final-term</icon>
	<name>Extract Archive</name>
	<unique-id>1489091300385082-4</unique-id>
	<command>tar xjf %n</command>
	<description></description>
	<patterns>*.tar.bz2;*.tbz2;*.tar.gz</patterns>
	<other-files/>
</action>
<action>
	<icon>document-properties</icon>
	<name>Unzip File</name>
	<unique-id>1489091300385082-4</unique-id>
	<command>unzip %n</command>
	<description></description>
	<patterns>*.zip</patterns>
	<other-files/>
</action>
</actions>

Notifications - Dunst

Dunst gives us toast notifications. The dotfiles configure theme. @todo item for me is to remove the hardcoded colors in favor of common definition.

Guix Packages

"dunst"
"libnotify"

Dotfiles Manifest

"dunst/dunstrc"

Dotfiles

dunst/dunstrc
[global]
monitor = 0
follow = mouse
geometry = "400x60-25+48"
indicate_hidden = yes
shrink = no
separator_height = 0
padding = 32
horizontal_padding = 32
frame_width = 2
sort = no
idle_threshold = 120
font = "SF Pro Display 10"
line_height = 4
markup = full
format = <b>%s</b>\n%b
alignment = left
show_age_threshold = 60
word_wrap = yes
ignore_newline = no
stack_duplicates = false
hide_duplicate_count = yes
show_indicators = no
icon_position = left
sticky_history = yes
history_length = 20
browser = /usr/bin/firefox -new-tab
always_run_script = true
title = Dunst
class = Dunst
max_icon_size = 64
icon_path = /run/current-system/profile/share/icons/hicolor/24x24/apps

[shortcuts]
close = esc
close_all = ctrl+esc
history = ctrl+grave
context = ctrl+shift+period

[urgency_low]
timeout = 4
background = "#1F2528"
foreground = "#C0C5CE"
frame_color = "#1F2528"

[urgency_normal]
timeout = 8
background = "#1F2528"
foreground = "#C0C5CE"
frame_color = "#1F2528"

[urgency_critical]
timeout = 8
background = "#1F2528"
foreground = "#C0C5CE"
frame_color = "#1F2528"

[slack]
appname = Slack
icon = 'slack'
icon_id = 'slack'

[hangouts]
appname = hangups
icon = 'Hangouts'
icon_id = 'Hangouts'

Printers

Brother DL-2170W

We use a trusty Brother Laser DL-2170W printer that I bought in high school (!). The thing is a beast with 2500+ page high yield toners.

Initialize

This runs after brlaser is installed for the first time.

# Link configuration and theme at final location
echo -e "${GREEN_TERMINAL_OUTPUT}--> [Polybar] Linking printers.conf...${CLEAR}"
sudo -E ln -fs ~/.config/printers/printers.conf /etc/cups/printers.conf && \
    echo -e "${GREEN_TERMINAL_OUTPUT}--> [Polybar] Linked.${CLEAR}"

Guix Packages

"brlaser"
"system-config-printer"
"cups"

Dotfiles Manifest

"printers/printers.conf"

Dotfiles

printers.conf
# Printer configuration file for CUPS v2.3.3
# Written by cupsd on 2021-10-08 16:30
NextPrinterId 5
<Printer Brother_HL-2170W>
PrinterId 4
UUID urn:uuid:d80c78bd-fbd3-33f1-6f72-9c7ea713aa0c
Info Brother HL-2170W series
Location Upstairs Office
MakeModel Brother HL-2270DW series, using brlaser v6
DeviceURI dnssd://Brother%20HL-2170W%20series._pdl-datastream._tcp.local/
State Idle
StateTime 1633725056
ConfigTime 1633354093
Type 4180
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy stop-printer
Attribute marker-colors \#000000,#000000
Attribute marker-levels -1,74
Attribute marker-names Black Toner Cartridge,Drum Unit
Attribute marker-types toner,opc
Attribute marker-change-time 1633725056
</Printer>

Terminal

Alacritty

We chose Alacritty primarily because of how performant it is and never looked back. It does everything we need.

Guix Packages

"alacritty"

Dotfiles Manifest

"alacritty/alacritty.yml"

Dotfiles

alacritty.yml
# @todo: Map colors to common definition
env:
  term: alacritty

background_opacity: 1.0

cursor:
  style: Block

window:
  padding:
    x: 8
    y: 8
  dynamic_padding: true
  decorations: full
  title: Alacritty
  class:
    instance: Alacritty
    general: Alacritty

# Font configuration
font:
  normal:
    family: Hack
  size: 10

colors:
  # Default colors
  primary:
    background: '0x1f2528'
    foreground: '0xc0c5ce'

  # Normal colors
  normal:
    black:   '0x1f2528'
    red:     '0xec5f67'
    green:   '0x99c794'
    yellow:  '0xfac863'
    blue:    '0x6699cc'
    magenta: '0xc594c5'
    cyan:    '0x5fb3b3'
    white:   '0xc0c5ce'

  # Bright colors
  bright:
    black:   '0x65737e'
    red:     '0xec5f67'
    green:   '0x99c794'
    yellow:  '0xfac863'
    blue:    '0x6699cc'
    magenta: '0xc594c5'
    cyan:    '0x5fb3b3'
    white:   '0xd8dee9'

Git

Config

We chose sensible git defaults and initialize our home directory.

Initialize

Link the .gitconfig file defined below.

# Link configuration and theme from Guix Store to final location
echo -e "${GREEN_TERMINAL_OUTPUT}--> [Git] Linking .gitconfig...${CLEAR}"
ln -fs ~/.config/git/.gitconfig ~/.gitconfig && \
echo -e "${GREEN_TERMINAL_OUTPUT}--> [Git] Linked.${CLEAR}"

Guix Packages

"git"

Dotfiles Manifest

"git/.gitconfig"

Dotfiles

.gitconfig

I don’t overcomplicate these; mainly just set main as default branch and give me pretty colors in git log.

[init]
  defaultBranch = main

[user]
  email = dustin@zeroedlabs.com
  name = Dustin Lyons
  username = dlyons

[alias]
  lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --

Editors

Back then: vim golf. Now: emacs os.

Vim

These snippets get tangled into files that run as part of Makefile targets. Initialize, and Activate after every new Guix generation.

Initialize

This runs after vim is installed for the first time.

# Download our Vim plugin manager of choice, Plug.vim
echo -e "${GREEN_TERMINAL_OUTPUT}--> [Vim] Downloading plug.vim...${CLEAR}"
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
  https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim && \
    echo -e "${GREEN_TERMINAL_OUTPUT}--> [Vim] Completed.${CLEAR}"

Activate

This runs after vim is installed.

mv ~/.config/vim/colors/theme.vim ~/.vim/colors/theme.vim && \
echo -e "${GREEN_TERMINAL_OUTPUT}--> [Vim] Linking theme.vim...${CLEAR}"

mv ~/.config/vim/.vimrc ~/.vimrc && \
echo -e "${GREEN_TERMINAL_OUTPUT}--> [Vim] Linking .vimrc...${CLEAR}"

Guix Packages

"vim"

Dotfiles Manifest

"vim/colors/theme.vim"
"vim/.vimrc"

Dotfiles

colors/theme.vim
" Maintainer: Jonathan Filip <jfilip1024@gmail.com>
" Version: 7.1.1

hi clear
if exists("syntax_on")
    syntax reset
endif
let colors_name="lucius"

set background=dark
if exists("g:lucius_style")
    if g:lucius_style == "light"
        set background=light
    endif
else
    let g:lucius_style = "dark"
endif

" set colorcolumn=21,37,53,68,86,100

if g:lucius_style == "dark"

    hi CocWarningSign  guifg=#d7d7d7   guibg=#192023   ctermfg=187    ctermbg=NONE      gui=none      cterm=none
    hi Normal       guifg=#d7d7d7   guibg=#192023   ctermfg=188    ctermbg=NONE      gui=none      cterm=none
    hi Comment      guifg=#808080   guibg=NONE      ctermfg=244    ctermbg=NONE      gui=none      cterm=none
    hi Constant     guifg=#d7d7af   guibg=NONE      ctermfg=187    ctermbg=NONE      gui=none      cterm=none
    hi BConstant    guifg=#d7d7af   guibg=NONE      ctermfg=187    ctermbg=NONE      gui=bold      cterm=bold
    hi Identifier   guifg=#afd787   guibg=NONE      ctermfg=150    ctermbg=NONE      gui=none      cterm=none
    hi BIdentifier  guifg=#afd787   guibg=NONE      ctermfg=150    ctermbg=NONE      gui=bold      cterm=bold
    hi Statement    guifg=#87d7ff   guibg=NONE      ctermfg=117    ctermbg=NONE      gui=none      cterm=none
    hi BStatement   guifg=#87d7ff   guibg=NONE      ctermfg=117    ctermbg=NONE      gui=bold      cterm=bold
    hi PreProc      guifg=#87d7af   guibg=NONE      ctermfg=115    ctermbg=NONE      gui=none      cterm=none
    hi BPreProc     guifg=#87d7af   guibg=NONE      ctermfg=115    ctermbg=NONE      gui=bold      cterm=bold
    hi Type         guifg=#87d7d7   guibg=NONE      ctermfg=116    ctermbg=NONE      gui=none      cterm=none
    hi BType        guifg=#87d7d7   guibg=NONE      ctermfg=116    ctermbg=NONE      gui=bold      cterm=bold
    hi Special      guifg=#d7afd7   guibg=NONE      ctermfg=182    ctermbg=NONE      gui=none      cterm=none
    hi BSpecial     guifg=#d7afd7   guibg=NONE      ctermfg=182    ctermbg=NONE      gui=bold      cterm=bold

    " ## Text Markup ##
    hi Underlined   guifg=fg        guibg=NONE      ctermfg=fg     ctermbg=NONE      gui=underline cterm=underline
    hi Error        guifg=#ff8787   guibg=#870000   ctermfg=210    ctermbg=88        gui=none      cterm=none
    hi Todo         guifg=#d7d75f   guibg=#5f5f00   ctermfg=185    ctermbg=58        gui=none      cterm=none
    hi MatchParen   guifg=bg        guibg=#afd75f   ctermfg=NONE   ctermbg=149       gui=none      cterm=bold
    hi NonText      guifg=#5f5f87   guibg=NONE      ctermfg=60     ctermbg=NONE      gui=none      cterm=none
    hi SpecialKey   guifg=#5f875f   guibg=NONE      ctermfg=65     ctermbg=NONE      gui=none      cterm=none
    hi Title        guifg=#5fafd7   guibg=NONE      ctermfg=74     ctermbg=NONE      gui=bold      cterm=bold

    " ## Text Selection ##
    hi Cursor       guifg=bg        guibg=#87afd7   ctermfg=NONE     ctermbg=110       gui=none      cterm=none
    hi CursorIM     guifg=bg        guibg=#87afd7   ctermfg=NONE     ctermbg=110       gui=none      cterm=none
    hi CursorColumn guifg=NONE      guibg=#444444   ctermfg=NONE   ctermbg=238       gui=none      cterm=none
    hi CursorLine   guifg=NONE      guibg=#242d33
    hi Visual       guifg=NONE      guibg=#005f87   ctermfg=NONE   ctermbg=24        gui=none      cterm=none
    hi VisualNOS    guifg=fg        guibg=NONE      ctermfg=fg     ctermbg=NONE      gui=underline cterm=underline
    hi IncSearch    guifg=bg        guibg=#57d7d7   ctermfg=NONE   ctermbg=80        gui=none      cterm=none
    hi Search       guifg=bg        guibg=#d78700   ctermfg=NONE   ctermbg=172       gui=none      cterm=none

    " == UI ==
    hi Pmenu        guifg=bg        guibg=#b2b2b2   ctermfg=NONE   ctermbg=233       gui=none      cterm=none
    hi PmenuSel     guifg=fg        guibg=#005f87   ctermfg=fg     ctermbg=239        gui=none      cterm=none
    hi PmenuSbar    guifg=#b2b2b2   guibg=#d0d0d0   ctermfg=249    ctermbg=252       gui=none      cterm=none
    hi PmenuThumb   guifg=fg        guibg=#808080   ctermfg=fg     ctermbg=244       gui=none      cterm=none
    hi StatusLine   guifg=bg        guibg=#b2b2b2   ctermfg=NONE   ctermbg=NONE       gui=bold      cterm=bold
    hi StatusLineNC guifg=#444444   guibg=#b2b2b2   ctermfg=238    ctermbg=239       gui=none      cterm=none
    hi TabLine      guifg=bg        guibg=#b2b2b2   ctermfg=NONE   ctermbg=NONE      gui=none      cterm=none
    hi TabLineFill  guifg=#444444   guibg=#b2b2b2   ctermfg=NONE   ctermbg=NONE       gui=none      cterm=none
    hi TabLineSel   guifg=fg        guibg=#005f87   ctermfg=233    ctermbg=150        gui=bold      cterm=bold
    hi VertSplit    guifg=#626262   guibg=#b2b2b2   ctermfg=241    ctermbg=249       gui=none      cterm=none
    hi Folded       guifg=#bcbcbc   guibg=#4e4e4e   ctermfg=250    ctermbg=239       gui=bold      cterm=none
    hi FoldColumn   guifg=#bcbcbc   guibg=#4e4e4e   ctermfg=250    ctermbg=239       gui=bold      cterm=none

    " ## Spelling ##
    hi SpellBad     guisp=#d70000                   ctermfg=160    ctermbg=NONE      gui=undercurl cterm=underline
    hi SpellCap     guisp=#00afd7                   ctermfg=38     ctermbg=NONE      gui=undercurl cterm=underline
    hi SpellRare    guisp=#5faf00                   ctermfg=70     ctermbg=NONE      gui=undercurl cterm=underline
    hi SpellLocal   guisp=#d7af00                   ctermfg=178    ctermbg=NONE      gui=undercurl cterm=underline

    " ## Diff ##
    hi DiffAdd      guifg=fg        guibg=#5f875f   ctermfg=fg     ctermbg=65        gui=none      cterm=none
    hi DiffChange   guifg=fg        guibg=#87875f   ctermfg=fg     ctermbg=101       gui=none      cterm=none
    hi DiffDelete   guifg=fg        guibg=#875f5f   ctermfg=fg     ctermbg=95        gui=none      cterm=none
    hi DiffText     guifg=#ffff87   guibg=#87875f   ctermfg=228    ctermbg=101       gui=none      cterm=none

    " ## Misc ##
    hi Directory    guifg=#afd7af   guibg=NONE      ctermfg=151    ctermbg=NONE      gui=none      cterm=none
    hi ErrorMsg     guifg=#ff5f5f   guibg=NONE      ctermfg=203    ctermbg=NONE      gui=none      cterm=none
    hi SignColumn   guifg=#b2b2b2   guibg=#242d33   ctermfg=NONE   ctermbg=NONE      gui=none      cterm=none
    hi LineNr       guifg=#626262   guibg=#444444   ctermfg=NONE   ctermbg=NONE       gui=none      cterm=none
    hi CursorLineNr guifg=#626262   guibg=#444444   ctermfg=NONE   ctermbg=NONE       gui=none      cterm=none
    hi MoreMsg      guifg=#5fd7d7   guibg=NONE      ctermfg=80     ctermbg=NONE      gui=none      cterm=none
    hi ModeMsg      guifg=fg        guibg=NONE      ctermfg=fg     ctermbg=NONE      gui=none      cterm=none
    hi Question     guifg=fg        guibg=NONE      ctermfg=fg     ctermbg=NONE      gui=none      cterm=none
    hi WarningMsg   guifg=#d7875f   guibg=NONE      ctermfg=173    ctermbg=NONE      gui=none      cterm=none
    hi WildMenu     guifg=fg        guibg=#005f87   ctermfg=fg     ctermbg=24        gui=none      cterm=none
    hi ColorColumn  guifg=NONE      guibg=#87875f   ctermfg=NONE   ctermbg=101       gui=none      cterm=none
    hi Ignore       guifg=bg                        ctermfg=NONE

elseif g:lucius_style == "dark_dim"

    hi Normal       guifg=#bcbcbc   guibg=#192023   ctermfg=250    ctermbg=236       gui=none      cterm=none
    hi Comment      guifg=#6c6c6c   guibg=NONE      ctermfg=242    ctermbg=NONE      gui=none      cterm=none
    hi Constant     guifg=#afaf87   guibg=NONE      ctermfg=144    ctermbg=NONE      gui=none      cterm=none
    hi BConstant    guifg=#afaf87   guibg=NONE      ctermfg=144    ctermbg=NONE      gui=bold      cterm=bold
    hi Identifier   guifg=#87af5f   guibg=NONE      ctermfg=107    ctermbg=NONE      gui=none      cterm=none
    hi BIdentifier  guifg=#87af5f   guibg=NONE      ctermfg=107    ctermbg=NONE      gui=bold      cterm=bold
    hi Statement    guifg=#57afd7   guibg=NONE      ctermfg=74     ctermbg=NONE      gui=none      cterm=none
    hi BStatement   guifg=#57afd7   guibg=NONE      ctermfg=74     ctermbg=NONE      gui=bold      cterm=bold
    hi PreProc      guifg=#5faf87   guibg=NONE      ctermfg=72     ctermbg=NONE      gui=none      cterm=none
    hi BPreProc     guifg=#5faf87   guibg=NONE      ctermfg=72     ctermbg=NONE      gui=bold      cterm=bold
    hi Type         guifg=#5fafaf   guibg=NONE      ctermfg=73     ctermbg=NONE      gui=none      cterm=none
    hi BType        guifg=#5fafaf   guibg=NONE      ctermfg=73     ctermbg=NONE      gui=bold      cterm=bold
    hi Special      guifg=#af87af   guibg=NONE      ctermfg=139    ctermbg=NONE      gui=none      cterm=none
    hi BSpecial     guifg=#af87af   guibg=NONE      ctermfg=139    ctermbg=NONE      gui=bold      cterm=bold

    " ## Text Markup ##
    hi Underlined   guifg=fg        guibg=NONE      ctermfg=fg     ctermbg=NONE      gui=underline cterm=underline
    hi Error        guifg=#d75f5f   guibg=#870000   ctermfg=167    ctermbg=88        gui=none      cterm=none
    hi Todo         guifg=#afaf00   guibg=#5f5f00   ctermfg=142    ctermbg=58        gui=none      cterm=none
    hi MatchParen   guifg=bg        guibg=#87af5f   ctermfg=bg     ctermbg=107       gui=none      cterm=bold
    hi NonText      guifg=#5f5f87   guibg=NONE      ctermfg=60     ctermbg=NONE      gui=none      cterm=none
    hi SpecialKey   guifg=#5f875f   guibg=NONE      ctermfg=65     ctermbg=NONE      gui=none      cterm=none
    hi Title        guifg=#00afd7   guibg=NONE      ctermfg=38     ctermbg=NONE      gui=bold      cterm=bold

    " ## Text Selection ##
    hi Cursor       guifg=bg        guibg=#5f87af   ctermfg=bg     ctermbg=67        gui=none      cterm=none
    hi CursorIM     guifg=bg        guibg=#5f87af   ctermfg=bg     ctermbg=67        gui=none      cterm=none
    hi CursorColumn guifg=NONE      guibg=#444444   ctermfg=NONE   ctermbg=238       gui=none      cterm=none
    hi CursorLine   guifg=NONE      guibg=#444444   ctermfg=NONE   ctermbg=238       gui=none      cterm=none
    hi Visual       guifg=NONE      guibg=#005f87   ctermfg=NONE   ctermbg=24        gui=none      cterm=none
    hi VisualNOS    guifg=fg        guibg=NONE      ctermfg=fg     ctermbg=NONE      gui=underline cterm=underline
    hi IncSearch    guifg=bg        guibg=#00afaf   ctermfg=bg     ctermbg=37        gui=none      cterm=none
    hi Search       guifg=bg        guibg=#d78700   ctermfg=bg     ctermbg=172       gui=none      cterm=none

    " == UI ==
    hi Pmenu        guifg=bg        guibg=#8a8a8a   ctermfg=bg     ctermbg=245       gui=none      cterm=none
    hi PmenuSel     guifg=fg        guibg=#005f87   ctermfg=fg     ctermbg=24        gui=none      cterm=none
    hi PmenuSbar    guifg=#8a8a8a   guibg=#bcbcbc   ctermfg=245    ctermbg=250       gui=none      cterm=none
    hi PmenuThumb   guifg=fg        guibg=#585858   ctermfg=fg     ctermbg=240       gui=none      cterm=none
    hi StatusLine   guifg=bg        guibg=#8a8a8a   ctermfg=bg     ctermbg=245       gui=bold      cterm=bold
    hi StatusLineNC guifg=#444444   guibg=#8a8a8a   ctermfg=238    ctermbg=245       gui=none      cterm=none
    hi TabLine      guifg=bg        guibg=#8a8a8a   ctermfg=bg     ctermbg=245       gui=none      cterm=none
    hi TabLineFill  guifg=#444444   guibg=#8a8a8a   ctermfg=238    ctermbg=245       gui=none      cterm=none
    hi TabLineSel   guifg=fg        guibg=#005f87   ctermfg=fg     ctermbg=24        gui=bold      cterm=bold
    hi VertSplit    guifg=#626262   guibg=#8a8a8a   ctermfg=241    ctermbg=245       gui=none      cterm=none
    hi Folded       guifg=#a8a8a8   guibg=#4e4e4e   ctermfg=248    ctermbg=239       gui=bold      cterm=none
    hi FoldColumn   guifg=#a8a8a8   guibg=#4e4e4e   ctermfg=248    ctermbg=239       gui=bold      cterm=none

    " ## Spelling ##
    hi SpellBad     guisp=#d70000                   ctermfg=160    ctermbg=NONE      gui=undercurl cterm=underline
    hi SpellCap     guisp=#00afd7                   ctermfg=38     ctermbg=NONE      gui=undercurl cterm=underline
    hi SpellRare    guisp=#5faf00                   ctermfg=70     ctermbg=NONE      gui=undercurl cterm=underline
    hi SpellLocal   guisp=#d7af00                   ctermfg=178    ctermbg=NONE      gui=undercurl cterm=underline

    " ## Diff ##
    hi DiffAdd      guifg=fg        guibg=#5f875f   ctermfg=fg     ctermbg=65        gui=none      cterm=none
    hi DiffChange   guifg=fg        guibg=#87875f   ctermfg=fg     ctermbg=101       gui=none      cterm=none
    hi DiffDelete   guifg=fg        guibg=#875f5f   ctermfg=fg     ctermbg=95        gui=none      cterm=none
    hi DiffText     guifg=#d7d75f   guibg=#87875f   ctermfg=185    ctermbg=101       gui=none      cterm=none

    " ## Misc ##
    hi Directory    guifg=#87af87   guibg=NONE      ctermfg=108    ctermbg=NONE      gui=none      cterm=none
    hi ErrorMsg     guifg=#d75f5f   guibg=NONE      ctermfg=167    ctermbg=NONE      gui=none      cterm=none
    hi SignColumn   guifg=#8a8a8a   guibg=#4e4e4e   ctermfg=245    ctermbg=239       gui=none      cterm=none
    hi LineNr       guifg=#626262   guibg=#444444   ctermfg=241    ctermbg=238       gui=none      cterm=none
    hi CursorLineNr guifg=#626262   guibg=#444444   ctermfg=241    ctermbg=238       gui=none      cterm=none
    hi MoreMsg      guifg=#00afaf   guibg=NONE      ctermfg=37     ctermbg=NONE      gui=none      cterm=none
    hi ModeMsg      guifg=fg        guibg=NONE      ctermfg=fg     ctermbg=NONE      gui=none      cterm=none
    hi Question     guifg=fg        guibg=NONE      ctermfg=fg     ctermbg=NONE      gui=none      cterm=none
    hi WarningMsg   guifg=#af875f   guibg=NONE      ctermfg=173    ctermbg=NONE      gui=none      cterm=none
    hi WildMenu     guifg=fg        guibg=#005f87   ctermfg=fg     ctermbg=24        gui=none      cterm=none
    hi ColorColumn  guifg=NONE      guibg=#87875f   ctermfg=NONE   ctermbg=101       gui=none      cterm=none
    hi Ignore       guifg=bg                        ctermfg=bg

elseif g:lucius_style == "light"

    hi Normal       guifg=#444444   guibg=#eeeeee   ctermfg=238    ctermbg=255       gui=none      cterm=none
    hi Comment      guifg=#808080   guibg=NONE      ctermfg=244    ctermbg=NONE      gui=none      cterm=none
    hi Constant     guifg=#af5f00   guibg=NONE      ctermfg=130    ctermbg=NONE      gui=none      cterm=none
    hi BConstant    guifg=#af5f00   guibg=NONE      ctermfg=130    ctermbg=NONE      gui=bold      cterm=bold
    hi Identifier   guifg=#008700   guibg=NONE      ctermfg=28     ctermbg=NONE      gui=none      cterm=none
    hi BIdentifier  guifg=#008700   guibg=NONE      ctermfg=28     ctermbg=NONE      gui=bold      cterm=bold
    hi Statement    guifg=#005faf   guibg=NONE      ctermfg=25     ctermbg=NONE      gui=none      cterm=none
    hi BStatement   guifg=#005faf   guibg=NONE      ctermfg=25     ctermbg=NONE      gui=bold      cterm=bold
    hi PreProc      guifg=#008787   guibg=NONE      ctermfg=30     ctermbg=NONE      gui=none      cterm=none
    hi BPreProc     guifg=#008787   guibg=NONE      ctermfg=30     ctermbg=NONE      gui=bold      cterm=bold
    hi Type         guifg=#005f87   guibg=NONE      ctermfg=24     ctermbg=NONE      gui=none      cterm=none
    hi BType        guifg=#005f87   guibg=NONE      ctermfg=24     ctermbg=NONE      gui=bold      cterm=bold
    hi Special      guifg=#870087   guibg=NONE      ctermfg=90     ctermbg=NONE      gui=none      cterm=none
    hi BSpecial     guifg=#870087   guibg=NONE      ctermfg=90     ctermbg=NONE      gui=bold      cterm=bold

    " ## Text Markup ##
    hi Underlined   guifg=fg        guibg=NONE      ctermfg=fg     ctermbg=NONE      gui=underline cterm=underline
    hi Error        guifg=#af0000   guibg=#d7afaf   ctermfg=124    ctermbg=181       gui=none      cterm=none
    hi Todo         guifg=#875f00   guibg=#ffffaf   ctermfg=94     ctermbg=229       gui=none      cterm=none
    hi MatchParen   guifg=NONE      guibg=#5fd7d7   ctermfg=NONE   ctermbg=80        gui=none      cterm=none
    hi NonText      guifg=#afafd7   guibg=NONE      ctermfg=146    ctermbg=NONE      gui=none      cterm=none
    hi SpecialKey   guifg=#afd7af   guibg=NONE      ctermfg=151    ctermbg=NONE      gui=none      cterm=none
    hi Title        guifg=#005faf   guibg=NONE      ctermfg=25     ctermbg=NONE      gui=bold      cterm=bold

    " ## Text Selection ##
    hi Cursor       guifg=bg        guibg=#5f87af   ctermfg=bg     ctermbg=67        gui=none      cterm=none
    hi CursorIM     guifg=bg        guibg=#5f87af   ctermfg=bg     ctermbg=67        gui=none      cterm=none
    hi CursorColumn guifg=NONE      guibg=#dadada   ctermfg=NONE   ctermbg=253       gui=none      cterm=none
    hi CursorLine   guifg=NONE      guibg=#dadada   ctermfg=NONE   ctermbg=253       gui=none      cterm=none
    hi Visual       guifg=NONE      guibg=#afd7ff   ctermfg=NONE   ctermbg=153       gui=none      cterm=none
    hi VisualNOS    guifg=fg        guibg=NONE      ctermfg=fg     ctermbg=NONE      gui=underline cterm=underline
    hi IncSearch    guifg=fg        guibg=#57d7d7   ctermfg=fg     ctermbg=80        gui=none      cterm=none
    hi Search       guifg=fg        guibg=#ffaf00   ctermfg=fg     ctermbg=214       gui=none      cterm=none

    " ## UI ##
    hi Pmenu        guifg=bg        guibg=#808080   ctermfg=bg     ctermbg=fg       gui=none      cterm=none
    hi PmenuSel     guifg=fg        guibg=#afd7ff   ctermfg=fg     ctermbg=153       gui=none      cterm=none
    hi PmenuSbar    guifg=#808080   guibg=#444444   ctermfg=244    ctermbg=238       gui=none      cterm=none
    hi PmenuThumb   guifg=fg        guibg=#9e9e9e   ctermfg=fg     ctermbg=247       gui=none      cterm=none
    hi StatusLine   guifg=bg        guibg=#808080   ctermfg=bg     ctermbg=244       gui=bold      cterm=bold
    hi StatusLineNC guifg=#e4e4e4   guibg=#808080   ctermfg=254    ctermbg=244       gui=none      cterm=none
    hi TabLine      guifg=bg        guibg=#808080   ctermfg=bg     ctermbg=244       gui=none      cterm=none
    hi TabLineFill  guifg=#b2b2b2   guibg=#808080   ctermfg=249    ctermbg=244       gui=none      cterm=none
    hi TabLineSel   guifg=fg        guibg=#afd7ff   ctermfg=fg     ctermbg=153       gui=none      cterm=none
    hi VertSplit    guifg=#e4e4e4   guibg=#808080   ctermfg=254    ctermbg=244       gui=none      cterm=none
    hi Folded       guifg=#626262   guibg=#bcbcbc   ctermfg=241    ctermbg=250       gui=bold      cterm=none
    hi FoldColumn   guifg=#626262   guibg=#bcbcbc   ctermfg=241    ctermbg=250       gui=bold      cterm=none

    " ## Spelling ##
    hi SpellBad     guisp=#d70000                   ctermfg=160    ctermbg=NONE      gui=undercurl cterm=underline
    hi SpellCap     guisp=#00afd7                   ctermfg=38     ctermbg=NONE      gui=undercurl cterm=underline
    hi SpellRare    guisp=#5faf00                   ctermfg=70     ctermbg=NONE      gui=undercurl cterm=underline
    hi SpellLocal   guisp=#d7af00                   ctermfg=178    ctermbg=NONE      gui=undercurl cterm=underline

    " ## Diff ##
    hi DiffAdd      guifg=fg        guibg=#afd7af   ctermfg=fg     ctermbg=151       gui=none      cterm=none
    hi DiffChange   guifg=fg        guibg=#d7d7af   ctermfg=fg     ctermbg=187       gui=none      cterm=none
    hi DiffDelete   guifg=fg        guibg=#d7afaf   ctermfg=fg     ctermbg=181       gui=none      cterm=none
    hi DiffText     guifg=#d75f00   guibg=#d7d7af   ctermfg=166    ctermbg=187       gui=bold      cterm=bold

    " ## Misc ##
    hi Directory    guifg=#00875f   guibg=NONE      ctermfg=29     ctermbg=NONE      gui=none      cterm=none
    hi ErrorMsg     guifg=#af0000   guibg=NONE      ctermfg=124    ctermbg=NONE      gui=none      cterm=none
    hi SignColumn   guifg=#626262   guibg=#d0d0d0   ctermfg=241    ctermbg=252       gui=none      cterm=none
    hi LineNr       guifg=#9e9e9e   guibg=#dadada   ctermfg=247    ctermbg=253       gui=none      cterm=none
    hi CursorLineNr guifg=#9e9e9e   guibg=#dadada   ctermfg=247    ctermbg=253       gui=none      cterm=none
    hi MoreMsg      guifg=#005fd7   guibg=NONE      ctermfg=26     ctermbg=NONE      gui=none      cterm=none
    hi ModeMsg      guifg=fg        guibg=NONE      ctermfg=fg     ctermbg=NONE      gui=none      cterm=none
    hi Question     guifg=fg        guibg=NONE      ctermfg=fg     ctermbg=NONE      gui=none      cterm=none
    hi WarningMsg   guifg=#af5700   guibg=NONE      ctermfg=130    ctermbg=NONE      gui=none      cterm=none
    hi WildMenu     guifg=fg        guibg=#afd7ff   ctermfg=fg     ctermbg=153       gui=none      cterm=none
    hi ColorColumn  guifg=NONE      guibg=#d7d7af   ctermfg=NONE   ctermbg=187       gui=none      cterm=none
    hi Ignore       guifg=bg                        ctermfg=bg

endif

" ## Vimwiki Colors ##
hi link VimwikiHeader1 BIdentifier
hi link VimwikiHeader2 BPreProc
hi link VimwikiHeader3 BStatement
hi link VimwikiHeader4 BSpecial
hi link VimwikiHeader5 BConstant
hi link VimwikiHeader6 BType

" ## Tagbar Colors ##
hi link TagbarAccessPublic Constant
hi link TagbarAccessProtected Type
hi link TagbarAccessPrivate PreProc

" ## Commands ##
command! LuciusLight let g:lucius_style = "light" | colorscheme lucius
command! LuciusDark let g:lucius_style = "dark" | colorscheme lucius
command! LuciusDarkDim let g:lucius_style = "dark_dim" | colorscheme lucius
.vimrc
colorscheme lucius
LuciusDark

"" General
set number
set history=1000
set nocompatible
set modelines=0
set encoding=utf-8
set scrolloff=3
set showmode
set showcmd
set hidden
set wildmenu
set wildmode=list:longest
set cursorline
set ttyfast
set nowrap
set ruler
set backspace=indent,eol,start
set laststatus=2
set clipboard=unnamedplus

"" Dir stuff
set nobackup
set nowritebackup
set noswapfile

"" Relative line numbers for easy movement
set relativenumber
set rnu

"" Whitespace rules
set tabstop=8
set shiftwidth=4
set softtabstop=4
set expandtab

"" Searching
set incsearch
set gdefault

"" Statusbar
set nocompatible "" Disable vi-compatibility
set laststatus=2 "" Always show the statusline

"" Local keys and such
let mapleader=","
let maplocalleader=" "

"" File-type highlighting and configuration.
syntax on
filetype on
filetype plugin on
filetype indent on

"" Paste from clipboard
nnoremap <Leader>, "+gP

"" Copy from clipboard
xnoremap <Leader>. "+y

"" Move cursor by display lines when wrapping
nnoremap j gj
nnoremap k gk

"" Map leader-q to quit out of window
nnoremap <leader>q :q<cr>

"" Move around split
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l

"" Easier to yank entire line
nnoremap Y y$

"" Edit and source vimrc file right from within vim
nnoremap <silent> <Leader>gv :tabnew<CR>:e ~/dotfiles/.vimrc<CR>
nnoremap <silent> <Leader>sv :so ~/dotfiles/.vimrc<CR>

"" Move buffers
nnoremap <tab> :bnext<cr>
nnoremap <S-tab> :bprev<cr>

"" Clears search buffer so highlighting is gone
nmap <silent> ,/ :nohlsearch<CR>

"" Like a boss, sudo AFTER opening the file to write
cmap w!! w !sudo tee % >/dev/null

"" Change cursor on mode
:autocmd InsertEnter * set cul
:autocmd InsertLeave * set nocul

"" Set gui options to hide extra shit we don't need
:set guioptions-=m  "remove menu bar
:set guioptions-=T  "remove toolbar
:set guioptions-=r  "remove right-hand scroll bar
:set guioptions-=L  "remove left-hand scroll bar

if has('gui_running')
    set guifont=Hack
endif

"" --------------------------------------------------------------------------------
"" Plugins
"" --------------------------------------------------------------------------------

"" Start Vim Plug
"" Note: First time need to run :VimPlug Install
call plug#begin('~/.vim/plugged')

"" --------------------------------------------------------------------------------
"" General
"" --------------------------------------------------------------------------------

"" Buffer bar at the top of screen
Plug 'ap/vim-buftabline'

"" Status bar at bottom of screen
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
let g:airline_theme='bubblegum'
let g:airline_powerline_fonts = 1

"" Vim bindings to jump around in the rare tmux session
Plug 'christoomey/vim-tmux-navigator'

call plug#end()

Emacs

Load our literate configuration file, Emacs.org, into the Guix Store and link to final location in ~/.emacs.d. By leveraging the Guix Store we can easily roll-back and manage Emacs config generations via Guix.

Note Guix has great support for Emacs packaging; @todo: Convert Emacs packages over to use Guix.

Activate

This runs after emacs is installed.

# Link our theme so that Emacs can find it
echo -e "${GREEN_TERMINAL_OUTPUT}--> [Emacs] Linking zeroed-theme.el...${CLEAR}" && \
ln -fs ~/.config/emacs/zeroed-theme.el ~/.emacs.d/zeroed-theme.el && \
echo -e "${GREEN_TERMINAL_OUTPUT}--> [Emacs] Emacs.org ready to go.${CLEAR}"

# Write out a basic ~/.emacs file that extracts source blocks
# from Emacs.org after it has been deployed via Guix
echo -e "${GREEN_TERMINAL_OUTPUT}--> [Emacs] Writing org-babel file loader...${CLEAR}" && \
cat <<EOF > ~/.emacs
(package-initialize)
(require 'org-install)
(file-truename (org-babel-load-file "~/.config/emacs/config.org"))
EOF

# Keep one backup around just in case
echo -e "${GREEN_TERMINAL_OUTPUT}--> [Emacs] Removing old config.el...${CLEAR}"
if [[ -f ~/.config/emacs/config.el.bkp ]]; then
    if [[ -f ~/.config/emacs/config.el ]]; then
        mv ~/.config/emacs/config.el ~/.config/emacs/config.el.bkp && \
        rm ~/.config/emacs/config.el.bkp
    fi
else
    mv ~/.config/emacs/config.el ~/.config/emacs/config.el.bkp
fi

Guix Packages

"emacs"

Dotfiles Manifest

"emacs/config.org"
"emacs/zeroed-theme.el"

Dotfiles

emacs/config.org

This file is brought in as part of Makefile target –config-emacs.

emacs/zeroed-theme.el
(require 'autothemer)

(autothemer-deftheme
  zeroed "A theme for my lab."

  ;; Specify terminal types
  ((((class color) (min-colors #xFFFFFF))
    ((class color) (min-colors #xFF)))

   ;; Define color palette
   (zeroed-red "#EC5F67")
   (zeroed-green "#99C794")
   (zeroed-yellow "#FFC247")
   (zeroed-orange "#FA9850")
   (zeroed-blue "#6699CC")
   (zeroed-purple "#C594C5")
   (zeroed-cyan "#5FB3B3")
   (zeroed-light-grey "#C0C5CE")
   (zeroed-dark-grey "#1F2528")
   (zeroed-dark-grey-2 "#1A1F21")
   (zeroed-greyed-out "#2F393D")
   (zeroed-black "#151A1C")
   (zeroed-white "#FFFFFF"))

    ;; Face specifications
   ((default (:foreground zeroed-light-grey :background zeroed-dark-grey))
    (cursor (:background zeroed-light-grey)) ;; Block cursor color
    (mode-line (:background zeroed-dark-grey-2)) ;; Block cursor color
    (region (:foreground zeroed-yellow)) ;; Selection box
    (font-lock-keyword-face (:foreground zeroed-blue))
    (font-lock-comment-face (:foreground zeroed-orange))
    (font-lock-comment-delimiter-face (:foreground zeroed-orange))
    (link (:foreground zeroed-blue :weight 'bold :underline t))
    (org-block (:foreground zeroed-light-grey :background zeroed-dark-grey-2))
    (org-block-begin-line (:foreground zeroed-light-grey :background zeroed-black))
    (org-block-end-line (:foreground zeroed-light-grey :background zeroed-black))
    (org-document-info-keyword (:foreground zeroed-green :weight 'bold))
    (org-document-title (:foreground zeroed-green :weight 'bold))
    (org-level-1 (:foreground zeroed-cyan))
    (org-level-2 (:foreground zeroed-yellow))
    (org-level-3 (:foreground zeroed-blue))
    (org-level-4 (:foreground zeroed-orange))
    (doom-modeline-buffer-modified (:foreground zeroed-red :weight 'bold))
    (org-meta-line (:foreground zeroed-light-grey :weight 'bold :background zeroed-black))
    (org-headline-done (:foreground zeroed-greyed-out :strike-through t))
    (minibuffer-prompt (:foreground zeroed-cyan))
    (org-drawer (:foreground zeroed-blue))
    (org-special-keyword (:foreground zeroed-blue))
    (org-table (:foreground zeroed-purple)))

    ;; Forms after the face specifications are evaluated
    (custom-theme-set-variables 'zeroed
        `(ansi-color-names-vector [,zeroed-red
                                   ,zeroed-green
                                   ,zeroed-yellow
                                   ,zeroed-purple
                                   ,zeroed-yellow
                                   ,zeroed-orange
                                   ,zeroed-cyan])))
   (provide-theme 'zeroed)

Export

We export the various dotfiles and package definitions described throughout this file.

(define-module (dl workstation)
  #:export (%dl-packages-workstation)
  #:export (%dl-dotfiles-workstation))

(define %dl-packages-workstation
  (list
  <<packages-manifest>>
  ))

(define %dl-dotfiles-workstation
  (list
  <<dotfiles-manifest>>
  ))

This is our activation script, built from tangled sections in this file.

#!/bin/bash
<<activate-shell-script>>

Initialization script. Check out Makefile for more info on how this is used.

#!/bin/bash
<<initialize-shell-script>>