From d0200a6b07e497d07dff2cfe0857f4dceb724b58 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 1 Oct 2019 21:24:50 +0200 Subject: Prepare for home-manager migration --- .gitignore | 11 +---------- README.org | 51 ++++++--------------------------------------------- install.sh | 20 ++++++++++++++++++++ unstow-all | 11 +++++++++++ 4 files changed, 38 insertions(+), 55 deletions(-) create mode 100755 install.sh create mode 100755 unstow-all diff --git a/.gitignore b/.gitignore index e9fa055..3de0997 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1 @@ -# Emacs files -*~ -.#* - -# Byte-compiled files -*.zwc -*.zwc.old -.DS_Store -*.elc -flycheck_* +home.nix diff --git a/README.org b/README.org index 6c85344..02a3a1f 100644 --- a/README.org +++ b/README.org @@ -1,50 +1,20 @@ -* Dotfiles +* Nixfiles -I've organised this repository with [[https://www.gnu.org/software/stow/][GNU Stow]]. It focuses on [[http://zsh.sourceforge.net][Z Shell]] and -[[http://emacs.sexy][Emacs]]. +I've organised this repository with [[https://rycee.gitlab.io/home-manager/][Home Manager]]. It focuses on [[http://zsh.sourceforge.net][Z +Shell]] and [[http://emacs.sexy][Emacs]]. It doesn't use any configuration frameworks, just packages installed via package managers. For Z shell I use [[https://github.com/zdharma/zplugin][zplugin]] and for Emacs I use the built-in package.el via [[https://github.com/jwiegley/use-package][use-package]]. -I've included a wrapper script for =stow= which sets the target -directory to =$HOME=, instead of =../=. This allows the repository to -be cloned anywhere, instead of following the =stow= convention of -being one level below the target directory. - It should work on: - Linux -- OSX -- FreeBSD -- Windows/Ubuntu +- macOS ** Installation -Clone the project anywhere, e.g. with [[https://github.com/motemen/ghq][ghq]] - -#+BEGIN_SRC sh :exports code -ghq get git://git.alanpearce.eu/dotfiles -ghq look git.alanpearce.eu/dotfiles -#+END_SRC - -Or just with normal git - -#+BEGIN_SRC sh :exports code -git clone git://git.alanpearce.eu/dotfiles ~/projects/alanpearce-dotfiles -#+END_SRC - -Installing a set of dotfiles with =stow= is simple. For example, with -Emacs: - -#+BEGIN_SRC sh :exports code -./stow -S emacs -#+END_SRC - -And then to uninstall - -#+BEGIN_SRC sh :exports code -./stow -D emacs -#+END_SRC +1. If migrating from a stow version, run =migrate.sh=. +2. Run =install.sh=. *** Z Shell @@ -54,12 +24,3 @@ My zsh configuration uses [[https://github.com/zdharma/zplugin][zplugin]]. I've ./zsh/config/zsh/setup.sh #+END_SRC -*** Emacs - -I use org-mode for my Emacs init file. To simplify setup, I created a -[[file:emacs/.emacs.d/Makefile][Makefile]]. - -#+BEGIN_SRC sh :exports code -cd ~/.emacs.d/ -make -#+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 @@ +#!/bin/sh + +set -eu + +if [ -z "$1" ] +then + echo "Usage: $0 " + exit 1 +fi + +NIXDIR="$HOME/.config/nixpkgs" + +if [ ! -f "$1" ] +then + echo "$1 does not exist" + exit 1 +fi + +ln -s $PWD $NIXDIR +ln -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 @@ +#!/usr/bin/env zsh + +set -euo pipefail + +echo "Checking if all packages can be unstowed" +./stow -Dn --ignore="tabnine_config\.json" *(/) + +echo "Unstowing!" +./stow -D --ignore="tabnine_config\.json" *(/) + +rmdir ~/.config/nixpkgs || echo "Could not remove nixpkgs directory. Remove it manually before running the installer." -- cgit 1.4.1