Browse Source

Merge branch 'master' of github.com:angrygoats/essentials

master
Taylor Bockman 9 years ago
parent
commit
7b3842db3c
  1. BIN
      backgrounds/blue-black-lines.jpg
  2. BIN
      backgrounds/dark-forest.jpg
  3. BIN
      backgrounds/dark-mesh.jpg
  4. BIN
      current-desktop.png
  5. 11
      dotfiles/Xresources
  6. 5
      dotfiles/config/nvim/init.vim
  7. 1
      dotfiles/nixpkgs/.nixpkgs
  8. 12
      dotfiles/ocamlinit
  9. 8
      dotfiles/xinitrc
  10. BIN
      dotfiles/xmonad/lib/Bar.hi
  11. BIN
      dotfiles/xmonad/lib/Bar.o
  12. BIN
      dotfiles/xmonad/lib/PerWorkspaceDirs.hi
  13. BIN
      dotfiles/xmonad/lib/PerWorkspaceDirs.o
  14. BIN
      dotfiles/xmonad/lib/Spacing.hi
  15. BIN
      dotfiles/xmonad/lib/Spacing.o
  16. BIN
      dotfiles/xmonad/lib/XMonad/Layout/BinarySpacePartition.hi
  17. BIN
      dotfiles/xmonad/lib/XMonad/Layout/BinarySpacePartition.o
  18. BIN
      dotfiles/xmonad/xmonad-x86_64-linux
  19. 26
      dotfiles/xmonad/xmonad.errors
  20. BIN
      dotfiles/xmonad/xmonad.hi
  21. 13
      dotfiles/xmonad/xmonad.hs
  22. BIN
      dotfiles/xmonad/xmonad.o
  23. 76
      dotfiles/zshrc
  24. 11
      nix/audio/default.nix
  25. 7
      nix/comms/default.nix
  26. 53
      nix/configuration.nix
  27. 14
      nix/development/README.md
  28. 46
      nix/development/default.nix
  29. 50
      nix/development/env/python/default.nix
  30. 65
      nix/display/default.nix
  31. 13
      nix/display/terminal.nix
  32. 8
      nix/games/default.nix
  33. 32
      nix/hardware-configuration.nix
  34. 6
      nix/input/default.nix
  35. 13
      nix/input/touchpad.nix
  36. 24
      nix/security/default.nix
  37. 22
      nix/software/default.nix
  38. 11
      nix/users/default.nix
  39. 2
      scripts/lemonbar/bar_start.sh
  40. 85
      scripts/lemonbar/final_bar.sh
  41. 3
      scripts/lemonbar/my_bar.sh
  42. 2
      scripts/sysinit/xmonad_start.sh
  43. 9
      ubuntu/99_physlock_on_hibernate_and_suspend
  44. 71
      ubuntu/README.md
  45. 159
      ubuntu/installer.sh

BIN
backgrounds/blue-black-lines.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 KiB

BIN
backgrounds/dark-forest.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 KiB

BIN
backgrounds/dark-mesh.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
current-desktop.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

11
dotfiles/Xresources

