Add helper functions for multi-user toggle support
Introduced a new file `lib.nix` containing helper functions to streamline user package management and attributes for multi-user configurations. Updated various modules to utilize these functions, enhancing code maintainability and readability.
This commit is contained in:
@@ -9,19 +9,17 @@
|
||||
config = lib.mkIf config.my.apps.office.enable {
|
||||
environment.variables.CALIBRE_USE_SYSTEM_THEME = "1";
|
||||
users.users = let
|
||||
users = if lib.isString config.my.toggleUsers.apps then [ config.my.toggleUsers.apps ] else config.my.toggleUsers.apps;
|
||||
userLib = import ../lib.nix { inherit lib; };
|
||||
packages = builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
jre17_minimal # for libreoffice extensions
|
||||
libreoffice # office, but based & european
|
||||
calibre # ugly af eBook library manager
|
||||
newsflash # feed reader, syncs with nextcloud
|
||||
furtherance # I packaged this one tehee track time utility
|
||||
# planify # let's pretend I will organize my tasks
|
||||
;
|
||||
inherit (pkgs)
|
||||
jre17_minimal # for libreoffice extensions
|
||||
libreoffice # office, but based & european
|
||||
calibre # ugly af eBook library manager
|
||||
newsflash # feed reader, syncs with nextcloud
|
||||
furtherance # I packaged this one tehee track time utility
|
||||
# planify # let's pretend I will organize my tasks
|
||||
;
|
||||
};
|
||||
in lib.mkMerge (map (user: {
|
||||
${user}.packages = packages;
|
||||
}) users);
|
||||
in userLib.mkUserPackages config.my.toggleUsers.apps packages;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user