about summary refs log tree commit diff
path: root/machines/aszlig/dnyarri.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2017-01-02 15:20:21 +0100
committeraszlig <aszlig@redmoonstudios.org>2017-01-02 15:26:07 +0100
commit356739b3265fb5fff1179c0da7f7f7972a489fcc (patch)
tree7ed9a96a580fe74e14972a91c5affb975c4d2600 /machines/aszlig/dnyarri.nix
parent0e7e1791e6b81c6ba55e6a73cdd8ae9c4bd57024 (diff)
machines/dnyarri: Enable sane with hplip
This machine is used for collecting all that useless paperwork gathered
since a few years, so I need scanner support.

Unfortunately the scanner (it's part of a HP Officejet all-in-one
thingy) needs to have a proprietary plugin for hplip in order to work,
which is not nice and I'm not very proud about needing to do this.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'machines/aszlig/dnyarri.nix')
-rw-r--r--machines/aszlig/dnyarri.nix25
1 files changed, 21 insertions, 4 deletions
diff --git a/machines/aszlig/dnyarri.nix b/machines/aszlig/dnyarri.nix
index d65b343f..513d53cb 100644
--- a/machines/aszlig/dnyarri.nix
+++ b/machines/aszlig/dnyarri.nix
@@ -27,6 +27,20 @@
 
   environment.systemPackages = [ pkgs.paperwork ];
 
+  # This is very ugly and I really want to avoid non-free packages on all
+  # of my workstations. But right now I need to get rid of useless paper.
+  nixpkgs.config = {
+    allowUnfreePredicate = pkg: let
+      inherit (builtins.parseDrvName pkg.name) name;
+    in lib.hasSuffix "-hplip" name && lib.hasPrefix "python" name;
+    packageOverrides = super: {
+      hplip = super.hplip.override { withPlugin = true; };
+    };
+  };
+
+  hardware.sane.enable = true;
+  hardware.sane.extraBackends = [ pkgs.hplip ];
+
   vuizvui.user.aszlig.system.kernel.enable = true;
   hardware.enableAllFirmware = true;
 
@@ -52,10 +66,13 @@
     device = "/dev/shofixti/swap";
   };
 
-  # TODO: Try to avoid this, but as there is only a single user using audio on
-  # this machine, it's okay for now. But remember that this will break heavily,
-  # should there be another user accessing the audio devices.
-  users.users.aszlig.extraGroups = [ "audio" ];
+  users.users.aszlig.extraGroups = [
+    "scanner"
+    # TODO: Try to avoid this, but as there is only a single user using audio
+    # on this machine, it's okay for now. But remember that this will break
+    # heavily, should there be another user accessing the audio devices.
+    "audio"
+  ];
 
   services.synergy.client.enable = true;
   services.synergy.client.serverAddress = "mmrnmhrm";