mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2026-04-14 13:19:09 +02:00
24 lines
868 B
Nix
24 lines
868 B
Nix
{ lib, den, ... }:
|
|
let
|
|
hostContext = { name, args, class }: { host }: {
|
|
nixos.sops.secrets.${name} = lib.mkIf (!host.isPublic) args // lib.optionalAttrs (class == "homeManager") { owner = host.mainUser; };
|
|
};
|
|
|
|
# deadnix: skip
|
|
hostUserContext = { name, args, class }: { host, user }: {
|
|
nixos.sops.secrets.${name} = lib.mkIf (!host.isPublic) args // lib.optionalAttrs (class == "homeManager") { owner = host.mainUser; };
|
|
};
|
|
|
|
homeContext = { name, args }: { home }: {
|
|
homeManager.sops.secrets.${name} = lib.mkIf (!home.isPublic) args;
|
|
};
|
|
|
|
in
|
|
{
|
|
den.provides.sops = { name, args, class ? "homeManager" }: den.lib.parametric.exactly {
|
|
includes = [
|
|
(hostContext { inherit name args class; })
|
|
(hostUserContext { inherit name args class; })
|
|
] ++ lib.optional (class == "homeManager") (homeContext { inherit name args; });
|
|
};
|
|
}
|