l: steal br from tv

This commit is contained in:
lassulus 2017-10-26 20:01:37 +02:00
parent 45f205e1c5
commit 8083880f49
2 changed files with 49 additions and 0 deletions

View File

@ -29,6 +29,7 @@ with import <stockholm/lib>;
<stockholm/lass/2configs/syncthing.nix>
<stockholm/lass/2configs/otp-ssh.nix>
<stockholm/lass/2configs/c-base.nix>
<stockholm/tv/2configs/br.nix>
{
#risk of rain port
krebs.iptables.tables.filter.INPUT.rules = [

48
lass/2configs/br.nix Normal file
View File

@ -0,0 +1,48 @@
with import <stockholm/lib>;
{ config, pkgs, ... }: {
imports = [
<nixpkgs/nixos/modules/services/hardware/sane_extra_backends/brscan4.nix>
];
krebs.nixpkgs.allowUnfreePredicate = pkg: any (flip hasPrefix pkg.name) [
"brother-udev-rule-type1-"
"brscan4-"
"mfcl2700dnlpr-"
];
hardware.sane = {
enable = true;
brscan4 = {
enable = true;
netDevices = {
bra = {
model = "MFCL2700DN";
ip = "10.23.42.221";
};
};
};
};
services.saned.enable = true;
# usage: scanimage -d "$(find-scanner bra)" --batch --format=tiff --resolution 150 -x 211 -y 298
environment.systemPackages = [
(pkgs.writeDashBin "find-scanner" ''
set -efu
name=$1
${pkgs.sane-backends}/bin/scanimage -f '%m %d
' \
| ${pkgs.gawk}/bin/awk -v dev="*$name" '$1 == dev { print $2; exit }' \
| ${pkgs.gnugrep}/bin/grep .
'')
];
services.printing = {
enable = true;
drivers = [
pkgs.mfcl2700dncupswrapper
];
};
}