nixos/restic: remove s3CredentialsFile option

This has been deprecated since 2021, so all users should have seen the
warning and migrated by now.
This commit is contained in:
Alyssa Ross
2023-10-27 11:36:31 +02:00
parent 3f6fbb1e0c
commit 44ff5dfca2

View File

@@ -23,25 +23,13 @@ in
environmentFile = mkOption { environmentFile = mkOption {
type = with types; nullOr str; type = with types; nullOr str;
# added on 2021-08-28, s3CredentialsFile should default = null;
# be removed in the future (+ remember the warning)
default = config.s3CredentialsFile;
description = lib.mdDoc '' description = lib.mdDoc ''
file containing the credentials to access the repository, in the file containing the credentials to access the repository, in the
format of an EnvironmentFile as described by systemd.exec(5) format of an EnvironmentFile as described by systemd.exec(5)
''; '';
}; };
s3CredentialsFile = mkOption {
type = with types; nullOr str;
default = null;
description = lib.mdDoc ''
file containing the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
for an S3-hosted repository, in the format of an EnvironmentFile
as described by systemd.exec(5)
'';
};
rcloneOptions = mkOption { rcloneOptions = mkOption {
type = with types; nullOr (attrsOf (oneOf [ str bool ])); type = with types; nullOr (attrsOf (oneOf [ str bool ]));
default = null; default = null;
@@ -300,7 +288,6 @@ in
}; };
config = { config = {
warnings = mapAttrsToList (n: v: "services.restic.backups.${n}.s3CredentialsFile is deprecated, please use services.restic.backups.${n}.environmentFile instead.") (filterAttrs (n: v: v.s3CredentialsFile != null) config.services.restic.backups);
assertions = mapAttrsToList (n: v: { assertions = mapAttrsToList (n: v: {
assertion = (v.repository == null) != (v.repositoryFile == null); assertion = (v.repository == null) != (v.repositoryFile == null);
message = "services.restic.backups.${n}: exactly one of repository or repositoryFile should be set"; message = "services.restic.backups.${n}: exactly one of repository or repositoryFile should be set";