瀏覽代碼

Add a nix dotfile target.

cray
Mitch Tishmack 11 年之前
父節點
當前提交
c166db5fa0
共有 3 個檔案被更改,包括 21 行新增2 行删除
  1. +5
    -2
      Makefile
  2. +8
    -0
      nix/.profile.d/20-functions-nix.sh
  3. +8
    -0
      nix/.profile.d/99-final-nix.sh

+ 5
- 2
Makefile 查看文件

@@ -5,12 +5,12 @@ STOWOPTS=-target $(HOME) -d $(PWD)
DOTGITCONFIG=~/.gitconfig
DOTPROFILE=~/.profile

.PHONY: mosh common emacs git ruby haskell perl tmux vim zsh list home osx linux ws
.PHONY: mosh common emacs git ruby haskell perl tmux vim zsh list home osx linux ws nix

home: $(DOTGITCONFIG) $(DOTPROFILE)
$(DOTDEE) $(DOTPROFILE)

ws: common mosh git ruby haskell perl tmux vim zsh home
ws: common emacs nix mosh git ruby haskell perl tmux vim zsh home

all: home

@@ -64,3 +64,6 @@ haskell:

perl:
$(STOW) $(STOWOPTS) perl

nix:
$(STOW) $(STOWOPTS) nix

+ 8
- 0
nix/.profile.d/20-functions-nix.sh 查看文件

@@ -0,0 +1,8 @@
# nix/.profile.d/20-functions-nix.sh
mk_nix_shell()
{
cabal2nix --sha256="0" . \
| perl -0777 -p -e 's/{.+}:/{ haskellPackages ? (import <nixpkgs> {}).haskellPackages }:/s' \
| sed -E -e 's/(cabal\.mkDerivation)/with haskellPackages; \1/' -e 'sXsha256 = "0";Xsrc = "./.";X' \
> shell.nix;
}

+ 8
- 0
nix/.profile.d/99-final-nix.sh 查看文件

@@ -0,0 +1,8 @@
# nix.profile.d/99-final-nix.sh

# The nix installer put something like this into the .profile.
# BAD INSTALLER NO COOKIE!
if [ -e ${HOME}/.nix-profile/etc/profile.d/nix.sh ]; then
. ${HOME}/.nix-profile/etc/profile.d/nix.sh;
export NIX_PATH=${HOME}/Developer/github.com/NixOS/nixpkgs:nixpkgs=${HOME}/Developer/github.com/NixOS/nixpkgs
fi

Loading…
取消
儲存