summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Pearce2019-10-01 21:24:50 +0200
committerAlan Pearce2019-10-01 22:17:40 +0200
commitd0200a6b07e497d07dff2cfe0857f4dceb724b58 (patch)
tree55e43bfb932b298a6c16a3e892c8cef0451d377a
parent75166a4de865570f27c074c82e47168ac8630f83 (diff)
downloaddotfiles-d0200a6b07e497d07dff2cfe0857f4dceb724b58.tar.xz
dotfiles-d0200a6b07e497d07dff2cfe0857f4dceb724b58.zip
Prepare for home-manager migration
-rw-r--r--.gitignore11
-rw-r--r--README.org51
-rwxr-xr-xinstall.sh20
-rwxr-xr-xunstow-all11
4 files changed, 38 insertions, 55 deletions
diff --git a/.gitignore b/.gitignore
index e9fa055..3de0997 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1 @@
1# Emacs files home.nix
2*~
3.#*
4
5# Byte-compiled files
6*.zwc
7*.zwc.old
8.DS_Store
9*.elc
10flycheck_*
diff --git a/README.org b/README.org
index 6c85344..02a3a1f 100644
--- a/README.org
+++ b/README.org
@@ -1,50 +1,20 @@
1* Dotfiles 1* Nixfiles
2 2
3I've organised this repository with [[https://www.gnu.org/software/stow/][GNU Stow]]. It focuses on [[http://zsh.sourceforge.net][Z Shell]] and 3I've organised this repository with [[https://rycee.gitlab.io/home-manager/][Home Manager]]. It focuses on [[http://zsh.sourceforge.net][Z
4[[http://emacs.sexy][Emacs]]. 4Shell]] and [[http://emacs.sexy][Emacs]].
5 5
6It doesn't use any configuration frameworks, just packages installed 6It doesn't use any configuration frameworks, just packages installed
7via package managers. For Z shell I use [[https://github.com/zdharma/zplugin][zplugin]] and for Emacs I use the 7via package managers. For Z shell I use [[https://github.com/zdharma/zplugin][zplugin]] and for Emacs I use the
8built-in package.el via [[https://github.com/jwiegley/use-package][use-package]]. 8built-in package.el via [[https://github.com/jwiegley/use-package][use-package]].
9 9
10I've included a wrapper script for =stow= which sets the target
11directory to =$HOME=, instead of =../=. This allows the repository to
12be cloned anywhere, instead of following the =stow= convention of
13being one level below the target directory.
14
15It should work on: 10It should work on:
16- Linux 11- Linux
17- OSX 12- macOS
18- FreeBSD
19- Windows/Ubuntu
20 13
21** Installation 14** Installation
22 15
23Clone the project anywhere, e.g. with [[https://github.com/motemen/ghq][ghq]] 161. If migrating from a stow version, run =migrate.sh=.
24 172. Run =install.sh=.
25#+BEGIN_SRC sh :exports code
26ghq get git://git.alanpearce.eu/dotfiles
27ghq look git.alanpearce.eu/dotfiles
28#+END_SRC
29
30Or just with normal git
31
32#+BEGIN_SRC sh :exports code
33git clone git://git.alanpearce.eu/dotfiles ~/projects/alanpearce-dotfiles
34#+END_SRC
35
36Installing a set of dotfiles with =stow= is simple. For example, with
37Emacs:
38
39#+BEGIN_SRC sh :exports code
40./stow -S emacs
41#+END_SRC
42
43And then to uninstall
44
45#+BEGIN_SRC sh :exports code
46./stow -D emacs
47#+END_SRC
48 18
49*** Z Shell 19*** Z Shell
50 20
@@ -54,12 +24,3 @@ My zsh configuration uses [[https://github.com/zdharma/zplugin][zplugin]]. I've
54./zsh/config/zsh/setup.sh 24./zsh/config/zsh/setup.sh
55#+END_SRC 25#+END_SRC
56 26
57*** Emacs
58
59I use org-mode for my Emacs init file. To simplify setup, I created a
60[[file:emacs/.emacs.d/Makefile][Makefile]].
61
62#+BEGIN_SRC sh :exports code
63cd ~/.emacs.d/
64make
65#+END_SRC
diff --git a/install.sh b/install.sh
new file mode 100755
index 0000000..8e0ca70
--- /dev/null
+++ b/install.sh
@@ -0,0 +1,20 @@
1#!/bin/sh
2
3set -eu
4
5if [ -z "$1" ]
6then
7 echo "Usage: $0 <machine-file.nix>"
8 exit 1
9fi
10
11NIXDIR="$HOME/.config/nixpkgs"
12
13if [ ! -f "$1" ]
14then
15 echo "$1 does not exist"
16 exit 1
17fi
18
19ln -s $PWD $NIXDIR
20ln -s $1 home.nix
diff --git a/unstow-all b/unstow-all
new file mode 100755
index 0000000..3e56fd3
--- /dev/null
+++ b/unstow-all
@@ -0,0 +1,11 @@
1#!/usr/bin/env zsh
2
3set -euo pipefail
4
5echo "Checking if all packages can be unstowed"
6./stow -Dn --ignore="tabnine_config\.json" *(/)
7
8echo "Unstowing!"
9./stow -D --ignore="tabnine_config\.json" *(/)
10
11rmdir ~/.config/nixpkgs || echo "Could not remove nixpkgs directory. Remove it manually before running the installer."