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.
30 lines
628 B
Nix
30 lines
628 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
printingDrivers = [
|
|
pkgs.hplip
|
|
pkgs.hplipWithPlugin
|
|
];
|
|
in
|
|
{
|
|
options.my.services.printing.enable = lib.mkEnableOption "printing services and drivers";
|
|
config = lib.mkIf config.my.services.printing.enable {
|
|
users.users = let
|
|
userLib = import ../lib.nix { inherit lib; };
|
|
packages = [ pkgs.simple-scan ];
|
|
in userLib.mkUserPackages config.my.toggleUsers.services packages;
|
|
services.printing = {
|
|
enable = true;
|
|
drivers = printingDrivers;
|
|
};
|
|
hardware.sane = {
|
|
enable = true;
|
|
extraBackends = printingDrivers;
|
|
};
|
|
};
|
|
}
|