dotfiles/conf

27 lines
798 B
Plaintext
Raw Normal View History

2016-01-28 02:59:31 +01:00
#!/usr/bin/env bash
if ! [ -e deploy_key ] || ! [ -e secrets.nix ]
then
2018-02-27 16:49:15 +01:00
git crypt unlock
2016-01-28 02:59:31 +01:00
sudo chgrp nixbld deploy_key
chmod 640 deploy_key
fi
2017-01-30 17:41:05 +01:00
export NIX_PATH="ssh-id-file=`pwd`/deploy_key":secrets=`pwd`/secrets.nix
2016-01-28 02:59:31 +01:00
case $1 in
git)
export NIX_PATH="nixpkgs=https://github.com/NixOS/nixpkgs/archive/master.tar.gz:nixos-config=`pwd`/logical/$2.nix:$NIX_PATH"
eval ${@:3}
;;
2017-01-30 17:41:05 +01:00
stable)
2017-04-08 23:14:57 +02:00
export NIX_PATH="nixpkgs=https://nixos.org/channels/nixos-17.03/nixexprs.tar.xz:nixos-config=`pwd`/logical/$2.nix:$NIX_PATH"
eval ${@:3}
2016-04-14 14:02:16 +02:00
;;
2018-02-27 16:31:16 +01:00
checkout)
export NIX_PATH="nixpkgs=`pwd`/../nixpkgs:nixos-config=`pwd`/logical/$2.nix:$NIX_PATH"
eval ${@:3}
;;
2017-01-30 17:41:05 +01:00
channel)
2017-02-02 18:58:13 +01:00
export NIX_PATH="/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=`pwd`/logical/$2.nix:$NIX_PATH"
2017-01-30 17:41:05 +01:00
eval ${@:3}
2016-01-28 02:59:31 +01:00
;;
esac