mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-15 10:19:23 +08:00
26 lines
945 B
Nix
26 lines
945 B
Nix
inputs:
|
|
{
|
|
config =
|
|
{
|
|
sops =
|
|
{
|
|
defaultSopsFile =
|
|
let deviceDir =
|
|
if (inputs.config.nixos.model.cluster == null) then
|
|
"${inputs.topInputs.self}/devices/${inputs.config.nixos.model.hostname}"
|
|
else
|
|
"${inputs.topInputs.self}/devices/${inputs.config.nixos.model.cluster.clusterName}"
|
|
+ "/${inputs.config.nixos.model.cluster.nodeName}";
|
|
in inputs.lib.mkMerge
|
|
[
|
|
(inputs.lib.mkIf (builtins.pathExists "${deviceDir}/secrets.yaml") "${deviceDir}/secrets.yaml")
|
|
(inputs.lib.mkIf (builtins.pathExists "${deviceDir}/secrets/default.yaml")
|
|
"${deviceDir}/secrets/default.yaml")
|
|
];
|
|
# sops start before impermanence, so we need to use the absolute path
|
|
age.sshKeyPaths = [ "/nix/persistent/etc/ssh/ssh_host_ed25519_key" ];
|
|
gnupg.sshKeyPaths = [ "/nix/persistent/etc/ssh/ssh_host_rsa_key" ];
|
|
};
|
|
};
|
|
}
|