nixos-systems/modules/system/restic/default.nix
Eli Ribble 5288c5857a
Add separate restic roles for separate credentials
I don't want corp and prod accidentally smashing each other, or being
used as a credentials escalation attack.
2026-01-13 14:57:33 +00:00

32 lines
830 B
Nix

{ pkgs, lib, config, ... }:
with lib;
{
# Disable the stable channel version of restic and use our
# local copy of the unstable version so that we get access to stdin-from-command
disabledModules = [ "services/backup/restic.nix" ];
imports = [
./restic.nix
];
config = {
sops.secrets.restic-env = {
format = "yaml";
key = "backblaze-${config.myModules.restic.role}";
group = "root";
mode = "0440";
owner = "root";
sopsFile = ../../../secrets/restic.yaml;
};
sops.secrets.restic-password = {
format = "yaml";
key = "password-${config.myModules.restic.role}";
group = "root";
mode = "0440";
owner = "root";
sopsFile = ../../../secrets/restic.yaml;
};
};
options.myModules.restic.role = mkOption {
description = "The role which picks the key to use";
type = types.str;
};
}