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

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

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 0 This PR does not cause any packages to rebuild labels Jan 29, 2020
@romildo romildo self-requested a review January 30, 2020 14:45
Copy link
Contributor

@romildo romildo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

@ttuegel ttuegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 commented Feb 10, 2020

@ttuegel Updated, thanks !

@ttuegel ttuegel merged commit b78092a into NixOS:master Feb 10, 2020
@layus layus deleted the sane-override branch February 11, 2020 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 0 This PR does not cause any packages to rebuild
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants