# Title Language Pasted on Will expire on Paste type
100 Nix 2025-07-29 @ 16:31:09 UTC Never Public
View raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# NixOS networking configuration that auto-discovers AirPrint-compatible printers via CUPS

  networking.hostName = "midna"; # Define your hostname.
  networking.interfaces."eno1".wakeOnLan.enable = true;

  # Use systemd-resolved and systemd-networkd
  services.resolved.enable = true;
  networking.useDHCP = false;
  systemd.network.enable = true;

  # Configure DNS resolution (search domains)
  services.resolved.domains = [
    "lan" # router7.org resolves <dhcp-hostname>.lan by default
    "example.ts.net" # tailscale
  ];
  services.resolved.extraConfig = ''
    # Required to make e.g. 'ping myStrom-Switch-A46FD0' work
    ResolveUnicastSingleLabel=yes
  '';

  # Enable multicast DNS to make CUPS with AirPrint work
  services.avahi = {
    enable = true;
    nssmdns4 = true; # for resolution of .local names
  };

  # Enable CUPS to print documents.
  services.printing = {
    enable = true;
    drivers = with pkgs; [
      cups-filters
      cups-browsed
    ];
  };