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.
22 lines
470 B
Nix
22 lines
470 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
{
|
|
options.my.apps.piano.enable = lib.mkEnableOption "piano learning and music theory apps";
|
|
config = lib.mkIf config.my.apps.piano.enable {
|
|
users.users = let
|
|
userLib = import ../lib.nix { inherit lib; };
|
|
packages = builtins.attrValues {
|
|
inherit (pkgs)
|
|
neothesia
|
|
linthesia
|
|
timidity
|
|
;
|
|
};
|
|
in userLib.mkUserPackages config.my.toggleUsers.apps packages;
|
|
};
|
|
}
|