From 1464a1ef74af012b5784c2dd13fa371a95419c73 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sat, 6 Aug 2022 13:07:11 -0700 Subject: fix(modules/secrets): call correct function for group The function `groupExists` returns a boolean, what we want is `groupIfExists` which returns the actual name of the group. Change-Id: I7db50066e13932dd617ffccb9dae40ecb1d383a5 Reviewed-on: https://cl.fcuny.net/c/world/+/701 Tested-by: CI Reviewed-by: Franck Cuny --- modules/secrets/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/secrets/default.nix b/modules/secrets/default.nix index d4a2fd8..2d8998a 100644 --- a/modules/secrets/default.nix +++ b/modules/secrets/default.nix @@ -15,7 +15,8 @@ in userExists = u: builtins.hasAttr u config.users.users; groupExists = g: builtins.hasAttr g config.users.groups; - # Only set the user and/or group if they exist, to avoid warnings + # Only set the user and/or group if they exist, to avoid + # warnings. If they don't exist, we default to root. userIfExists = u: if userExists u then u else "root"; groupIfExists = g: if groupExists g then g else "root"; @@ -25,7 +26,7 @@ in } // lib.optionalAttrs (attrs ? owner) { owner = lib.mkDefault (userIfExists attrs.owner); } // lib.optionalAttrs (attrs ? group) { - group = lib.mkDefault (groupExists attrs.group); + group = lib.mkDefault (groupIfExists attrs.group); } // lib.optionalAttrs (attrs ? mode) { inherit (attrs) mode; } // lib.optionalAttrs (attrs ? path) { -- cgit 1.4.1