From 3fbc8790219496c2b6a6c34c3d349fc8b9b77b2d Mon Sep 17 00:00:00 2001 From: Jess Date: Sun, 19 Oct 2025 02:53:34 +1300 Subject: [PATCH] restic: add platform assertion (linux) --- modules/services/restic.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/services/restic.nix b/modules/services/restic.nix index 20ea8772b..7577d6b37 100644 --- a/modules/services/restic.nix +++ b/modules/services/restic.nix @@ -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: