29 lines
926 B
Bash
Executable File
29 lines
926 B
Bash
Executable File
#!/usr/bin/env bash
|
|
if ! [ -e deploy_key ] || ! [ -e secrets.nix ]
|
|
then
|
|
gpg --decrypt-files secrets.nix.asc deploy_key.asc keys/*.asc
|
|
sudo chgrp nixbld deploy_key
|
|
chmod 640 deploy_key
|
|
fi
|
|
export NIX_PATH="ssh-id-file=`pwd`/deploy_key":secrets=`pwd`/secrets.nix
|
|
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}
|
|
;;
|
|
stable)
|
|
export NIX_PATH="nixpkgs=https://nixos.org/channels/nixos-17.03/nixexprs.tar.xz:nixos-config=`pwd`/logical/$2.nix:$NIX_PATH"
|
|
eval ${@:3}
|
|
;;
|
|
checkout)
|
|
export NIX_PATH="nixpkgs=`pwd`/../nixpkgs:nixos-config=`pwd`/logical/$2.nix:$NIX_PATH"
|
|
eval ${@:3}
|
|
;;
|
|
channel)
|
|
export NIX_PATH="/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=`pwd`/logical/$2.nix:$NIX_PATH"
|
|
eval ${@:3}
|
|
;;
|
|
update-encrypt)
|
|
gpg -a -r yorick --encrypt-files secrets.nix deploy_key keys/*.key
|
|
esac
|