From b05bdb2650aee87e90e76c38713f5e9fd5d35037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 17 Nov 2024 11:35:23 +0100 Subject: [PATCH] nix-darwin: fix evaluation with templates --- modules/nix-darwin/default.nix | 7 +++++-- modules/nix-darwin/secrets-for-users/default.nix | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/nix-darwin/default.nix b/modules/nix-darwin/default.nix index 50dec02..351bc64 100644 --- a/modules/nix-darwin/default.nix +++ b/modules/nix-darwin/default.nix @@ -1,4 +1,4 @@ -{ config, options, lib, pkgs, ... }: +{ config, lib, pkgs, ... }: let cfg = config.sops; @@ -7,7 +7,10 @@ let inherit cfg; 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 { name = "pathNotInStore"; diff --git a/modules/nix-darwin/secrets-for-users/default.nix b/modules/nix-darwin/secrets-for-users/default.nix index b2c830a..c026cf4 100644 --- a/modules/nix-darwin/secrets-for-users/default.nix +++ b/modules/nix-darwin/secrets-for-users/default.nix @@ -2,6 +2,7 @@ let cfg = config.sops; secretsForUsers = lib.filterAttrs (_: v: v.neededForUsers) cfg.secrets; + templatesForUsers = {}; # We do not currently support `neededForUsers` for templates. manifestFor = pkgs.callPackage ../manifest-for.nix { inherit cfg; inherit (pkgs) writeTextFile; @@ -9,7 +10,7 @@ let withEnvironment = import ../with-environment.nix { inherit cfg lib; }; - manifestForUsers = manifestFor "-for-users" secretsForUsers { + manifestForUsers = manifestFor "-for-users" secretsForUsers templatesForUsers { secretsMountPoint = "/run/secrets-for-users.d"; symlinkPath = "/run/secrets-for-users"; };