diff options
author | Tobias Happ <tobias.happ@gmx.de> | 2019-08-08 18:24:08 +0200 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2019-08-18 17:19:39 +0200 |
commit | 9cc30b18f710eba6aa1f72155a747a640fc17b2a (patch) | |
tree | 1d1976dd4b1d1ed6962f91023ed7e6fff4c61e76 /nixos | |
parent | db0dfb4b089d0f5ba86ab39b40a228ae47c5d440 (diff) |
nixos: add backup file extension and verbosity options
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/default.nix | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/nixos/default.nix b/nixos/default.nix index 4628d1f2d9f..51f4640c0fd 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -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"; |