Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sane module: support overriding config files #78773

Merged
merged 2 commits into from Feb 10, 2020
Merged

Conversation

@layus
Copy link
Member

@layus layus commented Jan 29, 2020

Motivation for this change

Currently, sane configuration cannot be overridden, because backends cannot contain colliding files.
This update allows collisions, and takes the latest file in the list of backends.

See https://discourse.nixos.org/t/l355-epson-wifi-scanner/5543/8

This is a bit hacky, but will be very helpful in a first approach, before someone rewrites this module thoroughly.

TODO: This seems like a good canditate for buildEnv. Is it really important that subdirs are not traversed ? The code dates back to 2014-2016, so maybe the reason is just legacy.

/cc @ttuegel, @abbradar for info

Things done
@nixos-discourse
Copy link

@nixos-discourse nixos-discourse commented Jan 29, 2020

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/l355-epson-wifi-scanner/5543/10

Copy link
Contributor

@romildo romildo left a comment

Tested with an Epson L355. The configuration.nix contains:

  hardware.sane = {
    enable = true;
    # https://discourse.nixos.org/t/l355-epson-wifi-scanner/5543/8
    extraBackends = pkgs.lib.singleton (pkgs.writeTextFile {
      name = "epson2.conf";
      text = ''
        net 192.168.0.129
      '';
      destination = "/etc/sane.d/epson2.conf";
    });
  };

The output of scanimage:

$ scanimage -L
device `v4l:/dev/video0' is a Noname Integrated_Webcam_HD: Integrate virtual device
device `epson2:net:192.168.0.129' is a Epson PID 08A8 flatbed scanner
@ttuegel
ttuegel approved these changes Feb 8, 2020
Copy link
Member

@ttuegel ttuegel left a comment

I have one suggestion, but this seems reasonable.

pkgs/applications/graphics/sane/config.nix Outdated Show resolved Hide resolved
@layus
Copy link
Member Author

@layus layus commented Feb 10, 2020

@ttuegel Updated, thanks !

@ttuegel ttuegel merged commit b78092a into NixOS:master Feb 10, 2020
12 checks passed
12 checks passed
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A darwin-tested
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release-combined.nix -A tested
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A manual
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A options
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A manual
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A tarball
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A unstable
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
@layus layus deleted the layus:sane-override branch Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.