mirror of
https://github.com/elwrcl/heliux.git
synced 2026-10-31 22:38:02 +03:00
22 lines
581 B
Nix
22 lines
581 B
Nix
{ config, lib, ... }:
|
|
let
|
|
# finding all home-manager users that have helium enabled
|
|
enabledUsers = lib.filterAttrs (_: user: user.programs.helium.enable or false) (
|
|
config.home-manager.users or { }
|
|
);
|
|
|
|
# generate etc files per user to support multi-user systems
|
|
policyFiles = lib.mapAttrs' (
|
|
name: user:
|
|
lib.nameValuePair "chromium/policies/managed/helium-${name}.json" {
|
|
text = user.programs.helium.finalPolicyJson;
|
|
mode = "0644";
|
|
}
|
|
) enabledUsers;
|
|
in
|
|
{
|
|
config = lib.mkIf (enabledUsers != { }) {
|
|
environment.etc = policyFiles;
|
|
};
|
|
}
|