1
0
Fork 0
mirror of https://github.com/Mic92/sops-nix.git synced 2024-12-14 11:57:52 +00:00

nix-darwin: fix evaluation with templates

This commit is contained in:
Jörg Thalheim 2024-11-17 11:35:23 +01:00 committed by mergify[bot]
parent a7b8f0feb7
commit b05bdb2650
2 changed files with 7 additions and 3 deletions

View file

@ -1,4 +1,4 @@
{ config, options, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.sops; cfg = config.sops;
@ -7,7 +7,10 @@ let
inherit cfg; inherit cfg;
inherit (pkgs) writeTextFile; inherit (pkgs) writeTextFile;
}; };
manifest = manifestFor "" regularSecrets {}; manifest = manifestFor "" regularSecrets regularTemplates {};
# Currently, all templates are "regular" (there's no support for `neededForUsers` for templates.)
regularTemplates = cfg.templates;
pathNotInStore = lib.mkOptionType { pathNotInStore = lib.mkOptionType {
name = "pathNotInStore"; name = "pathNotInStore";

View file

@ -2,6 +2,7 @@
let let
cfg = config.sops; cfg = config.sops;
secretsForUsers = lib.filterAttrs (_: v: v.neededForUsers) cfg.secrets; secretsForUsers = lib.filterAttrs (_: v: v.neededForUsers) cfg.secrets;
templatesForUsers = {}; # We do not currently support `neededForUsers` for templates.
manifestFor = pkgs.callPackage ../manifest-for.nix { manifestFor = pkgs.callPackage ../manifest-for.nix {
inherit cfg; inherit cfg;
inherit (pkgs) writeTextFile; inherit (pkgs) writeTextFile;
@ -9,7 +10,7 @@ let
withEnvironment = import ../with-environment.nix { withEnvironment = import ../with-environment.nix {
inherit cfg lib; inherit cfg lib;
}; };
manifestForUsers = manifestFor "-for-users" secretsForUsers { manifestForUsers = manifestFor "-for-users" secretsForUsers templatesForUsers {
secretsMountPoint = "/run/secrets-for-users.d"; secretsMountPoint = "/run/secrets-for-users.d";
symlinkPath = "/run/secrets-for-users"; symlinkPath = "/run/secrets-for-users";
}; };