Commit Graph

133 Commits

Author SHA1 Message Date
Federico Beffa
25307e756c sane-backends: fix multipages scan 2026-01-09 16:28:41 +01:00
NAHO
c8d4dabc43 pkgs: remove optional builtins prefixes from prelude functions
Remove optional builtins prefixes from prelude functions by running:

    builtins=(
      abort
      baseNameOf
      break
      derivation
      derivationStrict
      dirOf
      false
      fetchGit
      fetchMercurial
      fetchTarball
      fetchTree
      fromTOML
      import
      isNull
      map
      null
      placeholder
      removeAttrs
      scopedImport
      throw
      toString
      true
    )

    fd \
      --type file \
      . \
      pkgs \
      --exec-batch sed --in-place --regexp-extended "
        s/\<builtins\.($(
          printf '%s\n' "${builtins[@]}" |
            paste --delimiter '|' --serial -
        ))\>/\1/g
      "

    nix fmt
2025-10-04 19:02:37 +02:00
Pol Dellaiera
bf1c73d3b1 sane-backends: replace systemd with systemdLibs 2025-09-09 08:45:32 +02:00
Pol Dellaiera
0a28e12493 sane-backends: remove substituteInPlace
They are failing when using `--replace-fail`
2025-09-09 08:45:01 +02:00
Pol Dellaiera
8b942e7829 sane-backends: use finalAttrs pattern 2025-09-08 21:37:03 +02:00
K900
618142c161 sane-backends: cherry-pick fix for scanimage locking up on exit
This takes installCheckPhase from hanging on probably 90% of attempts
to not hanging a single time over an hour or so of looped builds.
2025-08-11 14:35:47 +03:00
Wolfgang Walther
5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
nixpkgs-ci[bot]
78742e6d53 Merge master into staging-next 2025-06-13 18:05:47 +00:00
Guillaume Girol
8da804cb82 sane-backends: 1.3.1 -> 1.4.0 (#414114) 2025-06-13 16:21:48 +02:00
nixpkgs-ci[bot]
c9ad1567d4 Merge master into staging-next 2025-06-05 12:07:29 +00:00
Alyssa Ross
6c76fd5f51 sane-backends: more accurate systemd support check
As opposed to conditioning it on isLinux.
2025-06-05 13:34:40 +02:00
R. Ryantm
17a870ecc6 sane-backends: 1.3.1 -> 1.4.0 2025-06-04 23:00:48 +00:00
Grimmauld
65012b363e treewide: enable doPostInstall for libusb1 packages that expose udev rules
`libusb1` propagates the `udevCheckHook`.
Packages which depend on `libusb1` and expose udev
rules should enable the `doPostInstall` flag.
2025-05-27 21:42:39 +02:00
Peder Bergebakken Sundt
5aba99242e treewide: fix typos in comments
Made with

```shell
git restore .
fd '\.nix$' pkgs/ --type f -j1 -x bash -xc "$(cat <<"EOF"
    typos --no-check-filenames --write-changes "$1"
    git diff --exit-code "$1" && exit
    #( git diff "$1" | grep -qE "^\+ +[^# ]") && git restore "$1"
    count1="$( bat --language nix --diff --style changes "$1" --theme "Monokai Extended" --color always | aha --no-header | grep -E '^<span style="color:olive;">~</span> ' | wc -l )"
    count2="$( bat --language nix --diff --style changes "$1" --theme "Monokai Extended" --color always | aha --no-header | grep -E '^<span style="color:olive;">~</span> (<span style="color:#f8f8f2;"> *</span>)?<span style="color:#75715e;">.*</span>$' | wc -l )"
    [[ $count1 -ne $count2 ]] && git restore "$1"
EOF
)" -- {}
```

and filtered with `GIT_DIFF_OPTS='--unified=15' git -c interactive.singleKey=true add --patch`

I initially tried using the tree-sitter cli, python bindings and even ast-grep through various means, but this is what I ended up with.
2025-02-24 10:44:41 +01:00
Silvan Mosberger
4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
aleksana
571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00
Reno Dakota
52bf1163fa treewide: use getLib when accessing clang / libclang / stdenv.cc.cc
In preparation to eliminate the lib output for the unwrapped clang, use
`lib.getLib` to access the `lib` output.
2024-11-07 10:27:41 +00:00
Artturin
e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00
Philip Taron
fe193f4262 brscan5: remove with statements 2024-08-18 06:31:12 -07:00
Philip Taron
c61702920f brscan4: remove with statements 2024-08-18 06:31:12 -07:00
Aleksana
84a53ad8e2 Merge pull request #328741 from Sigmanificient/remove-unused-arguments-pkgs-app
pkgs/applications: remove unused arguments
2024-07-26 22:05:49 +08:00
Sigmanificient
2ee703dccb pkgs/applications: remove unused arguments 2024-07-26 11:36:49 +02:00
Jonas Heinrich
4edef1362f sane-backends: configure and use lock dir 2024-07-22 16:46:30 +02:00
Jonas Heinrich
9ab8fb342a sane-backends: 1.2.1 -> 1.3.1 2024-07-22 11:17:27 +02:00
teutat3s
a9cc39ca75 brscan5: 1.3.0-0 -> 1.3.1-0 2024-04-16 19:17:41 +02:00
annalee
0d7dc0efc5 treewide: throw on unsupported system src access 2024-04-05 02:30:42 +00:00
Guillaume Girol
4323d8b63d Merge pull request #291668 from symphorien/sane_epkowa_hwdb
sane-backends: generate hwdb entries for epkowa scanners correctly
2024-03-24 17:28:20 +01:00
Siddhartha
fadc1d7ef2 sane-airscan: 0.99.27 -> 0.99.29 2024-03-19 23:18:04 +01:00
stuebinm
ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00
Guillaume Girol
22bb14bd5d sane-backends: generate hwdb entries for epkowa scanners correctly
without patching.

Entries for these scanners are both in the doc/descriptions folder,
marked as unsupported by the epson2 backend, and in the doc/descriptions-external,
supported by the epkowa backend.
2024-02-26 12:00:00 +00:00
Guillaume Girol
996d064488 Merge pull request #278131 from symphorien/sane_test
nixos/sane: add nixos test
2024-01-30 21:00:12 +01:00
Samy Lahfa
083770a4ba brscan5: 1.2.9-0 -> 1.3.0-0
* Use sha256 instead of sha512
* Correct patch offset due to the fact that the driver is hardcoded to
look in /opt/brother/scanner/brscan5/models for model metadata.
* see comments for more details : https://github.com/NixOS/nixpkgs/pull/254992#issuecomment-1826811896
2024-01-14 19:47:10 +01:00
Guillaume Girol
ff893386c5 nixos/sane: add nixos test 2024-01-02 12:00:00 +00:00
Guillaume Girol
f9c5b550c2 sane_backends: disable parallel install
parallel install creates a bad symlink at $out/lib/sane/libsane.so.1
which prevents finding plugins.

Fixes https://github.com/NixOS/nixpkgs/issues/224569
2023-04-10 12:00:00 +00:00
Guillaume Girol
f0ddf281c5 sane-backends: 1.1.1 -> 1.2.1
changelog: https://gitlab.com/sane-project/backends/-/tags/1.2.1

Tested by scanning in nixos-rebuild build-vm, which can be done by
passing your USB printer to the vm as follows:
QEMU_OPTS="-device usb-ehci,id=ehci -device usb-host,vendorid=0x1234,productid=0xabcd" result/bin/run-nixos-vm
where lsusb reports
Bus 003 Device 008: ID 1234:abcd The Printer
2023-02-12 12:00:00 +00:00
Guillaume Girol
ddf0216b22 Merge pull request #202874 from symphorien/update-sane-backends
sane-backends: 1.0.32 -> 1.1.1
2022-11-29 13:51:30 +00:00
Guillaume Girol
03365bdf54 sane-backends: 1.0.32 -> 1.1.1
and add myself as maintainer

changelog: https://gitlab.com/sane-project/backends/-/releases/1.1.1
2022-11-24 12:00:00 +00:00
Guillaume Girol
b4cbe1dac3 sane_backends: more complete hwdb files
We used to ship the pre-computed udev rules that are distributed in the
tarballs. This is problematic as it changes the group of scanners to
scanner which removes the group lp and prevents cups from using it.
(https://github.com/NixOS/nixpkgs/issues/147217)
For this reason we switched to generating udev and hwdb files as follows:

    ./tools/sane-desc -m udev+hwdb -s doc/descriptions:doc/descriptions-external > $out/etc/udev/rules.d/49-libsane.rules
    ./tools/sane-desc -m udev+hwdb -s doc/descriptions -m hwdb > $out/etc/udev/hwdb.d/20-sane.hwdb

following what other distros do.
(https://github.com/NixOS/nixpkgs/pull/176412)

this is great, but sane-desc does not include unsupported .desc entries
like EPSON V300 PHOTO, which was present in the distributed udev rules.
So even when installing all the required unfree stuff to make the
corresponding epkowa backend work, it only works as root as there is no
corresponding hwdb entry. As the .desc entry contains the usb ids, we
can just patch sane-desc to generate hwdb entries even for unsupported
models.
2022-11-04 18:51:01 +01:00
Artturin
cf360a1095 sane-backends: fix cross
pulled patch from void-linux

MMAP is only on linux i think
2022-09-01 00:21:13 +03:00
Guillaume Girol
358dcd9dc6 sane-backends: install hwdb file
copied from debian https://jff.email/cgit/sane-backends.git/tree/debian/rules#n140
2022-08-08 12:00:00 +00:00
github-actions[bot]
5b9ee17283 Merge master into staging-next 2022-06-24 00:02:29 +00:00
Robert Scott
466c2e342a treewide/applications: add sourceType binaryNativeCode for many packages 2022-06-23 18:38:19 +01:00
7FM
fd84f6bb0c sane-backends: fix udev rule generation 2022-06-05 18:03:11 +02:00
Artturin
c1fffdfffb treewide: change some glibc to stdenv.cc.libc 2022-05-27 05:57:43 +03:00
Artturin
0c4d65b21e treewide: stdenv.glibc -> glibc 2022-05-25 15:51:20 +03:00
Sandro
e650789e6e Merge pull request #169510 from reckenrode/darwin-sane
sane-backends: fix build on Darwin
2022-04-27 16:56:35 +02:00
Randy Eckenrode
f6999e0cc5 sane-backends: fix build on Darwin 2022-04-21 22:01:19 -04:00
Ben Siraphob
259fa13d53 treewide: remove nativeBuildInputs that are in stdenv 2022-04-16 21:46:46 +03:00
Matt Christ
c5fac1f611 brscan5: 1.2.7-0 -> 1.2.9.0 (#164903)
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2022-03-27 13:43:16 +02:00
Fabian Möller
4329d79dba nixos/tests: link tests to their packages 2022-01-23 21:08:10 +01:00