feat: Enable home printer setup
Created a new module for home printer setup and enabled it on x86_64-linux systems. The module configures printing drivers and ensures that printers are set up properly. In addition, moved specific printer configurations into the newly created homeprinter module.
This commit is contained in:
parent
55d2bdc640
commit
45433d0622
40
modules/nixos/services/homeprinter/default.nix
Normal file
40
modules/nixos/services/homeprinter/default.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.metacfg;
|
||||
let cfg = config.metacfg.homeprinter;
|
||||
in
|
||||
{
|
||||
options.metacfg.homeprinter = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable the home printers.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.printing.drivers = with pkgs; [
|
||||
metacfg.dcpl2530dw-cups
|
||||
gutenprintBin
|
||||
gutenprint
|
||||
];
|
||||
|
||||
hardware.printers.ensurePrinters = [
|
||||
{
|
||||
name = "Brother_DCP-L2530DW_series";
|
||||
location = "Dach";
|
||||
deviceUri = "dnssd://Brother%20DCP-L2530DW%20series._ipp._tcp.local/?uuid=e3248000-80ce-11db-8000-cc6b1e5cd0ea";
|
||||
model = "brother-DCPL2530DW-cups-en.ppd";
|
||||
ppdOptions = {
|
||||
PageSize = "A4";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "Canon_MG6300_series";
|
||||
location = "Dach";
|
||||
deviceUri = "dnssd://Canon%20MG6300%20series._ipp._tcp.local/?uuid=00000000-0000-1000-8000-2C9EFC9C7BA5";
|
||||
model = "gutenprint.5.3://bjc-PIXMA-MG6350/expert";
|
||||
ppdOptions = {
|
||||
PageSize = "A4";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
|
@ -9,6 +9,7 @@
|
|||
nix.enable = true;
|
||||
podman.enable = true;
|
||||
secureboot.enable = true;
|
||||
homeprinter.enable = true;
|
||||
};
|
||||
|
||||
system.autoUpgrade = {
|
||||
|
@ -19,6 +20,9 @@
|
|||
|
||||
system.stateVersion = "23.11";
|
||||
|
||||
services.resolved.enable = true;
|
||||
services.resolved.dnssec = "allow-downgrade";
|
||||
|
||||
sops.age.sshKeyPaths = [ "/persist/ssh/ssh_host_ed25519_key" ];
|
||||
sops.secrets.backup-s3.sopsFile = ../../../.secrets/t15/backup-s3.yaml;
|
||||
sops.secrets.backup-pw.sopsFile = ../../../.secrets/t15/backup-s3.yaml;
|
||||
|
|
|
@ -11,6 +11,7 @@ with lib.metacfg;
|
|||
nix.enable = true;
|
||||
podman.enable = true;
|
||||
secureboot.enable = true;
|
||||
homeprinter.enable = true;
|
||||
user.extraGroups = [ "docker" ];
|
||||
};
|
||||
|
||||
|
@ -23,36 +24,10 @@ with lib.metacfg;
|
|||
k9s
|
||||
attic-client
|
||||
];
|
||||
services.printing.drivers = with pkgs; [
|
||||
metacfg.dcpl2530dw-cups
|
||||
gutenprintBin
|
||||
gutenprint
|
||||
];
|
||||
|
||||
services.resolved.enable = true;
|
||||
services.resolved.dnssec = "allow-downgrade";
|
||||
|
||||
hardware.printers.ensurePrinters = [
|
||||
{
|
||||
name = "Brother_DCP-L2530DW_series";
|
||||
location = "Dach";
|
||||
deviceUri = "dnssd://Brother%20DCP-L2530DW%20series._ipp._tcp.local/?uuid=e3248000-80ce-11db-8000-cc6b1e5cd0ea";
|
||||
model = "brother-DCPL2530DW-cups-en.ppd";
|
||||
ppdOptions = {
|
||||
PageSize = "A4";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "Canon_MG6300_series";
|
||||
location = "Dach";
|
||||
deviceUri = "dnssd://Canon%20MG6300%20series._ipp._tcp.local/?uuid=00000000-0000-1000-8000-2C9EFC9C7BA5";
|
||||
model = "gutenprint.5.3://bjc-PIXMA-MG6350/expert";
|
||||
ppdOptions = {
|
||||
PageSize = "A4";
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
systemd.packages = [ pkgs.cloudflare-warp ]; # for warp-cli
|
||||
|
||||
virtualisation = {
|
||||
|
|
Loading…
Reference in a new issue