diff options
Diffstat (limited to 'modules/by-name/pr/printing/module.nix')
-rw-r--r-- | modules/by-name/pr/printing/module.nix | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/modules/by-name/pr/printing/module.nix b/modules/by-name/pr/printing/module.nix new file mode 100644 index 00000000..c3283cbf --- /dev/null +++ b/modules/by-name/pr/printing/module.nix @@ -0,0 +1,44 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + config, + lib, + ... +}: let + cfg = config.soispha.services.printing; +in { + options.soispha.services.printing = { + enable = lib.mkEnableOption "default printing configuration"; + }; + + config = lib.mkIf cfg.enable { + soispha.impermanence.directories = [ + "/var/lib/cups" + ]; + + services.avahi = { + enable = true; + nssmdns4 = true; + nssmdns6 = true; + openFirewall = true; + }; + + services.printing = { + enable = true; + startWhenNeeded = true; + webInterface = true; + + # deletes `/var/cache/cups`, `/var/lib/cups` and `/var/spool/cups` on cups startup + stateless = false; + + drivers = []; + }; + }; +} |