diff options
author | Judson <nyarly@gmail.com> | 2019-04-17 12:15:38 -0700 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2019-06-09 14:26:12 +0200 |
commit | f82246171b253801021c6f98cc50fa461cd972e5 (patch) | |
tree | d367c3a81c8c8b8e22aa7348100d8a25cc479d06 /home-manager | |
parent | 5b50eb18fcf6100de1546a86e5e8f98ef17ec141 (diff) |
files: backup file collisions
When a configuration file would be written to an existing file, rather
than failing switch (and having the user have to move or delete those
files), move the files automatically to a new path.
Closes #585
Diffstat (limited to 'home-manager')
-rw-r--r-- | home-manager/home-manager | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/home-manager/home-manager b/home-manager/home-manager index 85feaae400d..b6ea92edb9e 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -416,6 +416,7 @@ function doHelp() { echo " -A ATTRIBUTE Optional attribute that selects a configuration" echo " expression in the configuration file." echo " -I PATH Add a path to the Nix expression search path." + echo " -b EXT Move existing files to new path rather than fail." echo " -v Verbose output" echo " -n Do a dry run, only prints what actions would be taken" echo " -h Print this help" @@ -460,7 +461,7 @@ for arg in "$@"; do fi done -while getopts 2f:I:A:vnh opt; do +while getopts 2f:I:A:b:vnh opt; do case $opt in 2) USE_NIX2_COMMAND=1 @@ -474,6 +475,9 @@ while getopts 2f:I:A:vnh opt; do A) HOME_MANAGER_CONFIG_ATTRIBUTE="$OPTARG" ;; + b) + export HOME_MANAGER_BACKUP_EXT="$OPTARG" + ;; v) export VERBOSE=1 ;; |