summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
-rw-r--r--common.nix (renamed from home.nix)0
m---------home-manager0
-rwxr-xr-xinstall.sh18
-rw-r--r--linux.nix5
5 files changed, 17 insertions, 9 deletions
diff --git a/.gitmodules b/.gitmodules
index 4ca08de..fbea7c8 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,6 @@
[submodule "xresources"]
path = xresources
url = git@github.com:bsima/xresources.git
+[submodule "home-manager"]
+ path = home-manager
+ url = git@github.com:rycee/home-manager.git
diff --git a/home.nix b/common.nix
index f118b39..f118b39 100644
--- a/home.nix
+++ b/common.nix
diff --git a/home-manager b/home-manager
new file mode 160000
+Subproject fafd60f12848b62d09062b9fe0344e6b00d4764
diff --git a/install.sh b/install.sh
index a9bf4d8..1b40c4e 100755
--- a/install.sh
+++ b/install.sh
@@ -1,20 +1,20 @@
#!/usr/bin/env bash
-#
-# Downloads and installs home-manager, then symlinks this directory where
-# home-manager expects it.
-HM_PATH=https://github.com/rycee/home-manager/archive/master.tar.gz
+nix-shell ./home-manager -A install
-nix-shell $HM_PATH -A install
+mkdir -p ~/.config/nixpkgs
-# macOS doesn't have a ~/.config directory by default
-mkdir -p ~/.config
+NIXDIR="$HOME/.config/nixpkgs"
-[[ -L ~/config ]] && ln -s ~/config/home.nix ~/.config/nixpkgs/home.nix
+HOMEFILE="$NIXDIR/home.nix"
+NIXFILE="$(pwd)/$(uname | tr A-Z a-z).nix"
+
+[[ -e "$HOMEFILE" ]] || ln -s "$NIXFILE" "$HOMEFILE"
+[[ -e "$NIXDIR/config.nix" ]] || ln -s "$(pwd)/config.nix" "$NIXDIR/config.nix"
# The notmuch config location is by default ~/.notmuch-config, but home-manager
# puts it at ~/.config/notmuch/notmuchrc (which makes sense) and then sets
# NOTMUCH_CONFIG. However, if a program for some reason doesn't read
# NOTMUCH_CONFIG (emacs), then it won't find the right config file, so I
# override with a symlink.
-[[ -L ~/.notmuch-config ]] && ln -s ~/.config/notmuch/notmuchrc ~/.notmuch-config
+[[ -e ~/.notmuch-config ]] || ln -s ~/.config/notmuch/notmuchrc ~/.notmuch-config
diff --git a/linux.nix b/linux.nix
new file mode 100644
index 0000000..516d8e1
--- /dev/null
+++ b/linux.nix
@@ -0,0 +1,5 @@
+{ pkgs, ... }:
+
+{
+ imports = [ ./common.nix ];
+}