2024-09-06 02:01:59 +02:00
|
|
|
{ pkgs, lib, config, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.lyn.sops;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.lyn.sops = with lib; {
|
|
|
|
secrets = mkOption {
|
|
|
|
type = types.attrs;
|
|
|
|
default = { };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
config = {
|
|
|
|
sops.secrets = lib.mapAttrs
|
|
|
|
(name: value:
|
|
|
|
let
|
|
|
|
name_split = lib.splitString "/" name;
|
|
|
|
in
|
|
|
|
{
|
2024-09-17 02:46:45 +02:00
|
|
|
sopsFile = config.flakePath + /secrets/${builtins.elemAt name_split 0}/${builtins.elemAt name_split 1}.yaml;
|
2024-09-06 02:01:59 +02:00
|
|
|
} // value)
|
|
|
|
cfg.secrets;
|
|
|
|
};
|
|
|
|
}
|