summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2015-07-28 20:24:45 +0200
committerMatthias Beyer <mail@beyermatthias.de>2015-08-01 20:46:37 +0200
commit681c822b635ff2e04fea006fe0feb87c29b4993b (patch)
tree973167b18ecc7b3284daac6f9868e9549a3288e6
parentb213b8967c5657992c4f1d344afa32f72753ffb3 (diff)
Add default tagging flags in switch command
-rw-r--r--example.rc12
-rwxr-xr-xnix-script1
-rwxr-xr-xnix-script-switch.sh4
3 files changed, 15 insertions, 2 deletions
diff --git a/example.rc b/example.rc
index 31542ff..2b307ed 100644
--- a/example.rc
+++ b/example.rc
@@ -16,3 +16,15 @@ RC_CONFIG=~/config
#
RC_NIXPKGS=~/nixpkgs
+
+#
+#
+# Command: switch
+#
+#
+
+#
+# default flags for git-tagging when doing nix-script switch
+#
+RC_SWITCH_DEFAULT_TAG_FLAGS="-a"
+
diff --git a/nix-script b/nix-script
index a28858e..9af2f4f 100755
--- a/nix-script
+++ b/nix-script
@@ -121,6 +121,7 @@ then
RC_CONFIG=""
RC_NIXPKGS=""
+ RC_SWITCH_DEFAULT_TAG_FLAGS=""
else
source $RC
fi
diff --git a/nix-script-switch.sh b/nix-script-switch.sh
index ffc0cac..b6e8a2b 100755
--- a/nix-script-switch.sh
+++ b/nix-script-switch.sh
@@ -16,7 +16,7 @@ usage() {
-n DON'T include hostname in tag name
-t <tagname> Custom tag name
-p <pkgs> Generate the switch tag in the nixpkgs at <pkgs> as well. (default: '$RC_NIXPKGS')
- -f <tag-flags> Flags for git-tag (see 'git tag --help')
+ -f <tag-flags> Flags for git-tag (see 'git tag --help') (default: '$RC_SWITCH_DEFAULT_TAG_FLAGS')
-b Do not call nixos-rebuild at all.
-h Show this help and exit
@@ -53,7 +53,7 @@ WD=$RC_CONFIG
TAG_NAME=
HOSTNAME="$(hostname)"
NIXPKGS=$RC_NIXPKGS
-TAG_FLAGS=""
+TAG_FLAGS="$RC_SWITCH_DEFAULT_TAG_FLAGS"
DONT_BUILD=
while getopts "c:w:t:nbp:f:h" OPTION