Skip to content

Commit 176480e

Browse files
Merge pull request #12 from 99linesofcode/network-printer-detection
Module for printing with Brother printer
2 parents 3bbeb34 + 0a94af6 commit 176480e

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

hosts/luna/default.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ in
4949
systemd-networkd.enable = true;
5050
};
5151
};
52-
52+
printing.enable = true;
5353
virtualization.enable = true;
5454

55+
avahi.enable = true;
5556
bluetooth.enable = true;
5657
catt.enable = true;
5758
docker.enable = true;

modules/avahi.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ with lib;
1313
services.avahi = {
1414
enable = true;
1515
nssmdns4 = true;
16+
openFirewall = true;
1617
};
1718
};
1819
}

modules/printing.nix

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
config,
3+
lib,
4+
pkgs,
5+
...
6+
}:
7+
8+
let
9+
cfg = config.host.printing;
10+
in
11+
with lib;
12+
{
13+
options = {
14+
host.printing.enable = mkEnableOption "printing capabilities";
15+
};
16+
17+
config = mkIf cfg.enable {
18+
host.avahi.enable = true; # enable autodiscovery of network printers that support the IPP Everywhere protocol
19+
20+
services.printing = {
21+
enable = true;
22+
drivers = with pkgs; [
23+
brlaser
24+
];
25+
};
26+
};
27+
}

0 commit comments

Comments
 (0)