Modularize nixos and home-manager packages
This commit is contained in:
parent
b0979afa53
commit
51d2c2aa7c
32 changed files with 713 additions and 482 deletions
24
modules/programs/printing.nix
Normal file
24
modules/programs/printing.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ lib, config, options, pkgs, ... }: {
|
||||
options.mods.printing = {
|
||||
enable = lib.mkOption {
|
||||
default = true;
|
||||
example = false;
|
||||
type = lib.types.bool;
|
||||
description = "Enables the piper program and its daemon";
|
||||
};
|
||||
};
|
||||
config = lib.mkIf config.mods.printing.enable
|
||||
(lib.optionalAttrs (options?services.printing)
|
||||
{
|
||||
# Enable CUPS to print documents.
|
||||
services.printing.enable = true;
|
||||
services.printing.browsing = true;
|
||||
services.printing.drivers = [ pkgs.hplip ];
|
||||
services.printing.startWhenNeeded = true; # optional
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue