mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +08:00
restic: add platform assertion (linux)
This commit is contained in:
@@ -327,10 +327,17 @@ in
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = lib.mapAttrsToList (n: v: {
|
||||
assertion = lib.xor (v.repository == null) (v.repositoryFile == null);
|
||||
message = "services.restic.backups.${n}: exactly one of repository or repositoryFile should be set";
|
||||
}) cfg.backups;
|
||||
assertions = lib.flatten [
|
||||
(lib.mapAttrsToList (n: v: {
|
||||
assertion = lib.xor (v.repository == null) (v.repositoryFile == null);
|
||||
message = "services.restic.backups.${n}: exactly one of repository or repositoryFile should be set";
|
||||
}) cfg.backups)
|
||||
|
||||
{
|
||||
assertion = pkgs.stdenv.hostPlatform.isLinux;
|
||||
message = "services.restic: linux is currently the only supported platform";
|
||||
}
|
||||
];
|
||||
|
||||
systemd.user.services = lib.mapAttrs' (
|
||||
name: backup:
|
||||
|
||||
Reference in New Issue
Block a user