Updated multiple configuration files to include a `merge` option for user management, enhancing the ability to handle multi-user setups for applications and services. This change improves flexibility in managing user-specific package installations, ensuring a more streamlined configuration process.
40 lines
904 B
Nix
40 lines
904 B
Nix
{
|
|
config,
|
|
inputs,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
printingDrivers = [
|
|
pkgs.hplip
|
|
pkgs.hplipWithPlugin
|
|
];
|
|
in
|
|
{
|
|
options.my.services.printing = {
|
|
enable = lib.mkEnableOption "printing services and drivers";
|
|
users = lib.mkOption {
|
|
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
|
default = config.my.toggleUsers.services;
|
|
merge = inputs.self.lib.mergeUsersOption lib;
|
|
description = "Users to install printing packages for";
|
|
};
|
|
};
|
|
config = lib.mkIf config.my.services.printing.enable {
|
|
users.users =
|
|
let
|
|
packages = [ pkgs.simple-scan ];
|
|
in
|
|
inputs.self.lib.mkUserPackages lib config.my.services.printing.users packages;
|
|
services.printing = {
|
|
enable = true;
|
|
drivers = printingDrivers;
|
|
};
|
|
hardware.sane = {
|
|
enable = true;
|
|
extraBackends = printingDrivers;
|
|
};
|
|
};
|
|
}
|