nixos: add backup file extension and verbosity options
This commit is contained in:
parent
db0dfb4b08
commit
9cc30b18f7
|
@ -23,6 +23,14 @@ let
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
serviceEnvironment =
|
||||||
|
optionalAttrs (cfg.backupFileExtension != null) {
|
||||||
|
HOME_MANAGER_BACKUP_EXT = cfg.backupFileExtension;
|
||||||
|
}
|
||||||
|
// optionalAttrs cfg.verbose {
|
||||||
|
VERBOSE = "1";
|
||||||
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -33,6 +41,18 @@ in
|
||||||
<option>users.users.<name?>.packages</option> option.
|
<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 {
|
users = mkOption {
|
||||||
type = types.attrsOf hmModule;
|
type = types.attrsOf hmModule;
|
||||||
default = {};
|
default = {};
|
||||||
|
@ -70,6 +90,8 @@ in
|
||||||
wants = [ "nix-daemon.socket" ];
|
wants = [ "nix-daemon.socket" ];
|
||||||
after = [ "nix-daemon.socket" ];
|
after = [ "nix-daemon.socket" ];
|
||||||
|
|
||||||
|
environment = serviceEnvironment;
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
User = usercfg.home.username;
|
User = usercfg.home.username;
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
|
|
Loading…
Reference in a new issue