mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 19:46: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 = {
|
options = {
|
||||||
|
|
||||||
home-manager = {
|
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 {
|
config = mkOption {
|
||||||
type = types.nullOr hmModule;
|
type = types.nullOr hmModule;
|
||||||
default = null;
|
default = null;
|
||||||
|
|
@ -58,9 +68,12 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
activationAfter.homeManager = ''
|
activationAfter.homeManager = concatStringsSep " " (
|
||||||
${cfg.config.home.activationPackage}/activate
|
optional
|
||||||
'';
|
(cfg.backupFileExtension != null)
|
||||||
|
"HOME_MANAGER_BACKUP_EXT='${cfg.backupFileExtension}'"
|
||||||
|
++ [ "${cfg.config.home.activationPackage}/activate" ]
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.packages = mkIf cfg.useUserPackages cfg.config.home.packages;
|
environment.packages = mkIf cfg.useUserPackages cfg.config.home.packages;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue