Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restic: add s3CredentialsFile option #41343

Merged
merged 1 commit into from Jun 29, 2018
Merged

Conversation

jerith666
Copy link
Contributor

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.


s3CredentialsFile = mkOption {
type = types.str;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose it should have a default value:

type = with types; nullOr str;
default = null;

@@ -134,6 +142,8 @@ with lib;
Type = "oneshot";
ExecStart = "${resticCmd} backup ${concatStringsSep " " backup.extraBackupArgs} ${concatStringsSep " " backup.paths}";
User = backup.user;
} // optionalAttrs (backup.s3CredentialsFile != "") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the new default it can be compared with null instead of empty string.

@jerith666
Copy link
Contributor Author

fixed to use null default.

@matthewbauer matthewbauer merged commit dfd90df into NixOS:master Jun 29, 2018
@jerith666
Copy link
Contributor Author

Hm ... am I missing a default = null; in the mkOption{}?

@jerith666
Copy link
Contributor Author

yep, I am -- sorry! fixed in #44332.

@dotlambda
Copy link
Member

Why do you call this s3CredentialsFile if it's just a way to set arbitrary environment variables? How about calling it environmentFile and using AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY as example?

@jerith666
Copy link
Contributor Author

was just too focused on that use case -- okay w/ me if you want to rename it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants