add printing

This commit is contained in:
LordGrimmauld 2024-03-16 12:03:33 +01:00
parent 16110bb326
commit ae437bff51
3 changed files with 28 additions and 4 deletions

View File

@ -6,13 +6,21 @@ in {
options.grimmShared = { options.grimmShared = {
enable = mkEnableOption "grimm-shared-modules"; enable = mkEnableOption "grimm-shared-modules";
enableLocale = mkOption { locale = mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
description = "Sets german units but english language"; description = "Sets german units but english language";
}; };
printing = mkOption {
type = types.bool;
default = true;
description = "Enables print and scan related options";
};
}; };
imports = [./modules/localisation.nix] imports = [
; ./modules/localisation.nix
./modules/printing.nix
];
} }

View File

@ -1,7 +1,7 @@
{ config, lib, ... }: let { config, lib, ... }: let
cfg = config.grimmShared; cfg = config.grimmShared;
in { in {
config = with cfg; lib.mkIf (enable && enableLocale) { config = with cfg; lib.mkIf (enable && locale) {
time.timeZone = "Europe/Berlin"; time.timeZone = "Europe/Berlin";
# Select internationalisation properties. # Select internationalisation properties.

16
modules/printing.nix Normal file
View File

@ -0,0 +1,16 @@
{ pkgs, config, lib, ... }: let
cfg = config.grimmShared;
in {
config = with cfg; lib.mkIf (enable && printing) {
# Enable CUPS to print documents.
services.printing.enable = true;
services.printing.drivers = with pkgs; [ brgenml1lpr brgenml1cupswrapper ];
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
services.printing.cups-pdf.enable = true;
hardware.sane.brscan4.enable = true; # enables support for SANE scanners
};
}