From 4a8e6c92400bc1f4e95aea19c33ea1718aa8451a Mon Sep 17 00:00:00 2001
From: Aaron  Honeycutt <aaronhoneycutt@protonmail.com>
Date: Fri, 5 Jan 2024 21:08:39 +0000
Subject: [PATCH] Add usage of nvd for upgrade diffs and scanner support

---
 configuration.nix | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/configuration.nix b/configuration.nix
index 4e428c5..38ff84d 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -106,6 +106,7 @@
                lshw
                roboto-slab
                nix-index
+               nvd
                unzip
                wget
                xz
@@ -137,10 +138,27 @@
       enable = true;
       nssmdns = true;
       openFirewall = true;
+         # Needed for detecting scanners
+         publish = {
+            enable = true;
+            addresses = true;
+            userServices = true;
+         };
+   };
+
+   # Scanner support
+   hardware.sane.enable = true;
+   hardware.sane.ExtraBackends = [ pkgs.sane-airscan ];
+   services.ipp-usb.enable = true;
+
+   system.activationScripts.diff = {
+     supportsDryActivation = true;
+     text = ''
+       ${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig"
+     '';
    };
 
    # System 
    system.stateVersion = "23.05";
    system.autoUpgrade.enable = true;
-
 }