Consolidate printer config and enable simple-scan
Remove per‑host printers.nix and merge printing settings into host variables. Add simple-scan package and enable it for desktop and laptop hosts. Disable simple-scan for the default host. Enable SANE daemon and expose its libraries in fish init. Open required UDP ports 5353 and 54925 in network module.
This commit is contained in:
@@ -66,11 +66,10 @@
|
|||||||
|
|
||||||
mkHost = hostName: let
|
mkHost = hostName: let
|
||||||
hostVars = import ./hosts/${hostName}/variables.nix;
|
hostVars = import ./hosts/${hostName}/variables.nix;
|
||||||
hostPrinterVars = import ./hosts/${hostName}/printers.nix;
|
|
||||||
in
|
in
|
||||||
nixpkgs.lib.nixosSystem {
|
nixpkgs.lib.nixosSystem {
|
||||||
inherit (hostVars) system;
|
inherit (hostVars) system;
|
||||||
specialArgs = hostVars // hostPrinterVars // {inherit inputs;};
|
specialArgs = hostVars // {inherit inputs;};
|
||||||
modules = [
|
modules = [
|
||||||
./profiles/${hostVars.profile}
|
./profiles/${hostVars.profile}
|
||||||
nix-flatpak.nixosModules.nix-flatpak
|
nix-flatpak.nixosModules.nix-flatpak
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
printEnable = false;
|
|
||||||
|
|
||||||
ensureDefaultPrinter = "Brother-T525W";
|
|
||||||
|
|
||||||
ensurePrinters = [
|
|
||||||
{
|
|
||||||
deviceUri = "ipp://192.168.1.110/ipp";
|
|
||||||
location = "home";
|
|
||||||
name = "Brother-T525W";
|
|
||||||
model = "everywhere";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -113,5 +113,6 @@ _: {
|
|||||||
gedit.enable = true; # Gedit: GNOME text editor
|
gedit.enable = true; # Gedit: GNOME text editor
|
||||||
winboat.enable = false; # Winboat: Windows remote desktop via RDP
|
winboat.enable = false; # Winboat: Windows remote desktop via RDP
|
||||||
adb.enable = false; # ADB: Android SDK platform tools
|
adb.enable = false; # ADB: Android SDK platform tools
|
||||||
|
simpleScan.enable = true; # simple-scan: Simple scanning utility
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,4 +62,24 @@
|
|||||||
# Set network hostId if required (needed for zfs)
|
# Set network hostId if required (needed for zfs)
|
||||||
# Otherwise leave as-is
|
# Otherwise leave as-is
|
||||||
hostId = "5ab03f50";
|
hostId = "5ab03f50";
|
||||||
|
|
||||||
|
# Whether printing services should be enabled.
|
||||||
|
printEnable = true;
|
||||||
|
# Name of the default printer.
|
||||||
|
ensureDefaultPrinter = "Brother_DCP-T510W";
|
||||||
|
# List of printers to ensure are configured.
|
||||||
|
ensurePrinters = [
|
||||||
|
{
|
||||||
|
deviceUri = "ipp://192.168.1.106/ipp";
|
||||||
|
location = "home";
|
||||||
|
name = "Brother_DCP-T525W";
|
||||||
|
model = "everywhere";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
deviceUri = "ipp://192.168.1.159/ipp";
|
||||||
|
location = "home";
|
||||||
|
name = "Brother_DCP-T510W";
|
||||||
|
model = "everywhere";
|
||||||
|
}
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
printEnable = true;
|
|
||||||
|
|
||||||
ensureDefaultPrinter = "Brother-T525W";
|
|
||||||
|
|
||||||
ensurePrinters = [
|
|
||||||
{
|
|
||||||
deviceUri = "ipp://192.168.1.110/ipp";
|
|
||||||
location = "home";
|
|
||||||
name = "Brother-T525W";
|
|
||||||
model = "everywhere";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -113,5 +113,6 @@ _: {
|
|||||||
gedit.enable = true; # Gedit: GNOME text editor
|
gedit.enable = true; # Gedit: GNOME text editor
|
||||||
winboat.enable = false; # Winboat: Windows remote desktop via RDP
|
winboat.enable = false; # Winboat: Windows remote desktop via RDP
|
||||||
adb.enable = false; # ADB: Android SDK platform tools
|
adb.enable = false; # ADB: Android SDK platform tools
|
||||||
|
simpleScan.enable = true; # simple-scan: Simple scanning utility
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,4 +62,21 @@
|
|||||||
# Set network hostId if required (needed for zfs)
|
# Set network hostId if required (needed for zfs)
|
||||||
# Otherwise leave as-is
|
# Otherwise leave as-is
|
||||||
hostId = "7bc04e61";
|
hostId = "7bc04e61";
|
||||||
|
|
||||||
|
printEnable = true;
|
||||||
|
ensureDefaultPrinter = "Brother_DCP-T510W";
|
||||||
|
ensurePrinters = [
|
||||||
|
{
|
||||||
|
deviceUri = "ipp://192.168.1.106/ipp";
|
||||||
|
location = "home";
|
||||||
|
name = "Brother_DCP-T525W";
|
||||||
|
model = "everywhere";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
deviceUri = "ipp://192.168.1.159/ipp";
|
||||||
|
location = "home";
|
||||||
|
name = "Brother_DCP-T510W";
|
||||||
|
model = "everywhere";
|
||||||
|
}
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
# Whether printing services should be enabled.
|
|
||||||
printEnable = false;
|
|
||||||
|
|
||||||
# Name of the default printer.
|
|
||||||
ensureDefaultPrinter = "[name]";
|
|
||||||
|
|
||||||
# List of printers to ensure are configured.
|
|
||||||
ensurePrinters = [
|
|
||||||
{
|
|
||||||
# URI of the printer device.
|
|
||||||
deviceUri = "ipp://[IPv4]/ipp";
|
|
||||||
# Physical location description of the printer.
|
|
||||||
location = "[location]";
|
|
||||||
# Human‑readable printer name.
|
|
||||||
name = "[name]";
|
|
||||||
# Printer model; "everywhere" uses generic driver.
|
|
||||||
model = "everywhere";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -113,5 +113,6 @@ _: {
|
|||||||
gedit.enable = false; # Gedit: GNOME text editor
|
gedit.enable = false; # Gedit: GNOME text editor
|
||||||
winboat.enable = false; # Winboat: Windows remote desktop via RDP
|
winboat.enable = false; # Winboat: Windows remote desktop via RDP
|
||||||
adb.enable = false; # ADB: Android SDK platform tools
|
adb.enable = false; # ADB: Android SDK platform tools
|
||||||
|
simpleScan.enable = false; # simple-scan: Simple scanning utility
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,4 +68,22 @@
|
|||||||
# Set network hostId if required (needed for zfs)
|
# Set network hostId if required (needed for zfs)
|
||||||
# Otherwise leave as-is
|
# Otherwise leave as-is
|
||||||
hostId = "5ab03f50";
|
hostId = "5ab03f50";
|
||||||
|
|
||||||
|
# Whether printing services should be enabled.
|
||||||
|
printEnable = false;
|
||||||
|
# Name of the default printer.
|
||||||
|
ensureDefaultPrinter = "[name]";
|
||||||
|
# List of printers to ensure are configured.
|
||||||
|
ensurePrinters = [
|
||||||
|
{
|
||||||
|
# URI of the printer device.
|
||||||
|
deviceUri = "ipp://[IPv4]/ipp";
|
||||||
|
# Physical location description of the printer.
|
||||||
|
location = "[location]";
|
||||||
|
# Human‑readable printer name.
|
||||||
|
name = "[name]";
|
||||||
|
# Printer model; "everywhere" uses generic driver.
|
||||||
|
model = "everywhere";
|
||||||
|
}
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
allowedUDPPorts = [
|
allowedUDPPorts = [
|
||||||
|
5353
|
||||||
|
54925
|
||||||
59010
|
59010
|
||||||
59011
|
59011
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -76,6 +76,7 @@
|
|||||||
notify = notify-client;
|
notify = notify-client;
|
||||||
boxes = gnome-boxes;
|
boxes = gnome-boxes;
|
||||||
switcheroo = switcheroo;
|
switcheroo = switcheroo;
|
||||||
|
simpleScan = simple-scan;
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
imports = builtins.attrValues (builtins.mapAttrs mkPackage packages);
|
imports = builtins.attrValues (builtins.mapAttrs mkPackage packages);
|
||||||
|
|||||||
@@ -31,8 +31,12 @@
|
|||||||
ipp-usb.enable = true;
|
ipp-usb.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware.printers = lib.mkIf printEnable {
|
hardware = lib.mkIf printEnable {
|
||||||
ensureDefaultPrinter = ensureDefaultPrinter;
|
printers = {
|
||||||
ensurePrinters = ensurePrinters;
|
ensureDefaultPrinter = ensureDefaultPrinter;
|
||||||
|
ensurePrinters = ensurePrinters;
|
||||||
|
};
|
||||||
|
|
||||||
|
sane.enable = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,9 @@
|
|||||||
set fish_greeting
|
set fish_greeting
|
||||||
# fastfetch
|
# fastfetch
|
||||||
'';
|
'';
|
||||||
|
shellInit = ''
|
||||||
|
set -gx LD_LIBRARY_PATH /etc/sane-libs $LD_LIBRARY_PATH
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
nix-your-shell = {
|
nix-your-shell = {
|
||||||
|
|||||||
Reference in New Issue
Block a user