nixpkgs
nixpkgs copied to clipboard
autorandr: Fix distutils import warning
Because autorandr still imports distutils, it produces a bunch of deprecation warnings. we need to add packaging to propagatedBuildInputs, but because this wasn't wrapped, the wrapper hood did not take care of adjusting the system path.
The easiest way I could find to fix this was to actually wrap autorandr. Then I also had to add a patch to disable autorandr using sys.executable to fork itself in --batch mode. Otherwise it tries to use python to run the bash wrapper, which doesn't work. This should be fine in a nixpkgs environment, since nixpkgs sets the shebang explicitly.
Description of changes
Things done
- Built on platform(s)
- [x] x86_64-linux
- [ ] aarch64-linux
- [ ] x86_64-darwin
- [ ] aarch64-darwin
- [ ] For non-Linux: Is
sandbox = true
set innix.conf
? (See Nix manual) - [x] Tested, as applicable:
- NixOS test(s) (look inside nixos/tests)
- and/or package tests
- or, for functions and "core" functionality, tests in lib/tests or pkgs/test
- made sure NixOS tests are linked to the relevant packages
- [ ] Tested compilation of all packages that depend on this change using
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage - [x] Tested basic functionality of all binary files (usually in
./result/bin/
) -
22.11 Release Notes (or backporting 22.05 Release notes)
- [ ] (Package updates) Added a release notes entry if the change is major or breaking
- [ ] (Module updates) Added a release notes entry if the change is significant
- [ ] (Module addition) Added a release notes entry if adding a new NixOS module
- [ ] (Release notes changes) Ran
nixos/doc/manual/md-to-db.sh
to update generated release notes
- [ ] Fits CONTRIBUTING.md.
It's a draft because I haven't managed to get the patch to apply, I always get the git incantations wrong. I'll get back to this later today
gentle bump
I have tested this. Fixes the warning, batch works when tested as
$ sudo su
$ unset DISPLAY
$ autorandr --batch <profile_that_only_exits_for_user>