mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 11:36:07 +01:00
home-manager: Add backupFileExtension option
This commit is contained in:
parent
daf69b959d
commit
c9e9ae3040
1 changed files with 16 additions and 3 deletions
|
|
@ -28,6 +28,16 @@ in
|
|||
options = {
|
||||
|
||||
home-manager = {
|
||||
backupFileExtension = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
example = "backup";
|
||||
description = ''
|
||||
On activation move existing files by appending the given
|
||||
file extension rather than exiting with an error.
|
||||
'';
|
||||
};
|
||||
|
||||
config = mkOption {
|
||||
type = types.nullOr hmModule;
|
||||
default = null;
|
||||
|
|
@ -58,9 +68,12 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
activationAfter.homeManager = ''
|
||||
${cfg.config.home.activationPackage}/activate
|
||||
'';
|
||||
activationAfter.homeManager = concatStringsSep " " (
|
||||
optional
|
||||
(cfg.backupFileExtension != null)
|
||||
"HOME_MANAGER_BACKUP_EXT='${cfg.backupFileExtension}'"
|
||||
++ [ "${cfg.config.home.activationPackage}/activate" ]
|
||||
);
|
||||
};
|
||||
|
||||
environment.packages = mkIf cfg.useUserPackages cfg.config.home.packages;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue