mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-06 01:38:06 +00:00
[Desktop/Printing] Move printing related config to dedicated file
This commit is contained in:
parent
c449ec13c9
commit
c4cf38ceb3
3 changed files with 79 additions and 66 deletions
|
|
@ -9,5 +9,6 @@ with lib;
|
||||||
./games.nix
|
./games.nix
|
||||||
./browser.nix
|
./browser.nix
|
||||||
./gnome.nix
|
./gnome.nix
|
||||||
|
./printing.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
74
desktop/printing.nix
Normal file
74
desktop/printing.nix
Normal file
|
|
@ -0,0 +1,74 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.aviallon.desktop;
|
||||||
|
generalCfg = config.aviallon.general;
|
||||||
|
in {
|
||||||
|
config = mkIf (cfg.enable && !generalCfg.minimal) {
|
||||||
|
services.printing = {
|
||||||
|
enable = true;
|
||||||
|
defaultShared = mkDefault true;
|
||||||
|
browsing = mkDefault true;
|
||||||
|
listenAddresses = [ "0.0.0.0:631" ];
|
||||||
|
drivers = with pkgs; []
|
||||||
|
++ (optionals (!generalCfg.minimal) [
|
||||||
|
hplipWithPlugin
|
||||||
|
gutenprint
|
||||||
|
splix
|
||||||
|
brlaser
|
||||||
|
cups-bjnp
|
||||||
|
# cups-dymo
|
||||||
|
# cups-zj-58
|
||||||
|
# cups-kyocera
|
||||||
|
cups-filters
|
||||||
|
carps-cups
|
||||||
|
# cups-kyodialog3
|
||||||
|
cups-brother-hl1110
|
||||||
|
cups-toshiba-estudio
|
||||||
|
cups-brother-hl1210w
|
||||||
|
hll2390dw-cups
|
||||||
|
cups-brother-hl3140cw
|
||||||
|
cups-brother-hll2340dw
|
||||||
|
cups-drv-rastertosag-gdi
|
||||||
|
# cups-kyocera-ecosys-m552x-p502x
|
||||||
|
canon-cups-ufr2
|
||||||
|
]);
|
||||||
|
webInterface = mkDefault true;
|
||||||
|
};
|
||||||
|
services.system-config-printer.enable = true;
|
||||||
|
|
||||||
|
hardware.sane = {
|
||||||
|
enable = true;
|
||||||
|
netConf = "192.168.0.0/24";
|
||||||
|
extraBackends = with pkgs; [
|
||||||
|
hplipWithPlugin
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = optionals config.services.printing.enable [ 631 139 445 ];
|
||||||
|
networking.firewall.allowedUDPPorts = optionals config.services.printing.enable [ 137 ];
|
||||||
|
|
||||||
|
|
||||||
|
aviallon.programs.allowUnfreeList = [
|
||||||
|
"hplip"
|
||||||
|
"hplipWithPlugin"
|
||||||
|
"cups-bjnp"
|
||||||
|
"cups-dymo"
|
||||||
|
"cups-zj-58"
|
||||||
|
"cups-kyocera"
|
||||||
|
"cups-filters"
|
||||||
|
"carps-cups"
|
||||||
|
"cups-kyodialog3"
|
||||||
|
"cups-brother-hl1110"
|
||||||
|
"cups-toshiba-estudio"
|
||||||
|
"cups-brother-hl1210w"
|
||||||
|
"cups-brother-hl1210W"
|
||||||
|
"hll2390dw-cups"
|
||||||
|
"cups-brother-hl3140cw"
|
||||||
|
"cups-brother-hll2340dw"
|
||||||
|
"cups-drv-rastertosag-gdi"
|
||||||
|
"cups-kyocera-ecosys-m552x-p502x"
|
||||||
|
"canon-cups-ufr2"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
70
services.nix
70
services.nix
|
|
@ -76,10 +76,10 @@ in {
|
||||||
programs.ssh.forwardX11 = mkDefault config.services.xserver.enable;
|
programs.ssh.forwardX11 = mkDefault config.services.xserver.enable;
|
||||||
security.pam.services.sudo.forwardXAuth = mkDefault true; # Easier to start GUI programs as root
|
security.pam.services.sudo.forwardXAuth = mkDefault true; # Easier to start GUI programs as root
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 22 ]
|
|
||||||
++ optionals config.services.printing.enable [ 631 139 445 ];
|
|
||||||
networking.firewall.allowedUDPPorts = [ 22 5353 ]
|
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||||
++ optionals config.services.printing.enable [ 137 ];
|
networking.firewall.allowedUDPPorts = [ 22 5353 ];
|
||||||
|
|
||||||
services.rsyncd.enable = !desktopCfg.enable;
|
services.rsyncd.enable = !desktopCfg.enable;
|
||||||
|
|
||||||
|
|
@ -89,68 +89,6 @@ in {
|
||||||
|
|
||||||
services.irqbalance.enable = true;
|
services.irqbalance.enable = true;
|
||||||
|
|
||||||
services.printing = mkIf desktopCfg.enable {
|
|
||||||
enable = true;
|
|
||||||
defaultShared = mkDefault true;
|
|
||||||
browsing = mkDefault true;
|
|
||||||
listenAddresses = [ "0.0.0.0:631" ];
|
|
||||||
drivers = with pkgs; []
|
|
||||||
++ (optionals (!generalCfg.minimal) [
|
|
||||||
hplipWithPlugin
|
|
||||||
gutenprint
|
|
||||||
splix
|
|
||||||
brlaser
|
|
||||||
cups-bjnp
|
|
||||||
# cups-dymo
|
|
||||||
# cups-zj-58
|
|
||||||
# cups-kyocera
|
|
||||||
cups-filters
|
|
||||||
carps-cups
|
|
||||||
# cups-kyodialog3
|
|
||||||
cups-brother-hl1110
|
|
||||||
cups-toshiba-estudio
|
|
||||||
cups-brother-hl1210w
|
|
||||||
hll2390dw-cups
|
|
||||||
cups-brother-hl3140cw
|
|
||||||
cups-brother-hll2340dw
|
|
||||||
cups-drv-rastertosag-gdi
|
|
||||||
# cups-kyocera-ecosys-m552x-p502x
|
|
||||||
canon-cups-ufr2
|
|
||||||
]);
|
|
||||||
webInterface = mkDefault true;
|
|
||||||
};
|
|
||||||
services.system-config-printer.enable = mkIf (desktopCfg.enable && !generalCfg.minimal) true;
|
|
||||||
|
|
||||||
hardware.sane = mkIf desktopCfg.enable {
|
|
||||||
enable = !generalCfg.minimal;
|
|
||||||
netConf = "192.168.0.0/24";
|
|
||||||
extraBackends = with pkgs; [
|
|
||||||
hplipWithPlugin
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
aviallon.programs.allowUnfreeList = [
|
|
||||||
"hplip"
|
|
||||||
"hplipWithPlugin"
|
|
||||||
"cups-bjnp"
|
|
||||||
"cups-dymo"
|
|
||||||
"cups-zj-58"
|
|
||||||
"cups-kyocera"
|
|
||||||
"cups-filters"
|
|
||||||
"carps-cups"
|
|
||||||
"cups-kyodialog3"
|
|
||||||
"cups-brother-hl1110"
|
|
||||||
"cups-toshiba-estudio"
|
|
||||||
"cups-brother-hl1210w"
|
|
||||||
"cups-brother-hl1210W"
|
|
||||||
"hll2390dw-cups"
|
|
||||||
"cups-brother-hl3140cw"
|
|
||||||
"cups-brother-hll2340dw"
|
|
||||||
"cups-drv-rastertosag-gdi"
|
|
||||||
"cups-kyocera-ecosys-m552x-p502x"
|
|
||||||
"canon-cups-ufr2"
|
|
||||||
];
|
|
||||||
|
|
||||||
services.fwupd.enable = true;
|
services.fwupd.enable = true;
|
||||||
|
|
||||||
services.journald.extraConfig = mkOverride 2 (journaldConfig cfg.journald.extraConfig);
|
services.journald.extraConfig = mkOverride 2 (journaldConfig cfg.journald.extraConfig);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue