From 2ab00f89dd3ecf8012f5090e6d7ca1a7ea30f594 Mon Sep 17 00:00:00 2001 From: Nina Morgan <764185+Faeranne@users.noreply.github.com> Date: Sun, 8 Sep 2024 03:52:15 -0400 Subject: [PATCH] firefox: fix selection of lastUserContextId The lastUserContextId value should match the highest context ID from the containers set in a given profile. This update ensures that this always is the case. (cherry picked from commit ec4c6928bbacc89cf10e9c959a7a47cbaad95344) --- modules/programs/firefox.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/programs/firefox.nix b/modules/programs/firefox.nix index 1370d4c28..ef979db11 100644 --- a/modules/programs/firefox.nix +++ b/modules/programs/firefox.nix @@ -89,7 +89,8 @@ let ${builtins.toJSON { version = 4; lastUserContextId = - elemAt (mapAttrsToList (_: container: container.id) containers) 0; + foldlAttrs (acc: _: value: if value.id > acc then value.id else acc) 0 + containers; identities = mapAttrsToList containerToIdentity containers ++ [ { userContextId = 4294967294; # 2^32 - 2