add all hosts to sops

This commit is contained in:
zowoq 2024-12-16 08:34:43 +10:00
parent 7478e0268a
commit b260b29a85
6 changed files with 73 additions and 12 deletions
modules/nixos/common

View file

@ -1,16 +1,7 @@
{
config,
inputs,
lib,
...
}:
let
defaultSopsPath = "${inputs.self}/hosts/${config.networking.hostName}/secrets.yaml";
in
{ inputs, ... }:
{
imports = [
../../shared/sops-nix.nix
inputs.sops-nix.nixosModules.sops
];
sops.defaultSopsFile = lib.mkIf (builtins.pathExists defaultSopsPath) defaultSopsPath;
}