From 8e9b074467006c76768efe04cf1fb1ef9d652c67 Mon Sep 17 00:00:00 2001 From: sefidel Date: Wed, 24 Jan 2024 13:29:27 +0900 Subject: initial commit --- modules/sops.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 modules/sops.nix (limited to 'modules/sops.nix') diff --git a/modules/sops.nix b/modules/sops.nix new file mode 100644 index 0000000..2b6cdef --- /dev/null +++ b/modules/sops.nix @@ -0,0 +1,19 @@ +{ config, lib, inputs, ... }: + +with lib; +let + cfg = config.modules.sops; +in +{ + imports = [ inputs.sops-nix.nixosModules.sops ]; + + options.modules.sops = { + enable = mkEnableOption "sops secret manager"; + + secretsDir = mkOption { type = lib.types.path; }; + }; + + config = mkIf cfg.enable { + sops.defaultSopsFile = "${cfg.secretsDir}/secrets.yaml"; + }; +} -- cgit 1.4.1