infra/roles/sops-nix.nix
2021-09-25 22:35:55 +02:00

10 lines
361 B
Nix

{ config, lib, pkgs, ... }:
let
sources = import ../nix/sources.nix;
hostDir = lib.head (builtins.match "nix-community-(.*)" config.networking.hostName);
defaultSopsPath = ../. + "/${hostDir}/secrets.yaml";
in
{
imports = [ "${sources.sops-nix}/modules/sops" ];
sops.defaultSopsFile = lib.mkIf (builtins.pathExists defaultSopsPath) defaultSopsPath;
}