mirror of
https://github.com/nix-community/home-manager.git
synced 2024-12-14 11:57:55 +00:00
nixos: add backup file extension and verbosity options
This commit is contained in:
parent
db0dfb4b08
commit
9cc30b18f7
1 changed files with 22 additions and 0 deletions
|
@ -23,6 +23,14 @@ let
|
|||
};
|
||||
});
|
||||
|
||||
serviceEnvironment =
|
||||
optionalAttrs (cfg.backupFileExtension != null) {
|
||||
HOME_MANAGER_BACKUP_EXT = cfg.backupFileExtension;
|
||||
}
|
||||
// optionalAttrs cfg.verbose {
|
||||
VERBOSE = "1";
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
|
@ -33,6 +41,18 @@ in
|
|||
<option>users.users.<name?>.packages</option> option.
|
||||
'';
|
||||
|
||||
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.
|
||||
'';
|
||||
};
|
||||
|
||||
verbose = mkEnableOption "verbose output on activation";
|
||||
|
||||
users = mkOption {
|
||||
type = types.attrsOf hmModule;
|
||||
default = {};
|
||||
|
@ -70,6 +90,8 @@ in
|
|||
wants = [ "nix-daemon.socket" ];
|
||||
after = [ "nix-daemon.socket" ];
|
||||
|
||||
environment = serviceEnvironment;
|
||||
|
||||
serviceConfig = {
|
||||
User = usercfg.home.username;
|
||||
Type = "oneshot";
|
||||
|
|
Loading…
Reference in a new issue