Skip to content

Instantly share code, notes, and snippets.

@tinti
Forked from terlar/README.markdown
Last active August 29, 2015 14:21
Show Gist options
  • Save tinti/2d76775a47dc7923bbc2 to your computer and use it in GitHub Desktop.
Save tinti/2d76775a47dc7923bbc2 to your computer and use it in GitHub Desktop.

ArchLinux on MacBook Retina 13"

Info

Resources

Hardware

Further info: lspci, lsmod, lsblk -f.

  • Model: MacBookPro10,2
  • Boot ROM: MBP102.0106.B03
  • Graphics: Intel 3rd Gen Core processor Graphics Controller (rev 09)
  • Wireless: BCM4331

Bootstrap

mkdir /mnt/setup
mount /dev/sdx /mnt/setup
pacman -U /mnt/setup/broadcom-wl-6.30.223.141-8-x86_64.pkg.tar.xz
modprobe -r wl
modprobe wl

wifi-menu
cgdisk /dev/sda

mkfs.ext4 /dev/sda5
mkfs.ext4 /dev/sda6
mkfs.ext4 /dev/sda7

mount /dev/sda6 /mnt
mkdir /mnt/boot && mount /dev/sda5 /mnt/boot
mkdir /mnt/home && mount /dev/sda7 /mnt/home

# cryptsetup -c aes-xts-plain64 -y -s 512 luksFormat /dev/sda7
# cryptsetup luksOpen /dev/sda7 home
# mkfs.ext4 /dev/mapper/home
# mkdir /mnt/home && mount /dev/mapper/home /mnt/home
# echo 'home  /dev/sda7' >> /mnt/etc/crypttab

pacstrap /mnt base base-devel
genfstab -p /mnt >> /mnt/etc/fstab
# SSD optimize /etc/fstab

arch-chroot /mnt /bin/bash
echo name > /etc/hostname
ln -s /usr/share/zoneinfo/Europe/Stockholm /etc/localtime

vi /etc/locale.gen
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8

mkinitcpio -p linux

# Bootloader
pacman -S grub
vi /etc/default/grub
# GRUB_CMDLINE_LINUX_DEFAULT="splash loglevel=3 rootflags=data=writeback libata.force=noncq"

grub-mkconfig -o /boot/grub/grub.cfg
grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi /boot/grub/grub.cfg

cp boot.efi /mnt/setup

pacman -S linux-headers
pacman -U /media/backup/broadcom-wl-6.30.223.141-8-x86_64.pkg.tar.xz
# Setup Wi-Fi

Install

Basic Tools

sudo pacman -S alsa-utils powertop htop iotop iftop ncdu acpi pv smartmontools dnsutils net-tools cdrkit
sudo pacman -S gvim bc openssh unzip unrar tree ranger vimpager time reptyr

sudo systemctl enable sshd

Build

sudo pacman -S base-devel cmake python3 git
Aura (AUR)

/etc/pacman.conf

[haskell-core]
Server = http://xsounds.org/~haskell/core/$arch
sudo pacman-key -r 4209170B
sudo pacman-key --lsign-key 4209170B
sudo pacman -Syy

pacman -S ghc

curl -O https://aur.archlinux.org/packages/au/aura/aura.tar.gz
tar -xzf aura.tar.gz && cd aura
makepkg -s
sudo pacman -U aura-*.pkg.tar.xz

sudo aura -A powerpill hub-git

Drivers

sudo systemctl enable systemd-networkd

sudo pacman -S acpid xf86-video-intel
sudo systemctl enable acpid

sudo aura -A broadcom-wl xf86-input-mtrack-git macfanctld-git
sudo systemctl enable macfanctld

sudo pacman -S bluez bluez-libs bluez-utils

amixer sset Master unmute
amixer -c 0 sset IEC958 off

Create the file /etc/modprobe.d/alsa-base.conf with the content options snd-hda-intel model=mbp101.

Caps2Ctrl

Edit the file us_caps2ctrl.map after creation with keycode 58 = Control.

sudo mkdir -p /usr/share/keymaps
dumpkeys > us_caps2ctrl.map
gzip us_caps2ctrl.map
sudo mv us_caps2ctrl.map.gz /usr/share/keymaps

Create the file /etc/vconsole.conf with content: KEYMAP=/usr/share/keymaps/us_caps2ctrl.map

Tools

sudo pacman -S pwgen
sudo aura -A kbdlight

Wi-Fi

ln -s /run/systemd/network/resolv.conf /etc/resolv.conf
# create /etc/wpa_supplicant.conf
ln -s /etc/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant-wlp3s0.conf
# create /etc/systemd/network/20-dhcp.network
sudo pacman -S wpa_supplicant
sudo systemctl enable systemd-networkd
sudo systemctl enable wpa_supplicant@wlp3s0

iPhone Tethering

sudo aura -A libusbmuxd-git libimobiledevice-git usbmuxd-git ifuse-git
modprobe ipheth
idevicepair pair

Printer

sudo pacman -S cups gutenprint ghostscript

Scanner

sudo pacman -S sane

fish

sudo aura -A fish-shell-git stderred-git

SSH-Agent

sudo aura -A envoy-git
sudo systemctl enable [email protected]

User