@ -49,7 +49,7 @@ URxvt*loginShell: true
*foreground: S_base0 *foreground: S_base0
*fadeColor: S_base03 *fadeColor: S_base03
*cursorColor: S_base1 *cursorColor: S_base1
*pointerColorBackground:S_base01 pointerColorBackground:S_base01
*pointerColorForeground:S_base1 *pointerColorForeground:S_base1
#define S_yellow #b58900 #define S_yellow #b58900
@ -127,8 +127,6 @@ URxvt.tabbed.title: no
! URxvt.keysym.Control-Left: \033[1;5D ! URxvt.keysym.Control-Left: \033[1;5D
! URxvt.keysym.Control-Right: \033[1;5C ! URxvt.keysym.Control-Right: \033[1;5C
! URxvt doesn't nicely send C-S- to the underlying app so they have to be
! added here as they become necessary.
! URxvt.keysym.C-S-0: ! URxvt.keysym.C-S-0:
Xft.dpi: 96 Xft.dpi: 96
@ -137,12 +135,11 @@ Xft.hinting: 1
Xft.hintstyle: hintslight Xft.hintstyle: hintslight
Xft.rgba: rgb Xft.rgba: rgb
xterm*faceName: Inconsolata xterm*faceName: Inconsolata
xterm*faceSize: 7 7 7 7 7 7 7 xterm*faceSize: 9 9 9 9 9 9 9
!URxvt*font: xft:Liberation Mono-8 !URxvt*font: xft:Liberation Mono-8
!URxvt*boldFont: xft:Liberation Mono:bold !URxvt*boldFont: xft:Liberation Mono:bold
URxvt*font: xft:Inconsolata:size=8:antialias=true:hinting=true URxvt*font: xft:Inconsolata:size=9:antialias=true:hinting=true
URxvt*boldFont: xft:Inconsolata:bold URxvt*boldFont: xft:Inconsolata:size=9:weight=bold:antialias=true:hinting=true
URxvt.letterSpace: -1
URxvt*termName: rxvt-256color URxvt*termName: rxvt-256color
URxvt.iso14755: False URxvt.iso14755: False

5
dotfiles/config/nvim/init.vim

@ -50,6 +50,7 @@ Plug 'mxw/vim-jsx'
Plug 'digitaltoad/vim-jade' Plug 'digitaltoad/vim-jade'
Plug 'wavded/vim-stylus' Plug 'wavded/vim-stylus'
Plug 'raichoo/haskell-vim' Plug 'raichoo/haskell-vim'
Plug 'OCamlPro/ocp-indent'
" Org Mode " Org Mode
Plug 'jceb/vim-orgmode' Plug 'jceb/vim-orgmode'
@ -169,6 +170,10 @@ let g:syntastic_javascript_jsxhint_exec = 'eslint'
" Color customizations " Color customizations
" let g:indentLine_color_term=### " let g:indentLine_color_term=###
" Merlin for OCaml
let g:opamshare = substitute(system('opam config var share'),'\n$','','''')
execute "set rtp+=" . g:opamshare . "/merlin/vim"
" Fugitive bindings " Fugitive bindings
nnoremap <Leader>gs :Gstatus<CR> nnoremap <Leader>gs :Gstatus<CR>
nnoremap <Leader>gd :Gdiff<CR> nnoremap <Leader>gd :Gdiff<CR>

1
dotfiles/nixpkgs/.nixpkgs

@ -0,0 +1 @@
/home/taylor/.nixpkgs

12
dotfiles/ocamlinit

@ -0,0 +1,12 @@
(* Added by OPAM. *)
let () =
try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH")
with Not_found -> ()
;;
#use "topfind";;
#thread;;
#camlp4o;;
#require "async";;
#require "core.top";;
#require "core.syntax";;

8
dotfiles/xinitrc

@ -1,10 +1,8 @@
#!/bin/sh #!/bin/sh
xrdb ~/.Xresources xrdb ~/.Xresources
# zsh ~/.fehbg & compton --config ~/.compton.conf
# exec ~/essentials/scripts/sysinit/xmonad_start.sh feh --bg-scale ~/essentials/backgrounds/dark-forest.jpg
# exec awesome
feh --bg-scale ~/essentials/backgrounds/glass-blue-bg.jpg
xmodmap -e 'clear Lock' xmodmap -e 'clear Lock'
xmodmap -e 'keycode 0x42=Escape' xmodmap -e 'keycode 0x42=Escape'
exec i3 exec ~/essentials/scripts/sysinit/xmonad_start.sh

BIN
dotfiles/xmonad/lib/Bar.hi

Binary file not shown.

BIN
dotfiles/xmonad/lib/Bar.o

Binary file not shown.

BIN
dotfiles/xmonad/lib/PerWorkspaceDirs.hi

Binary file not shown.

BIN
dotfiles/xmonad/lib/PerWorkspaceDirs.o

Binary file not shown.

BIN
dotfiles/xmonad/lib/Spacing.hi

Binary file not shown.

BIN
dotfiles/xmonad/lib/Spacing.o

Binary file not shown.

BIN
dotfiles/xmonad/lib/XMonad/Layout/BinarySpacePartition.hi

Binary file not shown.

BIN
dotfiles/xmonad/lib/XMonad/Layout/BinarySpacePartition.o

Binary file not shown.

BIN
dotfiles/xmonad/xmonad-x86_64-linux

Binary file not shown.

26
dotfiles/xmonad/xmonad.errors

@ -0,0 +1,26 @@
xmonad.hs:132:28: Warning:
In the use of ‘defaultConfig’
(imported from XMonad, but defined in XMonad.Config):
Deprecated: "Use def (from Data.Default, and re-exported by XMonad and XMonad.Config) instead."
xmonad.hs:135:34: Warning:
In the use of ‘defaultPP’ (imported from XMonad.Hooks.DynamicLog):
Deprecated: "Use def (from Data.Default, and re-exported by XMonad.Hooks.DynamicLog) instead."
xmonad.hs:178:49: Warning:
In the use of ‘defaultConfig’
(imported from XMonad, but defined in XMonad.Config):
Deprecated: "Use def (from Data.Default, and re-exported by XMonad and XMonad.Config) instead."
xmonad.hs:203:63: Warning:
In the use of ‘defaultXPConfig’ (imported from XMonad.Prompt):
Deprecated: "Use def (from Data.Default, and re-exported from XMonad.Prompt) instead."
xmonad.hs:241:62: Warning:
In the use of ‘defaultXPConfig’ (imported from XMonad.Prompt):
Deprecated: "Use def (from Data.Default, and re-exported from XMonad.Prompt) instead."
xmonad.hs:242:59: Warning:
In the use of ‘defaultXPConfig’ (imported from XMonad.Prompt):
Deprecated: "Use def (from Data.Default, and re-exported from XMonad.Prompt) instead."

BIN
dotfiles/xmonad/xmonad.hi

Binary file not shown.

13
dotfiles/xmonad/xmonad.hs

@ -161,7 +161,7 @@ scratchpads = [ NS "htop" "urxvt -name htop -e htop" (resource =? "htop") defaul
-- Spawn pipes and menus on boot, set default settings -- Spawn pipes and menus on boot, set default settings
-------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------
myXmonadBar :: String myXmonadBar :: String
myXmonadBar = "lemonbar -f \"-benis-uushi-medium-r-normal--11-90-75-75-p-58-iso10646-1\" -B \"black\" | bash" myXmonadBar = "lemonbar -f \"inconsolata 12\" -B \"#1f1f1f\" | bash"
restartXmonad = "killall lemonbar; cd ~/.xmonad; ghc -threaded xmonad.hs; mv xmonad xmonad-x86_64-linux; xmonad --restart;" restartXmonad = "killall lemonbar; cd ~/.xmonad; ghc -threaded xmonad.hs; mv xmonad xmonad-x86_64-linux; xmonad --restart;"
@ -194,7 +194,7 @@ main = do
`additionalKeys` `additionalKeys`
[((myModMask , xK_q ), spawn restartXmonad) [((myModMask , xK_q ), spawn restartXmonad)
,((myModMask .|. shiftMask , xK_c ), kill) ,((myModMask .|. shiftMask , xK_c ), kill)
,((myModMask .|. shiftMask , xK_b ), spawn "google-chrome-stable") ,((myModMask .|. shiftMask , xK_b ), spawn "chromium-browser")
,((myModMask .|. shiftMask , xK_p ), spawn "mpc prev") ,((myModMask .|. shiftMask , xK_p ), spawn "mpc prev")
,((myModMask .|. shiftMask , xK_n ), spawn "mpc next") ,((myModMask .|. shiftMask , xK_n ), spawn "mpc next")
,((myModMask .|. shiftMask , xK_i ), spawn "xcalib -invert -alter") ,((myModMask .|. shiftMask , xK_i ), spawn "xcalib -invert -alter")
@ -219,6 +219,7 @@ main = do
,((myModMask .|. altMask .|. controlMask , xK_j ), sendMessage $ BSP.MoveSplit D) ,((myModMask .|. altMask .|. controlMask , xK_j ), sendMessage $ BSP.MoveSplit D)
,((myModMask .|. altMask .|. controlMask , xK_k ), sendMessage $ BSP.MoveSplit U) ,((myModMask .|. altMask .|. controlMask , xK_k ), sendMessage $ BSP.MoveSplit U)
,((myModMask .|. altMask .|. controlMask , xK_l ), sendMessage $ BSP.MoveSplit R) ,((myModMask .|. altMask .|. controlMask , xK_l ), sendMessage $ BSP.MoveSplit R)
,((myModMask .|. shiftMask , xK_l ), spawn "physlock -d -u $(logname)")
,((myModMask , xK_p ), moveTo Prev NonEmptyWS) ,((myModMask , xK_p ), moveTo Prev NonEmptyWS)
,((myModMask , xK_n ), moveTo Next NonEmptyWS) ,((myModMask , xK_n ), moveTo Next NonEmptyWS)
,((myModMask , xK_c ), moveTo Next EmptyWS) ,((myModMask , xK_c ), moveTo Next EmptyWS)
@ -252,9 +253,9 @@ main = do
,((0 , xF86XK_Sleep ), spawn "pm-suspend") ,((0 , xF86XK_Sleep ), spawn "pm-suspend")
,((0 , xF86XK_MonBrightnessUp ), spawn "xbacklight -inc 10") ,((0 , xF86XK_MonBrightnessUp ), spawn "xbacklight -inc 10")
,((0 , xF86XK_MonBrightnessDown ), spawn "xbacklight -dec 10") ,((0 , xF86XK_MonBrightnessDown ), spawn "xbacklight -dec 10")
,((0 , xF86XK_AudioMute), spawn "~/scripts/dvol2 -t") ,((0 , xF86XK_AudioMute), spawn "amixer -D pulse -q set Master toggle")
,((0 , xF86XK_AudioLowerVolume), spawn "~/scripts/dvol2 -d 2 & mplayer /usr/share/sounds/freedesktop/stereo/audio-volume-change.oga") ,((0 , xF86XK_AudioLowerVolume), spawn "amixer -D pulse -q set Master 5%-")
,((0 , xF86XK_AudioRaiseVolume ), spawn "~/scripts/dvol2 -i 2 & mplayer /usr/share/sounds/freedesktop/stereo/audio-volume-change.oga") ,((0 , xF86XK_AudioRaiseVolume ), spawn "amixer -D pulse -q set Master 6%+")
] ]
`additionalMouseBindings` `additionalMouseBindings`
[((myModMask, 6), \_ -> moveTo Next NonEmptyWS) [((myModMask, 6), \_ -> moveTo Next NonEmptyWS)
@ -269,7 +270,7 @@ launcherConfig = LauncherConfig { pathToHoogle = "/home/zubin/.cabal/bin/hoogle"
altMask = mod1Mask altMask = mod1Mask
myTerminal :: String myTerminal :: String
myTerminal = "urxvtc" myTerminal = "urxvt"
myBitmapsDir :: String myBitmapsDir :: String
myBitmapsDir = "~/.xmonad/dzen2/" myBitmapsDir = "~/.xmonad/dzen2/"

BIN
dotfiles/xmonad/xmonad.o

Binary file not shown.

76
dotfiles/zshrc

@ -1,5 +1,4 @@
#Portable across both mac and linux now #Portable across both mac and linux now
export ZSH=~/.oh-my-zsh
export LC_ALL=en_US.UTF-8 export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8 export LANG=en_US.UTF-8
if [[ "$OSTYPE" == "linux-gnu" ]]; then if [[ "$OSTYPE" == "linux-gnu" ]]; then
@ -13,19 +12,7 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then
fi fi
export EDITOR="$VISUAL" export EDITOR="$VISUAL"
export ITERM_24BIT=1 export ITERM_24BIT=1
export TERM=rxvt-256color export TERM=xterm-256color
# Colors get weird with Emacs in urxvt. I use urxvt on Linux
# so I need to export rxvt-256color and copy the rxvt-256color terminfo
# to the right location (see package installer for details).
# This will need to be changed if you use a different terminal emulator.
#
# Currently disabled to test automatic terminal detection
#if [[ "$OSTYPE" == "linux-gnu" ]]; then
# export TERM=rxvt-256color
#else
# export TERM=xterm-256color
#fi
alias emacs='emacs -nw' alias emacs='emacs -nw'
alias irssi='TERM=screen-256color irssi' alias irssi='TERM=screen-256color irssi'
@ -36,14 +23,6 @@ alias stoppg='pg_ctl -D /usr/local/var/postgres stop'
# This is for the mac GUI version of emacs. # This is for the mac GUI version of emacs.
alias emacs-gui='open -a /Applications/Emacs.app $1' alias emacs-gui='open -a /Applications/Emacs.app $1'
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
# This is for nix if it exists
if [ -f ~/.nix-profile/etc/profile.d/nix.sh ];
then
source ~/.nix-profile/etc/profile.d/nix.sh
fi
parse_git_branch() { parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
} }
@ -64,16 +43,36 @@ plugins=(git brew npm coffee)
# User configuration # User configuration
export PATH="$PATH:$HOME/.rvm/bin:/usr/lib/rstudio/bin" # Add RVM to PATH for scripting
. ~/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true
# Haskell stuff if [[ "$OSTYPE" == "darwin"* ]]; then
export PATH=~/.cabal/bin:$PATH export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export PATH=.cabal-sandbox/bin:$PATH export PATH="$PATH:$HOME/.rvm/bin:/usr/lib/rstudio/bin" # Add RVM to PATH for scripting
. ~/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true
# Haskell stuff
export PATH=~/.cabal/bin:$PATH
export PATH=.cabal-sandbox/bin:$PATH
# Git Town
export PATH=~/git-town/src:$PATH
MANPATH=$MANPATH:~/git-town/man
# NOTE: 'Whence' is the ZSH idiom for bash's 'type'
export PRENPMPATH=$PATH
if [ -n "$(whence -f npm)" ];
then
NPMPATH="$(npm bin)"
if [ -d "$NPMPATH" ]; then
PATH=$NPMPATH:$PRENPMPATH
else
PATH=$PRENPMPATH
fi
export PATH=$PATH
fi
fi
# Git Town
export PATH=~/git-town/src:$PATH
MANPATH=$MANPATH:~/git-town/man
precmd(){ precmd(){
vcs_info vcs_info
@ -87,17 +86,6 @@ RPROMPT="%{$fg[white]%}\${vcs_info_msg_0_}%{$reset_color%}"
PROMPT="%{$fg[white]%}┌%{$reset_color%}[%{$fg[yellow]%}%n%{$reset_color%}@%{$fg[cyan]%}%m%{$reset_color%}]─[%{$fg[green]%}%d%{$reset_color%}] PROMPT="%{$fg[white]%}┌%{$reset_color%}[%{$fg[yellow]%}%n%{$reset_color%}@%{$fg[cyan]%}%m%{$reset_color%}]─[%{$fg[green]%}%d%{$reset_color%}]
%{$fg[white]%}└─╼%{$reset_color%} " %{$fg[white]%}└─╼%{$reset_color%} "
# NOTE: 'Whence' is the ZSH idiom for bash's 'type' # Run opam init
export PRENPMPATH=$PATH ~/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true
if [ -n "$(whence -f npm)" ]; eval `opam config env`
then
NPMPATH="$(npm bin)"
if [ -d "$NPMPATH" ]; then
PATH=$NPMPATH:$PRENPMPATH
else
PATH=$PRENPMPATH
fi
export PATH=$PATH
fi

11
nix/audio/default.nix

@ -0,0 +1,11 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
pulseaudioFull # Audio
spotify # Spotify
];
hardware = {
pulseaudio.enable = true;
};
}

7
nix/comms/default.nix

@ -0,0 +1,7 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
irssi
skype
];
}

53
nix/configuration.nix

@ -0,0 +1,53 @@
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./display
./audio
./input
./users
./security
./development
./games
./comms
./software
];
# Use the gummiboot efi boot loader.
boot.loader.gummiboot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
nixpkgs.config = {
allowUnfree = true;
};
boot.initrd.luks.devices = [
{ name = "root"; device = "/dev/sda3"; }
];
boot.initrd.luks.cryptoModules = [ "aes" "sha256" "sha1" "cbc" ];
networking.hostName = "ares"; # Define your hostname.
networking.networkmanager.enable = true;
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
i18n = {
consoleFont = "lat9w-16";
consoleKeyMap = "us";
defaultLocale = "en_US.UTF-8";
};
time.timeZone = "US/Pacific";
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Enable CUPS to print documents.
# services.printing.enable = true;
# The NixOS release to be compatible with for stateful data such as databases.
system.stateVersion = "16.03";
}

14
nix/development/README.md

@ -0,0 +1,14 @@
# Development
This directory contains everything needed to get started developing in my nix build. A key feature is the `env` directory
that contains a number of environments used to set up nix shells for isolated development.
## The Nix Shells
Inside `env` are the nix shells I use to develop. These contain specific packages for that language. Common packages across languages are moved into the default.nix file in the `development` directory to save typing.
These shells are designed to get you up and running *quickly* and are not designed to be a perfect fit for any project. For project-based nix shells, you should build them yourself. You're welcome to use the files in `env` as a base.
## Using the Nix Shells
Simply `cd` in `env` and then `cd` into the language folder of your choice. Type `nix-shell --pure` and it will drop you into a configured nix shell you can then use for development. Each language has its own nuances - for example in `python` suggests you setup a `virtualenv` for each project.

46
nix/development/default.nix

@ -0,0 +1,46 @@
{ config, pkgs, ... }:
{
environment = {
# OCaml has trouble finding pthread. So we set PTHREAD_LIBS to give iet a heads up
# ** currently doesnt set PTHREAD_LIBS at all **
variables = {
EDITOR = "nvim";
PTHREAD_CFLAGS = "-I${pkgs.glibc}/include/";
PTHREAD_LIBS = "-L${pkgs.glibc}/lib/";
};
systemPackages = with pkgs; [
bar-xft # Lightweight xcb based bar
cabal-install # Haskell package installer
coreutils # GNU coreutils
cmake # CMake tool
curl # Tool for general HTTP, FTP, etc work
freetype # Library to render fonts required by some packages
gcc # GNU Compiler Collection
ghc # Haskell compiler
glibc # Glibc
gnumake # GNU Make
git # Source control
libev # Event loop library
libpng # PNG library
m4 # GNU Macro Processor
neovim # Better vim
ocaml # OCaml language
ocamlPackages.ocaml_batteries # OCaml batteries included
ocamlPackages.merlin # OCaml editor enhancement
ocamlPackages.findlib # OCaml findlib
ocamlPackages.lambdaTerm # Lambda Term Library
ocamlPackages.ocaml_lwt # OCaml LWT Library - Saves time otherwise spent fighting with opam
ocamlPackages.ocaml_oasis # OASIS Project Architecture Tool for OCaml
ocamlPackages.utop # Much better top-level for OCaml
opam # OCaml package manager
pkgconfig
python3 # Python 3
python34Packages.setuptools # Python setuptools
silver-searcher # Better than grep
vim # Regular ole' vim
wget # Standard GNU package for HTTP, FTP, etc file retrieval
];
};
}

50
nix/development/env/python/default.nix vendored

@ -0,0 +1,50 @@
#A quick-and-dirty environment for nix-shell that gets you started with python34, pip, and virtualenv.
# Simply run nix-shell with the directory that has this file in it to drop into a shell with everything
# you need.
with import <nixpkgs> {};
with pkgs.python3Packages;
buildPythonPackage {
name = "pythonEnv";
buildInputs = [
freetype
gcc # GNU Compiler Collection
gfortran
git # Source control
atlas # ATLAS
blas # BLAS
openblas # OpenBLAS
libxml2 # XML2 library
libxslt # XLST library
libzip # Zip library
liblapack # Linear Algebra pack library
libpng # PNG library
xlibs.libX11 # X11 library
pkgconfig
python3
python3Packages.virtualenv
python3Packages.setuptools
stdenv
which
zlib
zsh # ZSH because I develop in ZSH
];
src = null;
# Environment variables for scipy builds
ATLAS = atlas;
# BLAS = openblas;
# LAPACK = liblapack;
# When used as `nix-shell --pure`
shellHook = ''
unset http_proxy
export GIT_SSL_CAINFO=/etc/ssl/certs/ca-bundle.crt
'';
# used when building environments
extraCmds = ''
unset http_proxy # otherwise downloads will fail ("nodtd.invalid")
export GIT_SSL_CAINFO=/etc/ssl/certs/ca-bundle.crt
'';
}

65
nix/display/default.nix

@ -0,0 +1,65 @@
{config, pkgs, ... }:
{
imports = [
./terminal.nix
];
environment.systemPackages = with pkgs; [
arandr # GUI frontend for xrandr
compton # Windowing system
dmenu # Application launcher
feh # Wallpaper manager
python3Packages.udiskie # Automatically mount USB drives
scrot # Screenshot software
unclutter # Mouse hider
xlibs.xmodmap # keyboard reconfiguration
xmonad-with-packages # Tiling window manager
xorg.xbacklight # Backlight manager
];
# services.xserver.videoDriver =
fonts = {
enableFontDir = true;
enableGhostscriptFonts = true;
fonts = with pkgs; [
corefonts # Microsoft free fonts
freetype # Freetype fonts
inconsolata # Great monospaced font
ubuntu_font_family # Another great font family
unifont # International language support
];
};
services = {
udisks2.enable = true;
xserver = {
enableTCP = false;
exportConfiguration = false;
enable = true;
layout = "us";
displayManager = {
sessionCommands = ''
xset r rate 300 30
unclutter -grab &
udiskie &
feh --bg-fill ~/bgs/dark_night.jpg &
compton --config /dev/null &
'';
};
desktopManager = {
xterm.enable = false;
xfce.enable = false;
};
windowManager = {
xmonad.enable = true;
xmonad.enableContribAndExtras = true;
default = "xmonad";
};
};
};
}

13
nix/display/terminal.nix

@ -0,0 +1,13 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
rxvt_unicode-with-plugins # Terminal emulator
tmux # Terminal multiplexer
tree # Better file tree
zsh # ZShell
xclip # Command line clipboard tool
];
programs.zsh.enable = true;
}

8
nix/games/default.nix

@ -0,0 +1,8 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
nethack
steam
# tibia
];
}

32
nix/hardware-configuration.nix

@ -0,0 +1,32 @@
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }:
{
imports =
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.kernelModules = [ "fbcon" "kvm_intel" ]; # kvm_intel is disabled on the t440s
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/mapper/vg-root";
fsType = "ext4";
};
fileSystems."/boot" =
{
mountPoint = "/boot";
device = "/dev/sda2";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/mapper/vg-swap"; }
];
nix.maxJobs = 8;
}

6
nix/input/default.nix

@ -0,0 +1,6 @@
{ config, pkgs, ... }:
{
imports = [
./touchpad.nix
];
}

13
nix/input/touchpad.nix

@ -0,0 +1,13 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
xorg.xf86inputsynaptics
];
services.xserver = {
synaptics = {
enable = true;
twoFingerScroll = true;
};
};
}

24
nix/security/default.nix

@ -0,0 +1,24 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
physlock
];
# Set sudo to use user home
security.sudo.extraConfig = ''
Defaults !always_set_home
Defaults env_keep+="HOME"
'';
services = {
# Configure physlock
physlock = {
enable = true;
user = "taylor";
lockOn = {
suspend = true;
hibernate = true;
};
};
};
}

22
nix/software/default.nix

@ -0,0 +1,22 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
byzanz # Screen recording software
calibre # Ebook reader
chromium # Browser
gtk # For GTK+ themes
htop # System monitor
libreoffice # Libreoffice
mplayer # Video player
nox # Better nix package search
unzip # Unzipper
xdotool # Diagnostic tool for mouse and keyboard
];
nixpkgs.config = {
chromium = {
enablePepperFlash = true;
enablePepperPdf = true;
};
};
}

11
nix/users/default.nix

@ -0,0 +1,11 @@
{ config, pkgs, ... }:
{
users.extraUsers.taylor = {
isNormalUser = true;
home = "/home/taylor";
description = "taylor";
extraGroups = [ "wheel" "networkmanager" ];
shell = "/run/current-system/sw/bin/zsh";
uid = 1000;
};
}

2
scripts/lemonbar/bar_start.sh

@ -1,2 +1,4 @@
#!/bin/bash
sleep 1 sleep 1
~/essentials/scripts/lemonbar/final_bar.sh | ~/essentials/scripts/lemonbar/my_bar.sh | bash ~/essentials/scripts/lemonbar/final_bar.sh | ~/essentials/scripts/lemonbar/my_bar.sh | bash

85
scripts/lemonbar/final_bar.sh

@ -1,50 +1,56 @@
#!/bin/sh #!/usr/bin/env bash
#
# z3bra - (c) wtfpl 2014 # z3bra - (c) wtfpl 2014
# Fetch infos on your computer, and print them to stdout every second. # Fetch infos on your computer, and print them to stdout every second.
# Also takes content from window manager to build bar
# ICONS
wifi_icon=''
cpu_icon=''
ram_icon=''
speaker_icon=''
plug_icon=''
thunderbolt_icon=''
clock_icon=''
clock() { clock() {
date '+%Y-%m-%d %H:%M' date=$(date '+%Y-%m-%d %H:%M')
echo "%{F#FFFFFFFF}$clock_icon $date%{F#FF6A9FB5}"
} }
battery() { battery() {
BATC=/sys/class/power_supply/BAT0/capacity BATC=/sys/class/power_supply/BAT0/capacity
BATS=/sys/class/power_supply/BAT0/status BATS=/sys/class/power_supply/BAT0/status
test "`cat $BATS`" = "Charging" && echo -n '+' || echo -n '-' cap="$(sed -n p $BATC)"
green_decimal=$((128 + (128 * $cap) / 101))
red_decimal=$((128 + (128 * (100 - $cap)) / 101))
red_hex=$(echo "obase=16; $red_decimal" | bc)
green_hex=$(echo "obase=16; $green_decimal" | bc)
test "`cat $BATS`" = "Charging" && echo -n "%{F#FFFFFFFF}$plug_icon " || echo -n "%{F#FFFFFF00}$thunderbolt_icon "
sed -n p $BATC echo "%{F#FF${red_hex}${green_hex}80}$cap%%{F#FF6A9FB5}"
} }
volume() { volume() {
amixer get Master | grep -P -o '\[[0-9]+%\]' volume=$(amixer -D pulse get Master | grep -P -o '\[[0-9]+%\]')
echo "%{F#FFC2A366}$speaker_icon $volume%{F#FF6A9FB5}"
} }
cpuload() { cpuload() {
LINE=`ps -eo pcpu |grep -vE '^\s*(0.0|%CPU)' |sed -n '1h;$!H;$g;s/\n/ +/gp'` LINE=`ps -eo pcpu |grep -vE '^\s*(0.0|%CPU)' |sed -n '1h;$!H;$g;s/\n/ +/gp'`
bc <<< $LINE cpu=$(bc <<< $LINE)
echo "%{F#FF94FF70}$cpu_icon $cpu%%{F#FF6A9FB5}"
} }
memused() { memused() {
free -m | head -n 2 | tail -n 1 | awk '{printf("%2.1fG/%0.2gG\n" ,($3/1024),($2/1024))}' mem=$(free -m | head -n 2 | tail -n 1 | awk '{printf("%2.1fG/%0.2gG\n" ,($3/1024),($2/1024))}')
echo "%{F#FF80E6FF}$ram_icon $mem%{F#FF6A9FB5}"
} }
network() { wifi() {
read -d '' lo int1 int2 <<< $(ip link | sed -n 's/^[0-9]: \(.*\):.*$/\1/p') current_wifi=$(nmcli -t --fields NAME con show --active)
if iwconfig $int1 >/dev/null 2>&1; then echo "%{F#FFB8D4DC}$wifi_icon $current_wifi%{F#FF6A9FB5} |"
wifi=$int1
eth0=$int2
else
wifi=$int2
eth0=$int1
fi
ip link show $eth0 | grep 'state UP' >/dev/null && int=$eth0 || int=$wifi
ping -c 1 8.8.8.8 >/dev/null 2>&1 &&
echo "$int connected" || echo "$int disconnected"
#int=eth0
} }
groups() { groups() {
@ -61,16 +67,29 @@ groups() {
alsamixer='xdotool key super+F10' alsamixer='xdotool key super+F10'
htop='xdotool key super+F9' htop='xdotool key super+F9'
# This loop will fill a buffer with our infos, and output it to stdout. # This loop will fill a buffer with our infos, and output it to stdout.
while :; do function build_status {
buf="%{r}%{F#FF6A9FB5}" buf="%{r}%{F#FF6A9FB5}"
buf="${buf} %{A:$htop:}⮡ $(cpuload)%% " buf="${buf} $(wifi)"
buf="${buf} | ⮡ $(memused)%{A}" buf="${buf} $(cpuload) |"
buf="${buf} | $(network) " buf="${buf} $(memused) |"
buf="${buf} |%{A:$alsamixer:} ⮞ $(volume)%%%{A}" buf="${buf} $(volume) |"
buf="${buf} | ⮡$(battery)%{A}" buf="${buf} $(battery) |"
buf="${buf} |%{A:gsimplecal&:} ⮖ $(clock)%{A}" buf="${buf} $(clock)"
echo $buf echo $buf
# use `nowplaying scroll` to get a scrolling output! }
sleep 0.5 # The HUD will be updated every second
while true; do
read -t 0.25 new_wm_content
if [ -n "$new_wm_content" ]; then
wm_content="$new_wm_content"
fi
status_content="$(build_status)"
combined_content="$wm_content$status_content"
echo "$combined_content"
sleep 0.1
done done

3
scripts/lemonbar/my_bar.sh

@ -1,2 +1 @@
back="#00000000" lemonbar -B "#1f1f1f" -g "800x14+1118+1"
lemonbar -f "-benis-uushi-medium-r-normal--11-90-75-75-p-58-iso10646-1" -B "black" -g "800x14+1118+1"

2
scripts/sysinit/xmonad_start.sh

@ -17,5 +17,5 @@ xset r rate 300 30
unclutter -grab & unclutter -grab &
tmux start-server tmux start-server
pulseaudio -D pulseaudio -D
wmname LG3D wmname compton
xmonad xmonad

9
ubuntu/99_physlock_on_hibernate_and_suspend

@ -0,0 +1,9 @@
#!/bin/bash
case "$1" in
# suspend|hibernate)
# ;;
resume|thaw)
physlock -d &
;;
esac

71
ubuntu/README.md

@ -0,0 +1,71 @@
# Ubuntu Install
![desktop screenshot](../current-desktop.png?raw=true "Current Desktop")
By running the installer it wipes a complete install and turns it into something more minimal and less resource
intensive. An alternative would've been to start with the Ubuntu minimal disk and work up, but the full Ubuntu ISO comes with some conveniences that I wanted to keep. Kit includes:
- Compton
- Xmonad
- Dmenu
- Lemonbar
- Urxvt
- Physlock
- feh
- zsh
It also substitutes Ubuntu's stock media players with less resource intensive alternatives such as `mplayer` and
`ffmpeg`.
*NOTE:* After rebooting you will boot into a black screen. See the section on GRUB for details. To get to a login
screen press `ctrl + alt + f1` and login normally.
## X Server
To start Xmonad simply type `startx` at the tty.
Make sure Xresources and Xinitrc are symlinked properly in your home directory. If you have any problems getting
Xmonad to start, check the logs, and then those two files.
To Kill the server at any time press `alt + shift + q`.
### Xmonad Hotkeys
Here are some hotkeys to get you started:
* `mod4 + shift + q`: Kill X server
* `mod4 + q`: Recompile Xmonad
* `mod4 + w`: Move window up
* `mod4 + s`: Move window down
* `mod4 + a`: Move window left
* `mod4 + d`: Move window right
* `mod4 + enter`: Spawn a new window
* `mod4 + space`: Launch dmenu
* `mod4 + h`: Shift focus left
* `mod4 + j`: Shift focus down
* `mod4 + k`: Shift focus up
* `mod4 + l`: Shift focus right
* `mod4 + <1...9>`: Change to nth workspace
* `mod4 + t`: Retile windows
* `mod4 + shift + c`: Close currently focused window
## GRUB
A small change has to be applied to stop Ubuntu from booting into a non-existent display manager's login screen:
1. Type `sudo nano /etc/default/grub`
2. Find `GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"`
3. Replace (2) with `GRUB_CMDLINE_LINUX_DEFAULT="text"`
4. Run `sudo upgrade-grub`
This will force Ubuntu to boot into a tty. To start Ubuntu type `startx` in any tty.
## Changing Desktop Backgrounds
Inside of `~/.xinitrc` is a line that starts with `feh`. Change the image being passed into this
to change the desktop background. Kill the xserver with `alt + shift + q` and `startx` again.
## TODO
1. Have installer script `git clone` essentials and symlink everything correctly.
2. Have installer automatically modify the grub config to set up text login mode.

159
ubuntu/installer.sh

@ -0,0 +1,159 @@
# Simple script to get an ubuntu system up and running
# Tested on Ubuntu 16.04 LTS
echo "======== UBUNTU AUTO-INSTALL SCRIPT ========"
echo "Checking for internet connection..."
nc -z 8.8.8.8 53 >/dev/null 2>&1
online=$?
if [ $online -ne 0 ]; then
echo "No internet connection detected! Please enable an internet connection before continuing."
exit
fi
# Pre-setup
echo "Running pre-setup..."
sudo add-apt-repository ppa:neovim-ppa/unstable
sudo apt-add-repository -y "deb http://repository.spotify.com stable non-free"
sudo apt-add-repository -y ppa:richardgv/compton
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D2C19886
sudo dpkg --add-architecture i386
sudo add-apt-repository ppa:wine/wine-builds
sudo apt-get -qq -y update
sudo apt-get -qq -y upgrade
# Window Manager
echo "Installing window manager..."
sudo apt-get -qq -y install xmonad
sudo apt-get -qq -y install compton
sudo apt-get -qq -y install libghc-xmonad-contrib-dev
sudo apt-get -qq -y install xorg
sudo apt-get -qq -y install xinit
sudo apt-get -qq -y install wmname
sudo apt-get -qq -y install libxcb-xinerama0-dev
sudo apt-get -qq -y install libxcb-randr0-dev
sudo apt-get -qq -y install xbacklight
# Build and install lemonbar from source
echo "Installing lemonbar from source..."
pushd
cd ~
git clone https://github.com/LemonBoy/bar.git
cd bar/
make
sudo make install
popd
# Dmenu
echo "Installing Dmenu..."
sudo apt-get -qq -y install suckless-tools
# Languages
echo "Installing languages and tools..."
sudo apt-get -qq -y install python-dev
sudo apt-get -qq -y install python-pip
sudo apt-get -qq -y install python3-dev
sudo apt-get -qq -y install python3-pip
sudo apt-get -qq -y install python3-setuptools
sudo apt-get -qq -y install m4
sudo apt-get -qq -y install ocaml
sudo apt-get -qq -y install aspcud
sudo apt-get -qq -y install liblapack-dev
sudo apt-get install --install-recommends winehq-devel
wget https://raw.github.com/ocaml/opam/master/shell/opam_installer.sh -O - | sh -s /usr/local/bin
# Editors
echo "Installing editors..."
sudo apt-get -qq -y install vim
sudo apt-get -qq -y install neovim
echo "Installing python tools for neovim..."
sudo pip install neovim
# Terminals
echo "Installing terminal..."
sudo apt-get -qq -y rxvt-unicode
# Shell
echo "Installing shells..."
sudo apt-get -qq -y install zsh
echo "Changing shell to zsh..."
chsh -s $(which zsh)
# Source Control
echo "Installing source control..."
sudo apt-get -qq -y install git
# Remove Unity (This has to be done here so we can reinstall what unity removes)
echo "Removing Unity..."
sudo apt-get -qq -y purge unity
# Multimedia
echo "Installing multimedia..."
sudo apt-get -qq -y install ffmpeg
sudo apt-get -qq -y install mplayer
sudo apt-get -qq -y install spotify-client
sudo apt-get -qq -y install pepperflashplugin-nonfree
# Tools
echo "Installing tools..."
sudo apt-get -qq -y install transmission
sudo apt-get -qq -y install htop
sudo apt-get -qq -y install scrot
sudo apt-get -qq -y install tmux
sudo apt-get -qq -y install feh
sudo apt-get -qq -y install unclutter
sudo apt-get -qq -y install xdotool
sudo apt-get -qq -y install cmake
sudo apt-get -qq -y install gsimplecal
sudo apt-get -qq -y install xclip
# Comms
echo "Installing comms..."
sudo apt-get -qq -y install irssi
sudo apt-get -qq -y install skype
# Browsers
echo "Installing browsers..."
sudo apt-get -qq -y install chromium-browser
# Fonts
echo "Installing fonts..."
sudo apt-get -qq -y install fonts-inconsolata
fc-cache --really-force -v
# Security
echo "Installing security..."
sudo apt-get -qq -y install physlock
# Cleanup
echo "Cleaning up unneccessary programs..."
sudo apt-get -qq -y purge firefox
sudo apt-get -qq -y purge rhythmbox
sudo apt-get -qq -y purge cheese
sudo apt-get -qq -y purge shotwell
sudo apt-get -qq -y purge shotwell-common
sudo apt-get -qq -y purge thunderbird
sudo apt-get -qq -y purge aisleriot
sudo apt-get -qq -y purge webbrowser-app
sudo apt-get -qq -y purge gnome-sudoku
sudo apt-get -qq -y purge mahjongg
sudo apt-get -qq -y purge gnomine
sudo apt-get -qq -y purge ace-of-penguins
sudo apt-get -qq -y purge onboard
sudo apt-get -qq -y purge lightdm
sudo apt-get -qq -y purge gnome-terminal
sudo apt-get -qq -y purge gnome-terminal-data
sudo apt -qq -y autoremove
# Right here is where the sed one-line would go to replace
# "quiet splash" with "text" in the grub config and then call
# sudo update grub. This eliminates Ubuntu getting stuck trying
# to boot a login screen that doesn't exist by dropping you
# straight into a tty.
echo "!!! DONE INSTALLING !!!"
echo "======== REBOOTING IN 30 SECONDS ========"
sleep 30
sudo reboot
Loading…
Cancel
Save