From 31dd1de293f00d810f0435e0e479ef23d380a3c1 Mon Sep 17 00:00:00 2001 From: Yorick van Pelt Date: Mon, 30 Jan 2017 17:41:05 +0100 Subject: [PATCH] update scripts --- conf | 17 ++++++----------- update_all.sh | 37 ------------------------------------- 2 files changed, 6 insertions(+), 48 deletions(-) delete mode 100755 update_all.sh diff --git a/conf b/conf index 4b8cb5e..ef3fdc3 100755 --- a/conf +++ b/conf @@ -5,20 +5,15 @@ then 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 -local) - export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=`pwd`/ascanius/configuration.nix:secrets=`pwd`/secrets.nix - eval ${@:2} - ;; -remote) - export NIX_PATH="nixpkgs=https://nixos.org/channels/nixos-16.09/nixexprs.tar.xz:nixos-config=`pwd`/$2/configuration.nix:ssh-id-file=`pwd`/deploy_key":secrets=`pwd`/secrets.nix +stable) + export NIX_PATH="nixpkgs=https://nixos.org/channels/nixos-16.09/nixexprs.tar.xz:nixos-config=`pwd`/$2/configuration.nix:$NIX_PATH" eval ${@:3} ;; -local-deploy) - sudo $0 local nixos-rebuild switch - ;; -remote-deploy) - $0 remote $2 nixos-rebuild --build-host localhost --target-host root@$2 switch +channel) + export NIX_PATH="/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=`pwd`/$2/configuration.nix:$NIX_PATH" + eval ${@:3} ;; update-encrypt) gpg -a -r yorick --encrypt-files secrets.nix deploy_key keys/*.key diff --git a/update_all.sh b/update_all.sh deleted file mode 100755 index e39e7c0..0000000 --- a/update_all.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash -set -e -userspace_update_cmd="$(cat <" -A hosts.$1) - echo "nix-channel --update" | ssh root@$HOST - cp deploy_key deploy_key2 - chmod 0600 deploy_key2 - ssh-agent bash <