1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-26 21:19:45 +01:00

nixos: add backup file extension and verbosity options

This commit is contained in:
Tobias Happ 2019-08-08 18:24:08 +02:00 committed by Robert Helgesson
parent db0dfb4b08
commit 9cc30b18f7
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -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.&lt;name?&gt;.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";