From ec4c6928bbacc89cf10e9c959a7a47cbaad95344 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. --- modules/programs/firefox/mkFirefoxModule.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/programs/firefox/mkFirefoxModule.nix b/modules/programs/firefox/mkFirefoxModule.nix index f22af019..8475c95a 100644 --- a/modules/programs/firefox/mkFirefoxModule.nix +++ b/modules/programs/firefox/mkFirefoxModule.nix @@ -102,7 +102,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