chsh -s /usr/bin/fish
usermod -a -G audio video lpadmin username
dotfiles
hub clone terlar/dotfiles ~/.dotfiles
cd ~/.dotfiles
fish install.fish

GUI

Xorg
sudo pacman -S xorg-server xorg-server-utils xorg-xev
sudo pacman -S i3lock xfce4-notifyd xsel zenity xdg-tools
sudo aura -A dmenu-xft
Xmonad
sudo pacman -S haskell-xmonad haskell-xmonad-contrib haskell-xmonad-extras cabal-install
sudo aura -A xmonad-utils
cabal update; and cabal install yeganesh
Fonts
sudo pacman -S ttf-dejavu ttf-symbola ttf-droid
sudo pacman -S adobe-source-code-pro-fonts ttf-linux-libertine ttf-ubuntu-font-family ttf-freefont wqy-zenhei
sudo aura -A freetype2-infinality fontconfig-infinality
sudo aura -A ttf-vista-fonts ttf-mac-fonts ttf-envy-code-r ttf-opensans
sudo infctl setstyle osx2
Theme
sudo pacman -S lxappearance
sudo aura -A gtk-theme-numix-git gtk-theme-numix-white
Input
sudo pacman -S fcitx-im fcitx-configtool
User services
aura -A xlogin-git

systemctl --user enable pulseaudio
systemctl --user enable tmux
systemctl --user enable dropbox

systemctl --user enable xmonad@0
systemctl --user enable termite@0

systemctl --user enable wallpaper@0
systemctl --user enable xmodmap@0
systemctl --user enable xset@0
systemctl --user enable xsetroot@0
systemctl --user enable fcitx@0

systemctl --user enable [email protected]

Apps

sudo pacman -S imagemagick scrot feh mosh weechat mutt lftp rtorrent zathura zathura-pdf-poppler baobab chromium flashplugin deluge
sudo aura -A termite dropbox tmux-git luakit-git nexuspersonal spotify
gem install termit
Documents

sudo pacman -S unrtf haskell-pandoc

Media
sudo pacman -S mplayer shotwell
sudo aura -A google-talkplugin
Mopidy
sudo pacman -S ncmpcpp
sudo aura -A mopidy mopidy-scrobbler mopidy-spotify mopidy-soundcloud
Plex

/etc/pacman.conf

[alucryd]
SigLevel = Optional
Server = http://pkgbuild.com/~alucryd/$repo/$arch
sudo pacman -S plex-home-theater-git
AirPort
sudo pacman -S avahi nss-mdns pulseaudio pulseaudio-alsa paprefs pavucontrol
Network
sudo pacman -S afpfs-ng sshfs

Mail

sudo pacman -S offlineimap msmtp sqlite w3m
sudo aura -A mime-support

Development

sudo pacman -S ctags gcolor2 python2-pygments
sudo aura -A ruby-build-git silver-searcher-git elixir
sudo pacman -S memcached varnish java-runtime elasticsearch mongodb redis mysql

sudo elasticsearch-plugin -i elasticsearch/marvel/latest
sudo elasticsearch-plugin -i karmi/elasticsearch-paramedic
sudo elasticsearch-plugin -i lmenezes/elasticsearch-kopf
sudo elasticsearch-plugin -i royrusso/elasticsearch-HQ

sudo pacman -S virtualbox qt4
sudo aura -A unarchiver
curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | env IEVMS_VERSIONS="6" bash
Pair
sudo aura -A wemux tmate
fish plugins
cd ~/code

git clone terlar/fish-tank; and cd fish-tank
sudo make install; and cd ..

git clone terlar/fry; and cd fry
sudo make install; and cd ..

git clone terlar/fish-farm; and cd fish-farm
sudo make install; and cd ..
ruby
fry install 1.9.3-p392
fry install 2.0.0-p247
gem install bundler pry awesome_print mailcatcher fury structure_digest pssh
web
sudo pacman -S nginx
prax (zero-conf Rack proxy server)
git clone -p ysbaddaden/prax /opt/prax
sudo cp ~/.prax-dist/install/initd /usr/local/bin/praxd
sudo chmod +x /usr/local/bin/praxd

cd /opt/prax/ext
sudo make install

Create /usr/lib/systemd/system/prax.service.

[Unit]
Description=Prax Rack server (iptables configuration)
Requires=network.target remote-fs.target
After=network.target remote-fs.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/praxd start
ExecStop=/usr/local/bin/praxd stop
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Add prax to the end of the host line in /etc/nsswitch.conf.

Performance

Power

sudo pacman -S laptop-mode-tools cpupower pm-utils upower
sudo aura -A profile-sync-daemon anything-sync-daemon granola uswsusp-git
sudo systemctl enable laptop-mode
sudo systemctl enable cpupower
sudo systemctl enable granola
sudo systemctl enable psd
sudo systemctl enable psd-resync
sudo systemctl enable asd
sudo systemctl enable asd-resync
  • Edit /etc/laptop-mode/laptop-mode.conf with value LM_BATT_MAX_LOST_WORK_SECONDS=15
  • Edit /etc/laptop-mode/conf.d/usb-autosuspend.conf with value AUTOSUSPEND_TIMEOUT=1
  • Edit /etc/laptop-mode/conf.d/intel-hda-powersave.conf with value INTEL_HDA_DEVICE_TIMEOUT=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment