summaryrefslogtreecommitdiffstats
path: root/makefu/3modules/sane-extra.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2023-08-01 12:14:30 +0200
committertv <tv@krebsco.de>2023-08-01 12:14:30 +0200
commit7be9bfdc55d672de39dce98dae9c6d112404dfc6 (patch)
treee89a93ad96e6f35490ffbf6b6a337ca4dcc9a170 /makefu/3modules/sane-extra.nix
parent5d1b0675cf179f863a5b34b67661a953197b6057 (diff)
parent6e63efa3645353bc0549f5f152ef811fff5d644c (diff)
Merge remote-tracking branch 'orange/master'
Diffstat (limited to 'makefu/3modules/sane-extra.nix')
-rw-r--r--makefu/3modules/sane-extra.nix45
1 files changed, 0 insertions, 45 deletions
diff --git a/makefu/3modules/sane-extra.nix b/makefu/3modules/sane-extra.nix
deleted file mode 100644
index 8cbed572c..000000000
--- a/makefu/3modules/sane-extra.nix
+++ /dev/null
@@ -1,45 +0,0 @@
-{ config, lib, pkgs, ... }:
-# https://github.com/michalrus/dotfiles/blob/d943be3089aa436e07cea5f22d829402936a9229/.nixos-config.symlink/modules/sane-extra-config.nix
-# via https://github.com/NixOS/nixpkgs/issues/17411
-# via https://unix.stackexchange.com/questions/321954/install-epson-v39-on-nixos
-with lib;
-
-let
-
- cfg = config.hardware.sane;
-
- pkg = if cfg.snapshot
- then pkgs.sane-backends-git
- else pkgs.sane-backends;
-
- backends = [ pkg ] ++ cfg.extraBackends;
-
- saneConfig = pkgs.mkSaneConfig { paths = backends; };
-
- saneExtraConfig = pkgs.runCommand "sane-extra-config" {} ''
- cp -Lr '${pkgs.mkSaneConfig { paths = [ pkgs.sane-backends ]; }}'/etc/sane.d $out
- chmod +w $out
- ${concatMapStrings (c: ''
- f="$out/${c.name}.conf"
- [ ! -e "$f" ] || chmod +w "$f"
- cat ${builtins.toFile "outfile" (c.value + "\n")} >>"$f"
- chmod -w "$f"
- '') (mapAttrsToList nameValuePair cfg.extraConfig)}
- chmod -w $out
- '';
-
-in
-
-{
- options = {
- hardware.sane.extraConfig = mkOption {
- type = types.attrsOf types.lines;
- default = {};
- example = { "some-backend" = "# some lines to add to its .conf"; };
- };
- };
-
- config = mkIf (cfg.enable && cfg.extraConfig != {}) {
- hardware.sane.configDir = saneExtraConfig.outPath;
- };
-}